• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

Wethospu

Captain
47 Badges
May 29, 2019
360
261
  • Prison Architect: Psych Ward
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
I was struggling to figure out the combat in this game so I decided to start working a combat simulator. Current progress can be found at: https://ir.pdxsimulator.com

It's still bit rough around the edges and not 100% accurate. But I have done some testing and it's working fairly well (my guess is 99% accuracy, excluding bugs). I'm releasing it to get some early feedback.

Key features:

* Select units, tactics and terrains to mimic battles in the game
* Edit units, tactics and terrains to test different situations
* Undo combat rounds if you aren't happy with the result
* Automatic deployment

Planned features:

* More testing for more accurate results
* UI improvements
* Trade, research, traditions, etc. to edit units more easily
* Siege simulator
* Naval simulator
* More information, graphs, statistics, etc.
 
Last edited:
  • 2Like
Reactions:
Nicely done.
 
Moved to User Mods Sub-forum.
 
Next version for my simulator https://imperator-simulator.com (0.2.0). Should be quite interesting for modders who are considering of adding new units or balancing existing ones.

Last two weeks were spent mainly implementing requested features. Changes since the last update:

* Added reserve which automatically deploys to the battle field (same as in-game)
* Added preferred unit types to customize deployment (same as in-game)
* Added Create units button to quickly add units to the reserve, also shows some statistics about the whole army
* Base damage shown on the screen
* Armies can be added and deleted, so testing multiple armies is much easier
* Units, tactics and terrains can be added, probably only useful for modders
* New stats page showing some statistics of the current combat
* New settings page to change constants used in damage calculations, probably only useful for modders
* New transfer page to import and export data, also allows easily to reset everything
* New instructions page so hopefully bit easier to figure out how everything works, this will definitely be expanded later

Planned features:

* More testing for more accurate results
* UI improvements
* Trade, research, traditions, etc. to edit units more easily
* Siege simulator
* Naval simulator
* More information, graphs, statistics, etc.
 
Next version for my simulator https://imperator-simulator.com (0.3.0).

Main focus on adding naval simulator for the upcoming 1.1 patch:
  • Naval mode with new naval units, tactics and terrains
  • Units can be land, naval or both (if you really need to know would 20 Horse Archers beat 10 Mega Galleys)
  • Added targeting information to visualize how flanking works
  • Separate combat parameters for land and naval
  • Tactic selector shows effectiveness against opposing tactics
  • Preferred unit type can be cleared
  • Unit types can be changed (no need to remove and add)
  • Bug fixes and UI improvements

Planned features:
  • More testing for more accurate results
  • UI improvements
  • Trade, research, traditions, etc. to edit units more easily
  • Siege simulator
  • More information, graphs, statistics, etc.
 
Next version for my simulator https://imperator-simulator.com (0.4.2).

Main focus on adding most military buffs and debuffs, and preparing for 1.2 update.

Countries page with general traits, traditions trade, research, omens, heritage, and goverment modifiers
  • General: Martial skill level, military traits, naval abilities.
  • Traditions: Military power, Traditions for each culture.
  • Trade: Military related import / export.
  • Research: Military tech and inventions.
  • Omens: Military omens for each religion.
  • Government: Military office positions, laws and economy options.
  • Heritage: All heritages (even non-military ones for better comparison).

Separate army management (armies and countries separated)
  • Implemented but considered too confusing to use -> feature not implemented.
  • Removed from todo list.

UI tweaks and fixes
  • Spported game version also show on the top right corner.
  • Color coded numeric values (green for positive, red for negative) like in the game.
  • Tactic selector shows tactic efficiency and casulties.
  • Updated combat formula to match changes in version 1.1 (should be really accurate now).
  • More accurate maintenance costs.
  • More accurate tactic effectiveness.
  • Added support for cost, maintenance and attrition weight modifiers.
  • More accurate damage reduction from experience.
  • More accurate deployment / reinforcement (added check for unit strength, further testing still needed).
  • More accurate offense/defense calculation.
  • 1.2 unit balance changes.
  • Units page shows different attributes for land and laval mode.
  • Different icons and number formats for unit strength (land and naval mode).
  • Fixed targeting visualization not working for the first unit.
  • Improved robustness (site should work better even if some data is missing).
  • Units page now only shows units for the selected country (less clutter).
  • Improved country management (replaced old army management).
  • Fixed Land units appearing in some places with naval mode (and vice versa).
  • Fixed Land terrains appearing with naval mode (and vice versa).
  • Added right click to remove units.
  • More things I forgot...

Planned features:
  • More testing for more accurate results
  • UI improvements
  • Siege simulator
  • More information, graphs, statistics, etc.
 
Next version for my simulator https://imperator-simulator.com (0.5.0).

It's been a while since the last update. The main reason is that Cicero update broke unit deployment which made the simulator not accurate (in some cases). I figured I would wait for the hotfix but seems like 1.2.1 won't be coming so let's roll with what we got.

Initially this was only supposed to be a maintenance update. Refactor and write major parts of the code to make it easier to maintain. Polish and tweak the UI and features to be more intuitive and useful.

But during that, I realized that two things would be super useful. So like in all software projects I tossed maintenance aside and started cramming in even more features.

Units now have tooltips, like in the game. One difference is that these show all information accurately so it should be easier to understand them. I tried to keep them simple so please let me know if I have omitted too much information.

Previously the simulator could be used to kind of experiment and test things out. You could get some rough idea who beats who but random dice rolls made it difficult to get some concrete hard numbers. So I implemented an engine which runs the combat with different dice rolls.

We are talking about millions of runs here so accurate results take a while. But it instantly returns some results which get more accurate longer you wait (and there are also some settings in Settings page to tweak it).

Most of the statistics are in the Stats page, but the main page also has a win rate available since I think that is the most interesting information. I don't know how useful all this data is so please let me know if you any questions or ideas regards this.

Other changes are:

  • Random dice rolls are now based on a seed. Seed can be set before combat (at bottom of the main page) to lock rng. This is probably not very useful but required for internal changes.
  • Big performance improvement for huge and long battles (required rewriting how round information is stored).
  • The battle now automatically refreshes when units or options are changed. Changes done during the combat are automatically applied to the initial state. Before this, changes during combat would be lost when going back in time (not to mention incorrect results).
  • Units now have unique ids. This is probably not very useful but required for internal changes.
  • Added some missing or changed general traits, traditions, inventions, laws, etc...
  • More unit tests for combat and other code (to ensure quality).
  • Added a setting for naval damage taken bug.
  • Data can now be imported from a file or exported to a file (no need to copypaste).
  • Added global error page which appears if something goes wrong. It's purpose is to reset the data which should fix the problem in most cases. This results in much cleaner code since I no longer have to write it so defensively.
  • Added option to make unit loyal. Loyal units deal 10% more damage in combat.
  • Default tactic changed to Deception because it doesn't affect casualties.
  • Reordered tabs on navigation to hopefully make more sense.
  • Moved old content of Stats page to main page as it's more relevent there. Also reordered components to make more sense.
  • Lots of bug fixes, as usual.
 
Version 0.5.3 was just uploaded which containts changes from 1.3 Livy update.

Changelog:

  • Battle: Big performance boost for combat calculations (uses now the much faster algorithm from Statistics).
  • Battle: Added 'Reset all data' to bottom of the page.
  • Battle: Fixed seed getting stuck which locked dice rolls.
  • Statistics: New checkbox to hide casualties information (makes calculations slightly faster).
  • Statistics: New slider to quickly change calculation speed settings (speed vs accuracy).
  • Statistics: Optimized deployment and reinforcement.
  • Countries: Heritage changes from 1.3.
  • Countries: Changed color of maintenance increase from technology to red (negative).
  • Units: Added Supply Train.
  • Units: Applied 1.3 unit balance changes (cost changes + War Elephants increased moral damage taken).
  • Units: Is flank property changed to deployment mode (with Front, Flank or Support) to add support for Support units.
  • Settings: Two new settings to match changes of Statistics page.
  • Transfer: Added 'Reset all data' to bottom of the page (technically this was already possible by importing nothing).
  • Error: Added a button to download current data if something goes wrong (can be imported later to try restore some of your changes).