Pre-Calculated Battles + Time Controls
What Changed
Battles used to run live - the game would simulate and draw at the same time, frame by frame. Now we simulate the entire fight upfront (behind a loading screen), record everything, then play it back like a video.
Why Bother?
Multiplayer: When matches eventually run on a server, we don't want clients simulating in real-time. Instead, the server will run the battle, send the results back, then each player's client can replay the same data.
Speed controls: You can now pause, speed up (0.5x to 3x), and scrub through battles. What's more, you can replay each battle to review your drone's performance.
Deterministic outcomes: The same match with the same random seed produces the same battle. This opens the door for replay sharing and saving past battles.
Balance: I can also watch back data from simulated battles while balancing the meta. When I'm adding new features, weapons, effects, utilities, etc., it will be easy to generate and replay many matches to ensure they're working as expected.
The Recording System
Every frame captures drone positions, health, shield states, active buffs/debuffs, and bullet trajectories. Static data like drone names and max health are stored once per recording rather than repeated on every frame, keeping the data lean for eventual network transfer.
Boolean states (alive, cloaked, shield-disrupted, EMP-disabled, etc.) are packed efficiently for serialisation. The format is versioned so we can evolve it without breaking old recordings.
Bullet trajectories are now predictive. Hit/miss is determined by the percentage chance of combat rolls. But now that we know the drone's paths, we can calculate where it will intercept the target and render the projectile on a straight-line trajectory.
UI Adjustments
The battle HUD now renders directly from snapshot data during playback - since we're already capturing all that state for the recording, we just pipe it straight to the UI. No need to query live entities. Fixed a timing bug where the hover detail panel lagged behind the main cards.
Added a loading screen with thematic messages while pre-calculation runs. Progress bar fills as frames are simulated.
What's Coming
The serialisation format is designed and ready, just needs the network layer wired up. When that happens, matches can run on the server and stream results to spectators in real time.
Files
Get Node Wars
Node Wars
Tactical drone auto-battler. Draft your squad. Watch them fight. Become a god of silicon.
| Status | Prototype |
| Author | orderandchaos |
| Genre | Action |
| Tags | 2D, Auto Battler, Casual, Indie, Space |
| Languages | English |
More posts
- Drone Sprites, Game Mechanics and UI Improvements1 day ago
- Groundwork6 days ago
Leave a comment
Log in with itch.io to leave a comment.