Latest Posts

Topic: Soldier fight simulator

leklachu
Avatar
Topic Opener
Joined: 2021-12-08, 19:21
Posts: 8
Ranking
Pry about Widelands
Posted at: Yesterday 16: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: Yesterday 16:20

Top Quote