Announcement · Game · Engine note
War for the Hollow Earth
Orthographic 2D RTS. Up to 4,096 units per side. SDL2 for window, render, input, and audio I/O — the battle itself is custom simulation code.
Veilfall is out as a self-contained Linux x86_64 release under the Manticore banner.
Extract the folder, run ./play.sh, and you are in. No account, no launcher service, no
engine runtime to install beyond ordinary desktop graphics and audio libraries. Version
1.5.2 ships the executable, original source, atlases, and design docs together.
This note is the technical walkthrough of the core game simulation — the part that has to stay correct whether you are staring at twenty opening infantry or four thousand units already trading fire.
What “no engine” actually means
SDL2 opens the window, pumps events, blits sprites, and feeds the audio device. Everything that decides
whether a Disruptor should fire, whether a Forager still has crystals to haul, or whether a Wedge can
unfold past a ridge lives in src/sim.cpp, src/formations.cpp, and the headers
that define the world. There is no scene graph framework, no physics middleware, and no scripting VM
between the player’s order and the next tick.
| Layer | Responsibility |
|---|---|
| Simulation | Fixed 30 Hz clock. Economy, combat, pathing, fog, AI, victory. |
| Presentation | Orthographic camera, atlases, selection UI, minimap — reads state, does not own it. |
| Audio | Procedural stereo cues synthesized in native code; panned by on-screen position and sight. |
| Persistence / LAN | Binary state snapshots and commands on protocol 12. Host validates; guest issues orders. |
The split matters at scale. Rendering can miss a frame. The simulation cannot invent a different battle
because the GPU hiccuped. Saves and LAN peers agree on the same layout because they share one
serializable State.
The world as flat arrays
The authoritative world is not a tree of objects. It is a few large contiguous pools:
| Pool | Cap | Notes |
|---|---|---|
| Units | 8,192 total · 4,096 per side | ID, side, type, order, stance, HP/shield, goal, formation slot, target. |
| Buildings | 256 | Progress, production queue, rally, cooldown, optional deposit binding. |
| Navigation | 192 × 128 cells | 32-world-unit tiles. Cliffs and footprints mark blocked cells. |
| Spatial hash | 64 × 64 world buckets | Rebuilt each tick for near-enemy queries without scanning the whole roster. |
| Flow fields | 48 cached goals | Breadth-first costs from a destination; reused until the nav grid changes. |
Each unit carries its own order, weapon timer, and formation membership. Guardians sort toward the front of a formation; support sorts toward the rear. Aircraft use the same formation math and ignore ridges. Ground collision stays grid-based. That is an intentional abstraction: with thousands of movers, exact continuous physics would buy little readability and cost a lot of budget.
One tick
Sim::step() advances a fixed DT = 1/30 second. A condensed order of work:
- Periodic population recount; rebuild the spatial hash.
- Per-side income from baseline, extractors, relays, condensers, and owned wells; research progress.
- Buildings: construction progress, production queues, bastion healing, turret and flak fire.
- Units: regeneration rules, target acquisition, movement along flow fields, attacks, harvest trips.
- Separation so packed formations do not permanently fuse; fog of war on a slower cadence.
- AI think for the opposing side when enabled; victory checks on cores and well dominion.
Initiative alternates by tick so the lower half of the unit array does not always resolve first. Target search walks the spatial hash in center-out rings and caps how many candidates it inspects — armies prefer nearby threats over a full O(n) scan of eight thousand slots.
Pathfinding that survives a choke
Long-range movement uses shared flow fields. Ask for a goal cell; if a cached field for that goal is still
valid against the current navigation version, reuse it. Otherwise flood the walkable grid from the
destination and store costs. Units step toward the cheaper neighbor. Construction invalidates the cache
by bumping navVersion.
Formations need more than “everyone path to the same point.” A group first shares a route through narrow ground, then unfolds into reserved slots. Local obstacle search lets wings peel around a rock without allocating a fresh full-map field for every individual. Clear-segment tests use a supercover traversal so a one-tile cliff cannot be skipped by sampling only endpoints.
Economy and faction physics
Crystals and flux share the same clock as combat. Workers mine, haul, and deliver automatically; extractors drain finite deposits; wells pay continuous income to whoever holds them. Destroy the enemy core, or hold all three wells for 150 uninterrupted seconds.
Faction difference is not a palette swap. Greys absorb damage into rechargeable shields and favor range. Reptilians push with higher health, faster close combat, and passive regeneration after contact. Surge spends flux for an eighteen-second doctrinal spike — Grey shield recharge ignores the safe interval; Reptilian surge also accelerates movement. Same unit prices for equivalent roles; different decisions once the fronts meet.
Measured budgets
Release validation on the packaged Linux build (instrumented timing is slower and is not the play claim):
| Scenario | Observed |
|---|---|
| ~4,000 starting units | 3.107 ms per tick over 300 ticks |
| 8,192 starting units | 7.178 ms per tick over 120 ticks; state remained valid |
| Tick budget | 33.33 ms for simulation only at 30 Hz |
| Automated suite | Core, formation, balance, audio, and UI checks — including ASan/UBSan on the sim path |
Those numbers leave headroom for rendering, audio mixing, and UI even when the mass-battle preset fills the screen. They do not claim competitive e-sports balance or certification across every Linux GPU driver. A multi-seed AI probe is regression evidence, not a finished human metagame.
What ships with the game
Four symmetric maps. Skirmish AI on Calm, Standard, and Ruthless. Trusted two-player LAN on TCP 47671. Solo saves under XDG data. Eleven building roles and a full combat set per tech tier, including hunters, fighters, strikers, and bombers. Procedural battle audio with independent master, effects, and ambience volumes. MIT-licensed original game code; SDL2, zlib, and fonts keep their upstream licenses.
Boundaries are deliberate: no campaign, no map editor, no matchmaking service, no public-Internet hardening. Fog of war hides the ordinary display; LAN snapshots still carry the complete state. That is the honest scope of a small RTS you can own on disk.
Play it
The release targets a normal Ubuntu 22.04+ (or similar glibc) desktop. From the extracted
veilfall folder:
chmod +x play.sh
./play.sh
Rebuild from the included source with make and make test if you want the same
simulation checks the release ran. Watch the ad above for the mass-clash beat; open the field manual
in-game with F1 once you are inside.