Osims - New battle Simulator

  • Hello everyone.

    Before resubmitting the project, I'd like to clarify a few things.

    My previous project was based on https://simulator.ogame-tools.com/, developed by Jolteon. Unfortunately, due to an oversight during the AI input phase, I ended up copying parts of the code from the OgameTools project. I wanted to apologize to Jolteon for the inconvenience, which has now been resolved. I'd like to clarify that it was absolutely not my intention to plagiarize the OgameTools tool; it was simply intended to be an example of a working tool with some loading issues.




    Now let's move on to the tool : https://www.ogameutilities.it/Osims/


    OGame Battle Simulator — How the simulation works (Ai generated)

    One of the things that makes this simulator stand out is how it automatically adjusts the way it runs each battle based on the fleets you enter. You don't need to configure anything — it figures out the best approach on its own.

    Adaptive number of simulations

    When you hit "Simulate", the tool doesn't always run the same fixed number of battles. It looks at the total size of both fleets and scales the simulation count accordingly:

    • Small fleets (a few thousand ships) → runs up to 10× more simulations than the base setting, giving you much more accurate win percentages and average losses.
    • Medium fleets → runs the standard number, still well within a good accuracy range.
    • Very large fleets → may run fewer simulations, but compensates with smarter sampling (see below).

    The goal is always to finish in roughly 8 seconds or less, regardless of fleet size.

    Automatic scaling for massive fleets

    When two players bring millions of ships, simulating every single unit one by one would take minutes. Instead, the simulator automatically reduces both fleets proportionally before running the battle, then scales the results back up at the end.

    A few important safeguards are built in:

    • The maximum reduction ratio is 1:5. Beyond that, the combat math starts producing noticeable inaccuracies (tanks compress too much, rare ships explode too easily), so the simulator refuses to go further and prefers fewer simulations over a distorted result.
    • Rare ship types are protected: if you bring, say, only 2 Death Stars, the simulator makes sure the scaling factor never reduces them to zero — those ships stay in the fight.
    • When scaling is applied, the result label shows the exact ratio used, so you always know what mode you're in.

    Result accuracy at a glance

    After each simulation run, the summary box shows:

    • Win % for attacker / defender / draw
    • Average surviving ships on both sides
    • Estimated losses, debris, loot and profit
    • Which mode was used: full precision (1:1) or scaled with the ratio applied

    For most fights you'll encounter in the game, the simulator runs at full 1:1 precision. Scaling only kicks in for truly enormous fleet battles.

    Multi-wave support

    You can chain multiple waves in sequence: after each battle, the simulator automatically carries surviving fleets into the next wave input, so you can plan a full multi-wave raid without manually copying numbers between rounds.




    The tool is based on the Trash Sim engine https://github.com/klaasvp/trashsim-public -mit license





    As soon as possible, I will make the repository publicly accessible, so that if any community members want to contribute to improving it, they will have a starting point.

  • RiV-

    Approved the thread.
  • - Request : Added "x" button to clear all ship entries in the box

    - Request: Added the ability to copy the detailed simulation result as an image for direct sharing

    - Fix : Fixed an issue that caused defender shields to fire more than intended, causing errors.
    - Feature: By first pasting the SR-spied API, the tool automatically recognizes the names of attackers and defenders.

    - Feature: The loot box in the detailed simulation result for insufficient cargo holds shows how many ships: Cargo or PF are missing to fill the hold.

    Some screen:


    Whats-App-Image-2026-06-12-at-20-52-28.jpg


    fastashare.png

    loot.png


    If you simulated, and received a battle report that was very different from the simulation, please send me a PM with your cr api.
    If you have any specific requests or suggestions, they are welcome.


    Thank's

  • New engine & speed

    • New: WebGPU is now the default battle engine — 100–500× faster than before, and it can handle gigantic fleets (hundreds of millions of ships) that used to be impractical. Automatically falls back to the WASM engine if your GPU isn't available.
    • New: Added a multi-threaded WASM engine (one battle per CPU core) for large exact battles, so big fleets are simulated at full 1:1 scale without distortion.
    • Performance: Highly mixed fleets (10+ ship classes per side, e.g. ACS / complex SRs) no longer take 40+ seconds — the engine now picks the right path and stays under ~10s even on the heaviest cases.
    • Performance: Reduced random noise on attacker losses by running more simulation seeds, so repeated runs of the same battle now give stable, consistent numbers.

    Bugfixes — combat accuracy

    • Bugfix: Death Stars (and other decisive low-count units) are no longer dropped when scaling large battles — a single invincible Death Star that should force a draw was being deleted, wrongly flipping the result to "attacker wins."
    • Bugfix: Battle outcome (win/lose/draw) is now read from the real per-simulation survivors instead of a fragile percentage threshold — fixes false "annihilation" results when the defender actually had survivors.
    • Bugfix: Attacker losses were heavily underestimated because the combat report lists the surviving fleet, not the one that entered battle — the simulator now reconstructs the initial fleet correctly (most visible in draws and heavy-loss fights).
    • Bugfix: Ship armor values are now read correctly whether the report uses the JSON (structural) or print_r (hull) scale — previously one of the two formats was misread.
    • Bugfix: Per-ship stats (weapon/shield/armor) are now always captured even when a report lists a ship type with count 0 — otherwise that side silently fell back to a weaker, less accurate calculation.

    Bugfixes — economy, debris & logistics

    • Bugfix: Defenses no longer generate deuterium in the debris field unless the server actually allows it (it's now tied to the server's debris settings instead of being hard-coded).
    • Bugfix: Server settings (debris %, deuterium-in-debris, etc.) are now applied instantly before the first simulation, so debris numbers are correct on the very first run.
    • Bugfix: Plunder % from the combat report (50/75/100) is now applied to the loot field — before, the sim always assumed 100%.
    • Bugfix: ACS multi-fleet fuel & cargo are now computed per player slot (each with their own tech/lifeform bonuses), instead of with a single shared calculation.
    • Bugfix: Drive upgrades are now respected — Small Cargo, Recycler and Bomber switch to their faster drive at the correct tech level, changing flight time accordingly.
    • Bugfix: When a spy report includes the attacker's launch coordinates, they're now auto-filled as the "from" planet.

    Bugfixes — import

    • Bugfix: Pasting a CR/SR ID no longer silently imports an empty result — malformed responses from the proxy (missing techs / lifeform bonuses) are now rejected instead of "winning the race" against the correct data.




    If you notice any significant discrepancies between the simulation and the actual CR, please provide me with the CR-API so I can verify.


    *** NOTE: The WebGPU engine may not be available on all versions of Firefox and Safari.

  • - feature request: Added a button to use TrashSim graphics. When clicked, the simulator will display the simulation result using the graphical format employed by TrashSim and other simulators.


    - Fixed some issues that arose after the implementation of the new WebGPU engine.


    Osim-New.png

  • OSims Update: Accuracy, Performance, and Results

    Over the latest updates, we have worked extensively on the OSims engine, fixing several issues that mainly affected ACS battles and very large fleets.

    Combat Engine

    • Fixed residual damage passing from shields to hull.
    • Improved damage distribution across fleets, slots, and participants.
    • Corrected the explosion mechanics for units below 70% hull.
    • Improved loss accuracy in ACS battles.
    • Verified the correct application of technologies, Lifeform bonuses, and unit-specific combat statistics.
    • Improved automatic scaling for battles involving hundreds of millions of units.
    • All simulations fall within a maximum timeframe of 1/15 of a second to produce the simulation result.

    Combat Report Import

    • Fixed an issue that could duplicate losses while reconstructing the initial fleet from certain CR formats.
    • Improved compatibility with different combat report formats.
    • Added automated regression tests to prevent the issue from returning.

    Debris and Recovery

    • Reviewed debris field calculations.
    • Verified automatic Reaper collection for both attackers and defenders.
    • Reaper collection is distributed proportionally between metal, crystal, and deuterium, respecting available cargo capacity and the 25% collection limit.
    • Improved Space Dock recovery calculations for both sides.
    • Attacker recovery is now correctly divided between individual players.

    Results and Interface

    • Fixed attacker loss totals in battles where the same player occupies multiple slots.
    • Added a default Compact mode that groups slots belonging to the same player.
    • Improved the Losses, Remaining Fleet, Space Dock, and Profit & Loss sections.
    • Removed unused space and improved result readability.
    • Improved simulation progress feedback while calculations are running.

    Validation

    The engine has been revalidated against 51 real combat reports, including small battles, ACS battles, and fleets exceeding 500 million units.

    Results:

    • 51 out of 51 battle outcomes correctly predicted
    • Average attacker loss accuracy: 92%
    • Average defender loss accuracy: 100%
    • Many large combat reports reach 98–100% accuracy
    • No regressions detected in economy, debris, participant, or technology calculations

    The update is already available on the live version of OSims. We will continue expanding the real combat report dataset to make the simulator even more accurate and reliable.