Marching into enemy territory changes visibility every step, and each change
rebuilt the whole on-screen fog band. A tile's fog depends only on its own
level and its six neighbours', so the exact dependency radius is one tile, far
tighter than the vision radius.
- Every tile owns a fixed slot in one fog buffer, so rebuilding a tile never
shifts another's vertices and only the touched row spans are re-uploaded.
_applyKnowledge now diffs the visible/explored sets and hands the renderer
the changed tiles; buildFogTiles rebuilds them with their rings. On a 100x100
map a frontier patch is ~3-4 ms against ~80 ms for the band.
- A pan that leaves the built rows now builds only the newly exposed rows, and
the escape margin scales with the viewport, so dragging rebuilds rarely.
- _frame schedules the next animation frame before doing any work and catches
an error, so a one-off failure can no longer stop the frame loop for good.
- Added tests for the per-tile patch and the incremental pan.
Marching into unexplored or enemy land reveals a tile every step, and each
reveal rebuilt the whole-map fog mesh: about 1.8M vertices and 50 MB on a
160x160 map, regenerated at the rebuild throttle. Walking through
already-explored home land reveals nothing, which is why the stutter only
showed up on a border crossing, with a single unit.
- buildKnowledge now takes a row range and builds only the rows on screen; the
row table stays full length so the existing row-banded draw keeps working.
- _flushFog rebuilds on a visibility change or a pan to a new row band, still
coalesced, and the draw clamps to the band that was built.
- A mode/zoom change schedules the band rebuild instead of building the whole
mesh, and uniform interior tiles skip the per-vertex blur kernel.
- The bombardment overlay was rebuilt every animation frame, and each barrage
scanned the whole army to find its target (O(strikes x units)). It now
redraws at most at the renderer's 24 fps, reuses its SVG/DOM nodes, and
resolves garrisons from one per-snapshot tile index, so a high-refresh
display no longer makes a big battle worse.
- Route truncation had the same shape: every step of every route rescanned
every unit. The snapshot now buckets the army by tile once.
- Idle units no longer have identical left/top rewritten every frame, and the
whole-map fog buffer is rebuilt less often.
- Snapshot traffic: cityStats and visible are delta-encoded like territory and
population, city stats carry a content-hash version, tile ethnicity is
memoised, and a city's economy is derived once per broadcast instead of
twice. A per-peer civ change now forces a full snapshot, since the visible
set is per-viewer.
- Tile improvements (fortifications, radar towers, coastal cannons), trenches,
zone of control, support-unit capture and launch transports, with parabolic
barrage arcs drawn between attacker and target.
- Focused research that pours points straight into the chosen technology, with
per-technology progress kept when the focus changes, plus repeatable levels.
- Popularity reworked to integer points, war and pillage effects, minority
policies and month-over-month arrows on the nation summary.
- City progress bars, square improvement buttons, a technology tab of wide
short cards with progress bars, transport cargo readout and double-click to
open a city panel.
- the nation summary shows own-government approval, white in the neutral 40-60% band, red below and green above
- the city and government panels keep a fixed size per tab, dock below the summary and no longer cover it, and their tab bar wraps instead of being clipped
- propaganda campaigns grow exponentially harder near their opinion ceiling or floor, so the last percent are the hardest to win
- memoised city, nation and matrix approval against the politics version, invalidated by territory redraws, so snapshots stop recomputing it every frame
- extracted the duplicated modal tab wiring into modals/tabs.js
- tests: campaign-difficulty, approval-colour and cache-invalidation cases (513 pass)
- a strike is accepted only when the whole round trip (out to the target, then
home to a friendly airport) fits the remaining fuel, and the browser mirrors
the check so an unreachable target is refused with its distance and the
plane's effective range
- a bomber that bombs between hourly ticks turns for home at once instead of
idling and crashing on an empty tank; a plane with a runway lands on fumes
- aircraft may now target a garrison inside a hostile city: they bomb it and
turn away, and captures skip aircraft so the city is never taken
- bomber/jet endurance and mission-range tuning
- aircraft attack orders fly a sortie to the target, bomb once, return to a
friendly airport and re-arm (two-day cooldown, charged per aircraft); rebasing
is bounded by fuel rather than the 10-tile combat radius
- artillery and warships open a sustained hourly bombardment on a standing
target, drawn as a red dashed line and ring while either endpoint is selected
- a game launched from localhost can enable a testing mode whose train and build
rows offer free, instant orders; the server only honours them for a loopback
admin in a testing game
- an open city panel now unlocks aircraft as soon as an airport finishes
- run_tests.js discovers and runs each *_test.js in its own worker process
(--jobs N to cap the pool, --file <name> for a single suite)
- GameState caches the deterministic terrain, city sites and road network by
(seed, mapConfig, civ count), rebuilding only the mutable per-game state
- the snapshot ships mapConfig and the client rebuilds terrain from it, so the
DOM tests can use the small map fixture and a non-default config renders right
- shortestPaths can stop once every target city is settled
Roads are pre-generated between cities with a greedy geometric spanner and flatten unit movement cost. City improvements now only affect the tiles their region controls, with per-region tax collection and a Cities tab. The budget is a grouped, scrollable table with 25%/year tax and a 10%-of-GDP opening treasury. Also merged the tile info into the city panel, kept conflict and budget expansion state across snapshots, added join notifications, filled border corners, drew battle sides as stacks and made tab overflow scroll.
Server-authoritative Godot 4.6 strategy game.
Includes the headless WebSocket game server, the browser client, and
Nix packaging (server and web-export derivations plus a NixOS module)
for deployment.