Latest Posts

Topic: Soldier fight simulator

leklachu
Avatar
Topic Opener
Joined: 2021-12-08, 20:21
Posts: 8
Ranking
Pry about Widelands
Posted at: 2024-10-15, 17:18

So, almost three years on, I got back to my Widelands soldier fight simulator

Wide-Fighter

A balance simulator for a million soldiers

Longer update

In 2021 I made a soldier fighter in webassembly for testing balance. Forum thread at https://www.widelands.org/forum/topic/5475/ . Frankystone/kapputnik was kind enough to polish up the looks, but I got stuck on making it take any input other than buttons. So I never managed a custom soldier option, and rather burnt out of web-apps.

Now I found a new web UI toolkit I like, so I've rebuilt it. The new app has a few new features

  • Customisable soldiers
  • Show the results as they come in; don't have to fight every match-up to see anything
  • Save results and parameters for when you open the app again
  • I like this UI framework more so I'm more likely to fix issues / take requests
  • Might be better optimised? I can run a full set of 15 match-ups with 10 million fights each, in reasonable time.

There are downsides

  • Not pretty
  • Bad on mobile and on small screens (zoom out to see the whole thing!)
  • Doesn't take CSS input in designing, so if you're good with html/css and want to help.... sorry

And finally I need to retire the old one, hosted on netlify It turns out, if that were to get a flood of traffic one day (e.g. a link on reddit?) it would cost me, I think arbitrarily large, and there's no way to stop or limit that, save ghosting Netlify. I can't take that risk, unlikely though it is. I can't get it to build right now, but if anyone really wants that old version, let me know and I'll work out how, and get it up on github pages.

The old site's code is now at https://github.com/leklachu/wide-fighter_yew

Improvements

Improvements depend on, I'm afraid, my very fickle energy levels. But now while the code is fresh in my mind is a good time to make requests. You can make them here or on the github issues page. (https://github.com/leklachu/wide-fighter/issues)

  • I definitely want to make it fit on the screen better. The easiest way might be a bit ugly, but at least it should work.
  • I'll probably take a few days' break now it's working; hence I wanted to get it up now.
  • If you want to run it yourself, or contribute code, it uses egui/eframe with rust, which is fairly easy, but does of course have some quirks to trip you up. At least with Rust, if it compiles, it probably works! And the compiler makes good hints.

Building yourself

One more side note. I've been having fun with Julia programming language again, which is also good for fast simulations like this, and with the advantage of being quicker to write and play around with, but can't really make a portable web app. If anyone really wants more complicated/flexible fight simulations, and is happy to install Julia on their own machine to use it, I'd be up for writing a Julia version.

Edited: 2024-10-15, 17:20

Top Quote
blind3rdeye
Avatar
Joined: 2020-03-26, 08:47
Posts: 77
Ranking
Likes to be here
Posted at: 2024-10-23, 08:14

I learnt that untrained barbarian soldiers should never attack - because they are significantly weaker than other untrained soldiers. I guess I should consider that when I'm testing the balance of my 'Basic Outpost' starting conditions. ... although really, the game is too complex for me to tell what's fair anyway.

And for fully trained elites, I see Empire is a little bit weaker than others; for whatever that's worth.


Top Quote
mxb2001
Avatar
Joined: 2019-05-20, 18:49
Posts: 304
OS: Linux
Version: 1.2
Ranking
Tribe Member
Location: The land of the thirsty spider
Posted at: 2024-10-23, 20:43

The weaker ones are probably cheaper. Unlike "simpler" games where you pay X "gold" to build unit Y here assembling a unit is very involved. So much so that only the most experienced players have a sense of how much it "costs" to make a soldier. Me, I struggle to scrape together stuff to make soldiers... : ) And after I do it always runs down and gets stuck. But hey that's kinda the fun of WL, you're kept busy plugging holes.


--
To Boldly Go Where No Man Has Gone Before

Top Quote
OIPUN
Avatar
Joined: 2020-11-17, 09:34
Posts: 175
Ranking
At home in WL-forums
Location: Czech
Posted at: 2024-10-24, 16:16

mxb2001 wrote:

The weaker ones are probably cheaper.

I also think the balance is fine.

mxb2001 wrote:

Unlike "simpler" games where you pay X "gold" to build unit Y here assembling a unit is very involved.

Also true, today even in the real world we can see that gold is the only thing you need to make a soldier. So inexperienced players may have problems how complex WL is.

Edited: 2024-10-24, 16:24

Top Quote