Spaces:
Paused
Paused
Commit History
-
Odyssey Phase 5: the starmap — the galaxy's capstone view
Claude +1: Claude Opus 4.8Unverified signatureA full-screen galaxy map ties the Odyssey together. Every world sits on a ring, coloured by your relationship to it: your active capital, a colony you hold (with its neighbour's stance), or somewhere still unexplored (shown with its AI doctrine). If your capital has a Spaceport and the credits for fuel, clicking a world jumps there straight from the map; otherwise the header prompts you to build one. A visited-worlds count echoes the original game's "see every world" thread. - starmap.js (new): the overlay, self-wired to a topbar "Galaxy" button and the M key (Esc / backdrop closes). Pure view over a new galaxy.js galaxyStatus() snapshot (per-world status + stance + the visited/total counts). - hud.js: the Galaxy button shows only in Odyssey; the skirmish Save/Load buttons hide there (galaxy persistence isn't supported, so a skirmish save would mislead). - index.html/dom.js/style.css: the button, the overlay, and its styles — including the per-component `.hidden` rules thi…842eae1 -
Odyssey Phase 4: living galaxy — scarcity diplomacy + colony alerts
Claude +1: Claude Opus 4.8Unverified signatureThe neighbours are no longer just obstacles: a world can be shared in harmony and then turn on you as its ground runs out, and the colonies you leave behind report in when they come under fire. Engine: - diplomacy.js (new): each Odyssey world's AI holds a stance (-1 hostile .. +1 allied) that drifts toward a target set by how depleted the world's deposits are — cordial while rich, hostile once mined out. - ai.js: the offense commit is gated on the stance — at peace the neighbour keeps building economy and army and still DEFENDS itself, it just launches no attacks on you until scarcity turns it hostile. A skirmish has no diplomacy, so the gate is a no-op there (the resolves-to-a-winner guarantee is untouched). - galaxy.js: every world gets a diplomacy stance; sweepColonies() watches the background colonies — reporting one coming under attack or being lost — and is the single place their sim events are drained (a colony isn't rendered, so nothing else consumes them). -…11037b3 -
Odyssey Phase 3: market + universal credits
Claude +1: Claude Opus 4.8Unverified signatureTrading turns a local surplus into portable, galaxy-wide credits — and credits now fuel the jump, so exploration draws on your economy. Engine: - market.js (new): each world gets a price book. A commodity's equilibrium price is its global base value scaled by LOCAL abundance (a world rich in ore sells it cheap; one short on it pays more), so moving goods between worlds pays. Trades react — selling pushes a price down, buying pushes it up, with a market spread between the two — and the pressure relaxes back toward equilibrium over time. Pure and deterministic; credits live on the galaxy so they carry across jumps. - galaxy.js: every planet is handed a market on creation; a jump now costs JUMP_COST credits (fuel) and is refused when you can't pay; the starting credit stipend funds the first jump. - sim.js: an Odyssey world relaxes its market pressure each tick. UI: - hud.js: the Command Center gains a trade panel — a row per tradeable commodity with its live sell pric…f12f730 -
Odyssey Phase 2: the galaxy + the interplanetary jump
Claude +1: Claude Opus 4.8Unverified signatureThe signature open-world loop. You now build a Spaceport, relocate your single Command Center (and the units staged by the pad) to another world, and the planet you leave keeps evolving as a background colony while you develop the new one. Engine: - galaxy.js: the meta-layer grows a real galaxy. addPlanet() gains an `unsettled` option that strips the auto-seeded player base — a jump destination has only its neighbour until your capital arrives. jumpCapital() moves the Command Center + player units within JUMP_LOAD_RADIUS of the Spaceport to the destination's landing zone (assigning fresh galaxy-scoped ids so nothing collides across states), flips the origin to a background colony, and makes the destination the active seat. canJump() gates it on a finished Spaceport. - sim.js: a background colony (no capital, by design) is never "over" — only your active seat runs the capital-loss check. - entities.js: the Spaceport building (Odyssey's launch pad, gated behind the Fou…5df8767 -
Add Odyssey open-world mode (Phase 1): endless single-planet foundation
Claude +1: Claude Opus 4.8Unverified signatureThe first slice of the "Space Exploration" meta-game — the open-world campaign the project is named for. Phase 1 stands up the galaxy scaffold and a playable, endless single-planet sandbox with one relocatable Command Center; the multi-planet jump, market, and diplomacy build on this in later phases. Engine: - state.js: new `endless` flag on a game state. - victory.js: checkEndlessLoss() — an Odyssey never ends by conquest or clock; it only ends in defeat when the player loses their single Command Center (their capital). Razing a neighbour's CC just leaves that world running. - sim.js: tick() routes the terminal check three ways now — scenarios settle themselves, endless uses checkEndlessLoss, a normal match uses checkWinCondition. - engine/galaxy.js (new): the meta-layer. createGalaxy() picks a random start world from the galaxy seed and builds its planet state (a normal createGameState flagged endless); holds universal `credits`, the active planet id, the world roste…cae0952 -
Offer all map sizes (Small–Gigantic) in the three scenarios
Claude +1: Claude Opus 4.8Unverified signatureThe Map size dial was skirmish-only; the scenarios always ran on the base (Small) map. Enable Small/Standard/Large/Gigantic for Convoy Escort, Pirate Raider, and Bounty Marshal too. - setup.js moves the Map size row out of the skirmish-only block so it renders in every mode; Faction and Resources stay skirmish-only (a scenario has no economy). SCENARIO_START already maps each mode to its boot function. - boot.js threads setup.sizeMult into startScenario/startRaider/ startBounty. - engine/scenarios.js: setupEscort/setupRaider/setupBounty take a sizeMult, pass it to createGameState (the map generates at that scale), and scale the mission clock by it. This is the crux: the route and the camp scatter already use width/height fractions, so they grow with the map on their own, but the fixed time limits would make a big map unwinnable — a 4x map is a 4x-longer convoy route. Since a convoy scenario ends when the convoy arrives (the clock is only the failure deadline) and…8c580c4 -
Add Bounty Marshal scenario: hunt scattered pirate camps on the clock
Claude +1: Claude Opus 4.8Unverified signatureThe third scenario, a seek-and-destroy hunt rather than a convoy run. Pirate camps are scattered across the sector, each marked with its bounty; the player leads a marshal's posse and must clear a quota of camps before the clock runs out. Scenario framework (engine/scenarios.js): - updateScenario() dispatches to updateBounty() on scenario.type. There is no route or convoy: the camps sit and defend (AI combat units auto-acquire anything that strays into range), so the player picks their targets and their order. With no input the clock simply expires with nothing cleared, which also guarantees the mission terminates. - setupBounty() musters the posse at the map centre and scatters the camps around it via a seeded, well-separated placement (scatterPoint), each camp's pirates tagged with a packId. BOUNTY_DIFFICULTY scales the posse, camp count/composition, clear quota, and clock. - updateBounty() recomputes each camp's live centroid every tick (so its marker tracks the pac…3a48732 -
Add Pirate Raider scenario: raid the AI convoy before it escapes
Claude +1: Claude Opus 4.8Unverified signatureThe mirror of Convoy Escort, built on the same scenario framework. The roles flip: an AI convoy (four freighters + an escort) runs a multi-leg route toward the destination gate under its own control, and the player commands a raider fleet that lies in wait off the lane. Sink a difficulty-scaled kill quota before the convoy escapes or the mission clock runs out. Scenario framework generalization (engine/scenarios.js): - updateScenario() is now a dispatcher on scenario.type; the existing escort logic moves into updateEscort(), the new updateRaider() drives the AI convoy and settles the raider objective. - liveFreighters() reads scenario.freighterOwner ("player" in Escort, "ai" in Raider) so the shared route/arrival/delivery logic serves both. - endScenario() branches its score by type (computeEscortScore vs the new computeRaiderScore, which rewards freighters sunk, escorts destroyed, raiders left alive, and a win bonus). Raider specifics: - setupRaider() lays out the AI convo…11d7a22 -
Add Convoy Escort scenario: shepherd freighters across a raided route
Claude +1: Claude Opus 4.8Unverified signatureIntroduces a scenario layer over the existing skirmish engine. The Convoy Escort scenario tasks the player with shepherding four freighters along a multi-leg route through pirate territory to a destination gate, against a global mission clock. Scenario framework (engine/scenarios.js, new): - setupEscort() reuses createGameState for map/fog/players, then clears units+buildings and lays out an evenly-spaced left-to-right route of stations (one leg per configured risk value), the four freighters, and a difficulty-scaled escort fleet. - updateScenario() drives a prep -> travel -> docked phase machine: freighters advance leg by leg, pirate waves spawn per-leg by risk and steer at the lead freighter, and the player docks between legs to repair from a budget. Win on delivering >=1 freighter before the clock; loss on losing them all or the clock expiring undelivered. - Determinism preserved: scenario randomness flows through a seeded mulberry32 on state.scenario.rng, decoupled…dcbdeac -
Tech tree: spend the dead commodities — gas / ice / relics specialty units
Claude +1: Claude Opus 4.8Unverified signatureSeveral worlds deposit commodities nothing ever cost — gas (Vesper, Glacius, Nimbus), ice (Glacius), relics (Korrath, Oort) — so on a gas giant like Nimbus or the ice world Glacius the whole surface economy was dead flavor, mined by nobody. The gather/bank/spend plumbing is already commodity-generic, so the fix is pure content: give each a Tier-3 sink at the Arsenal, joining the existing radioactives→Dreadnought so a world's rare deposit shapes your elite. New units (Arsenal-gated, all deliberately OUTSIDE the Skiff/Bastion/Lancer triangle — situational power, not hard counters): • Wraith (gas) — fastest combatant, highest DPS, paper-thin: a raider. • Aegis (ice) — the tankiest hull with a token gun: a wall to hide behind. • Colossus (relics) — out-ranges everything incl. the turret, cracks buildings, but slow and fragile for its cost: screened siege. AI: the balanced archetype (which plays the gas/ice worlds Vesper + Glacius) folds Wraith/Aegis…51070b8 -
Faction asymmetry — pick a side with its own passive identity
Claude +1: Claude Opus 4.8Unverified signatureThree playable factions, each a small bundle of passive trait multipliers — so a faction changes how a side plays without touching the shared roster, the rock-paper-scissors triangle, the tech tree, or the AI's build logic: • Frontier — mobility & vision (speed +8%, sight +6%): strikes first, holds the map. • Miners — industry (haul +15%, build/train −10%): out-scales in the long game. • Syndicate — firepower on a lean economy (damage +10%, haul −8%): win the fight, fast. Distinct axes with a real opportunity cost (Syndicate pays economy for its punch), so the pick is a strategic fork, not power creep. How it plugs in (engine/factions.js): A faction's traits are keyed on the exact side-modifier names the engine already reads, so they fold straight into map.js's sideMod — one seam, and every existing consumer (movement speed, fog/aggro sight, gather yield, build/train time) picks up the faction edge for free, stacking multiplicatively with a world's own per-side mod…ec7c7c8 -
Tier 4: the Mender — a support drone that repairs the army and base
Claude +1: Claude Opus 4.8Unverified signatureA new "support" role, the roster's first non-combatant that isn't a worker or a scout. The Mender is a fragile, unarmed drone (70 hp, no attack of any kind) trained at the Barracks and gated behind the Foundry. Each tick it heals every damaged friendly unit AND building within repairRange at repairRate hp/sec — capped at each target's maxHp, never itself, never a construction site. Why it matters: until now every hp lost to a fight was permanent, so attrition always favoured whoever could out-produce. The Mender makes *keeping* an army alive a real strategy — a bruised force can heal between waves, and a besieged base can patch its buildings — without any new resource or macro burden, since the healing is a passive area effect. Engine (deterministic, replay-safe): - entities.js: the Mender unit def + "mender" in barracks.produces. - repair.js (new): updateRepair — one global pass after all combat has resolved for the tick. Each Mender adds a fixed repairRate*dt and clamps to maxH…6f0f031 -
Tier 3: AI raiding — feint-resistant defence + economy harassment
Claude +1: Claude Fable 5Unverified signatureTwo Tactical-gated (aiMicro) behaviours that make the opponent play like a human who pressures your economy and can't be jerked around by a poke. Both are Standard-AI-off and only ever engage a player who actually acts, so a passive opponent is untouched and the nine-world resolve guarantee holds with Tactical forced on (verified). - Feint-resistant defence: a small threat no longer yanks the whole army home. When the seen threat is under half the army, only a proportionate force (the closest units, ~2x the threat) peels off to deal with it while the rest hold their assignment; a genuinely large attack still triggers the full recall. Standard AI keeps the whole-army recall. - Economy raid: every 3rd committed wave, if it can see the player's worker line, goes for the economy instead of grinding the defended main base — sniping production the way a human harasses. The other waves still assault the base (and a desperation/timeout commit always does), so the CC still falls.…cd173c8 -
Tier 3: save / load — resume a game exactly where you left off
Claude +1: Claude Fable 5Unverified signatureThe payoff of Tier 1's seeding. Because the sim is deterministic and seed-driven, a save doesn't need the whole world — the map (terrain, node positions) regenerates from the seed, so we persist only the seed + the DYNAMIC state: entities, economies, fog memory, and the AI's bookkeeping. - engine/persist.js: serializeGame(state) -> a detached, JSON-safe snapshot; deserializeGame(save) rebuilds a state that ticks on from exactly where it was saved. visible fog is recomputed on load (only permanent `explored` memory is stored); the entity-id counter is snapshotted/restored (new state.js peekEntityId/restoreEntityId) so a loaded game keeps minting non-colliding ids. - state.js records planetId/sizeMult/resourceMult so the map can regenerate. - main.js: Save/Load buttons in the topbar and a "Resume saved game" button on the splash; startGame's boot path is factored into a shared bootState() that both fresh and loaded games funnel through. localStorage-backed. Additive — it ne…dfed415 -
Tier 2: a third upgrade doctrine — Logistics (economy + tempo)
Claude +1: Claude Fable 5Unverified signatureUpgrades were only ever ±damage; add a macro path so "out-produce them" is a real strategic fork against "out-fight them". Logistics is a third mutually-exclusive doctrine (via the same committedDoctrine lock) with two tiers: Logistics Network (T1) — +25% resource yield from every haul Rapid Fabrication (T2) — -20% unit & building production time Committing to it locks Assault AND Bulwark, and vice-versa — so it's a genuine opportunity cost, not a free third buy. Plumbed data-driven: a new shared entities.upgradeMult(upgrades, field) is the one place combat/gather/production read upgrade effects, so a new upgrade is pure data. combat.js's two inline damage-mult loops are refactored onto it (behaviour identical); gather.js reads gatherYieldMult, production.js reads produceTimeMult (construction and unit production), both optional-chained so map-less test stubs still pass. The Refinery UI is already data-driven — it picks up the new doctrine from the UPGRADES table plus a label …3195ab6 -
Tier 2 UX: Hold-position stance + a topbar idle-worker indicator
Claude +1: Claude Fable 5Unverified signatureTwo safe quality-of-life additions while balance items await playtesting. Hold position (H / a panel button): a combat unit stands its ground and fires on anything that enters weapon range but never CHASES an auto-acquired target out of position — the standard defensive stance for holding a line or a choke. combat.js honours a new unit.hold; any move/attack order or Stop clears it. Player-only — the AI never sets it — so determinism and the resolve guarantee are untouched. Idle-worker indicator: a lost worker on a big map is easy to miss, so the topbar now shows a "N idle" badge (hidden at zero) that jumps to the next idle worker on click, mirroring the ` key. Both surfaced in the help overlay and the controls legend. Tests (+2, 279 total): a holding unit fires an in-range enemy but won't chase an out-of-range one; issueHold sets the stance on combat units only and a move/Stop clears it. Browser-verified: the badge shows "3 idle" at start and the help lists Hold; clean boot. Co-Au…fea25dd -
Tier 2: the Tactical AI builds a Ranger and scouts with it
Claude +1: Claude Fable 5Unverified signatureA smarter opponent scouts smarter. When Tactical, the AI trains one cheap Ranger (45 ore, far sight, all-terrain) up front and hands it the scouting job, instead of lending a combat unit off the line — better intel that costs the army nothing, and it feeds the existing hidden-CC search. updateScout now prefers a Ranger and only falls back to lending a fighter when there's none. Gated on aiMicro, so the Standard AI's economy and opening are byte-identical. Tests (+2, 277 total): the Tactical AI builds a Ranger and makes it the scout; the Standard AI never trains one. The nine-world resolve guarantee still holds with Tactical (Ranger + micro) forced ON; determinism intact. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AEQUVetLk31Jj7niDQAsXL08f6a8e -
Tier 2: salvage — a comeback softener for the deathball snowball
Claude +1: Claude Fable 5Unverified signatureWhen a COMBAT unit is destroyed, its owner reclaims 25% of its cost as salvage. Because the side taking the heavier losses gets the larger refund, an army being ground down rebuilds faster — relaxing the snowball the review flagged, where one lost engagement cascades into a loss with no way back. Combat units only (not workers or buildings), so it rewards standing and trading rather than feeding the economy. In an outnumbered 6-vs-10 fight the wiped side recoups 150 ore while the flawless winner gets 0 — the cushion goes to whoever is losing, exactly the intended anti-snowball direction (winner-take-all would have amplified it). Symmetric and deterministic. A passive opponent loses no units, so salvage never fires in the resolve/determinism tests — the resolves-to-a-winner guarantee is untouched (275 tests pass). Tests (+2): a destroyed combat unit refunds a quarter of its cost to its owner; a dead worker yields nothing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude…8e3a38d -
Tier 2: Tactical AI kiting — ranged units stutter-step back from melee
Claude +1: Claude Fable 5Unverified signatureCompletes the AI unit-level micro item. When Tactical, a ranged AI unit (Lancer, Breacher, Dreadnought — range >= 50) that's reloading while an enemy UNIT has closed inside 0.75x its weapon range steps directly away to preserve its range advantage, then stops to fire the instant its weapon is ready — classic stutter-step kiting. Melee brawlers (Skiff, Bastion) stand and trade. Lives in combat.js's in-range/reloading branch (per-tick, gated on state.aiMicro + ai owner + long range). Reacts to enemy UNITS only, never buildings, so a ranged unit shelling an undefended base never backs off — the resolves-to-a- winner guarantee holds (now verified with Tactical forced ON across all nine worlds, kiting included). The retreat point is clamped to the map so a cornered kiter can't walk off the edge. In an 8v8 Lancer-vs-Bastion duel kiting turns a 7-0 win (one lancer lost) into a flawless 8-0. Off by default and for the Standard AI, so nothing changes unless Tactical is chosen. Tests (+2, 273…b2bad03 -
Tier 2: Tactical AI focus-fire + an AI-tactics setup toggle
Claude +1: Claude Fable 5Unverified signatureThe single biggest AI upgrade: an opt-in "Tactical" mode where the opponent micros its army like a skilled player instead of leaving every shot to the dispersed auto-acquire. Focus-fire (engine/ai.js applyFocusFire + combat.js): when Tactical and it can SEE enemy combat, the AI points its whole nearby army at one target — the lowest-HP visible enemy, tie-broken toward the more dangerous one — so kills land faster and incoming damage drops sooner (Lanchester's square law). combat.js reads a new unit.focusId and prefers it while it's a live enemy in aggro, else falls straight through to the normal dispersed acquire, so a stale or too-far focus never freezes a unit and orders/wave-tracking are untouched. In a 10v10 skiff mirror this flips a 0-4 loss under dispersed fire into a decisive 5-0 win. Crucially it's a NO-OP unless real enemy combat is in sight, so razing an undefended base — every resolve test — is unchanged. Difficulty is now more than an APM dial: a new "AI tactics" setup o…e42e5cb -
Tier 1: seed the sim, attack-move/hotkeys, onboarding, rally-to-mine, tiebreak
Claude +1: Claude Fable 5Unverified signatureSix high-leverage quick wins from the improvement review. Seed the sim (engine/rng.js, state.js, main.js): production now draws a seed at match start and flows it through a shared mulberry32, so a match is reproducible — the seed shows on a topbar chip (click to copy) and the game-over screen, and can be re-entered on the setup screen to replay the exact same world. This is the keystone that later unlocks replays/save-load. Engine determinism is now guarded by a test that scans engine/ for Math.random/Date/performance.now (the two sanctioned defaults + the render clock are marked deterministic-exempt). Standard army verbs (input.js): A-then-click issues attack-move (the missing genre default — plain right-click still moves and ignores enemies); the waypoint queue moves from Ctrl to Shift so Ctrl is add-to-selection only; Esc cancels a pending attack-move or build placement. A crosshair cursor shows when armed. A is no longer a pan key (pan left with arrows/edge-scroll). Onboarding (…4f1cb54 -
Ranger scout unit + AI hunts down hidden Command Centers
Claude +1: Claude Fable 5Unverified signatureTwo related recon features. New unit — the Ranger (engine/entities.js, scout.js, render.js): - Trained at the Command Center like a Worker; cheap (45 ore) and fragile (50 hp) with only a token bite for self-defence. Its own role "scout", so it never auto-acquires and is never swept into the combat army. - Its three edges are a scout's: far sight (340, more than any combat unit), all-terrain movement (the existing `allTerrain` flag — ice fields and rough ground never slow it), and an autonomous SCOUT MODE (order "scout", the E key / a panel button). In scout mode it heads for the nearest unexplored ground on its own, its sight reveals it, it re-picks — a frontier that expands from home until the map is charted, then it patrols to keep vision fresh. Persistent and deterministic (a row-major fog scan, no rng), so it's safe in the sim. - Draws as a light recon craft with a sensor ring, distinct from the Skiff. A generic-unit fallback in the renderer keeps the "every enti…c310233 -
AI: plant forward Refinery drop-offs to shorten a long ore haul
Claude +1: Claude Fable 5Unverified signatureTeach the AI to exploit the drop-off mechanic: the Refinery both researches its doctrine AND doubles as a resource drop-off, so once a macro AI is hauling ore a long way from every drop-off it plants additional Refineries out at those far seams — cheap, decentralized collection points that shorten the haul without the cost of a whole second Command Center. It keeps building a full CC for a genuine new base (on-site worker production + supply), but reaches further clusters with drop-offs instead of stacking CCs. Behavior: - forwardDropoffAnchor keys off ore the AI's workers are ACTUALLY mining, so a "far" seam is far from its own base (workers pick the nearest ore), never across the map at the enemy — and it only fires when the round trip is genuinely long. - Forward drop-offs spend genuine surplus only (the expansion reserve and a mix buffer stay untouched) and are capped (MAX_AI_REFINERIES), so they never run away with the AI's ore. - No seam on a small map is ever far enou…626d115 -
Industrial buildings double as resource drop-off points
Claude +1: Claude Fable 5Unverified signatureDecentralize the economy so reaching a distant deposit no longer forces a whole second Command Center. The Refinery, Foundry and Arsenal — the industrial line — now double as resource drop-offs that proxy the CC: workers bank their haul at the NEAREST completed drop-off, so planting one of these cheaper, faster buildings forward shortens the mining run. A forward Refinery (200 ore / 16s) collects for a claim instead of a full Command Center (400 ore / 30s), while the CC keeps its unique roles — training workers and granting supply — so it's shortened hauls, not an obsolete CC. - entities.js: `dropOff` flag on refinery/foundry/arsenal + an `isDropOff` helper (CC via isCommandCenter, or the flag) as the single source of truth. - gather.js: the deposit phase routes to the nearest drop-off, not only a Command Center. Still requires a COMPLETED building. - main.js: build-button tooltips note "resource drop-off" so the role is discoverable (and Habitat/CC now show their supply grant …eb17bae -
Home ore on every doorstep + draw the Foundry and Arsenal
Claude +1: Claude Fable 5Unverified signatureTwo fixes so a match reads and plays right regardless of map size. Home ore (engine/map.js): the deposit clusters sit at fractions of the map, so on a Gigantic (4x) map they drift far from the base and the opening economy crawls. Add a guaranteed 3-node ore cluster at a FIXED absolute distance (~160px) on every Command Center's doorstep — ~1050 ore per side, enough to fund a 400-ore second Command Center and push out toward the contested deposits and the enemy. Placed with no rng and flagged `home`, so the deposit/cache layout and map determinism stay byte-for-byte identical and the seam logic is untouched. Every building draws (render.js): the Foundry and Arsenal had no draw function and rendered as invisible click targets. Add a distinct silhouette for each — the Foundry an industrial forge-hall (sawtooth roof, molten vent, smokestack), the Arsenal a fortified missile bunker with a lit core — plus a generic hexagon fallback so any building added later can never ship invisible. Tes…49b784a -
Asymmetric world modifiers: two starts that differ
Claude +1: Claude Fable 5Unverified signatureWorld modifiers could only tilt both sides equally. A world may now carry an `asym: { player, ai }` block that overrides a modifier for just ONE side, so the two corners play as a real asymmetric matchup. - map.js: sideMod(state, owner, key) resolves the owner's asym override, then the shared modifier, then the default — so symmetric worlds and map-less test stubs behave exactly as before. Movement (speed), fog (sight), combat (aggro sight), production (build time), and gather (a new per-side gatherMult economy edge) all read it with owner context. - Two asymmetric worlds, telegraphed on the map card: - Oort "Contested frontier": player banks 20% more per haul (rich claim); the AI builds 18% faster (war factory). Out-mine vs out-build. - Nimbus "Storm front": player sees almost normally (0.95) where the AI stays half-blind (0.75), but the AI's units are 12% faster. Out-scout vs out-tempo. Safe for the resolves-to-a-winner guarantee by construction: an AI-side edge…d228ca7 -
Tech tier 3: the Arsenal unlocks the Dreadnought capital ship
Claude +1: Claude Fable 5Unverified signatureExtends the tech tree one step past the Foundry: Barracks -> Foundry (Tier-2 units) -> Arsenal (Tier-3), reusing the requires/prereqsMet machinery. - entities.js: new Arsenal building (requires Foundry, ore-only, a pure gate) and the Dreadnought — a Tier-3 capital ship (requires Arsenal, trained at the Barracks). Tanky, long-reaching, heavy-hitting, 4 supply, and deliberately OUTSIDE the rock-paper-scissors triangle (no bonusVs, nothing bonuses it). Measured: at supply parity it out-values Bastion/Lancer/Breacher (a real late-game power spike), but a cheap Skiff swarm hard-counters it (0-10) — so it anchors an army without being spammable, and light units stay relevant. - ai.js: builds the Arsenal OPPORTUNISTICALLY from surplus (no reserve, so the Economist's core timing is unchanged — verified back to its prior ~360s); the Dreadnought is in the Economist's deep mix and effectiveMix keeps it out of the cycle until the Arsenal is up. The Tier-3 path is primarily a str…1ae322f -
AI army-retreat: pull a losing attack back so engagements trade
Claude +1: Claude Fable 5Unverified signatureA committed, non-desperation attack that's been ground down to under 40% of what was sent — and can still SEE enemy combat units at the fight — now pulls its survivors home (a plain move, so they disengage rather than stop to trade) instead of feeding the last of them into a lost engagement. The saved veterans re-form into the next wave, so a repelled attack becomes a rebuild-and-retry rather than a total loss: engagements genuinely trade now, with both sides keeping a remnant. Two guards keep the resolves-to-a-winner guarantee intact, by construction: - A desperation (timeout) commit never retreats — it fights to the death, so the game always resolves. - A retreat only fires while the AI can see live opposition near the fight. Against an undefended/passive base (every headless resolve test) that count is zero, so the AI never retreats and razes the base exactly as before — verified that all nine worlds resolve at byte-identical timings to pre-retreat. engine/state.js carries…672f44c -
Content: extend terrain to Nimbus, Helix, and Oort
Claude +1: Claude Fable 5Unverified signatureSix of the nine worlds now carry terrain (was three); the original three (Ferros/Korrath/Vesper) stay clean open plains — a valid map archetype, and it keeps Ferros a terrain-free baseline for the exact-value combat tests. - Nimbus (storm bands, short sight): two high-ground vantages that rise above the murk — doubly worth taking, since high ground extends sight on a world where everyone else is half-blind. - Helix (dense crystal belt): a high-ground crystal ridge down the centreline, the contested spine of the belt. - Oort (rich frontier): rugged rough ground on the flanks funnels the fight through the open centre. All mirrored for fairness, mid-map (clear of the near-base build bands), and never impassable. New test locks the coverage (which six carry terrain, which three stay open); all nine worlds resolve, determinism holds. README updated. 227 pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AEQUVetLk31Jj7niDQ…01bf120 -
Combat: spread-targeting + target stickiness (anti-dogpile)
Claude +1: Claude Fable 5Unverified signatureInstead of the whole line re-locking the single nearest enemy every tick, attackers now commit to a target (sticky auto-target) and fan out across the nearest few enemies in the local engagement band. This distributes fire the way a player micros manually — less overkill, units engaging distinct foes — and modestly softens the focus-fire snowball (the winning side bleeds a little more). - combat.js: spreadEnemy() distributes attackers across the SPREAD_TARGETS (3) nearest enemies within range+60, dispersed by a per-unit id hash; falls back to plain nearest while still closing in. updateCombat keeps last tick's autoTarget while it's a live enemy in aggro range, only re-acquiring when it dies or slips away — the stickiness that makes the spread hold. Deterministic (id-hashed, stable sort). - state.js: makeUnit carries an autoTarget field. Honest scope note (measured with a duel harness): this does NOT prevent the loser being wiped in a to-the-death fight — that's intrinsic to…1882245 -
AI reliably teches its doctrine (Refinery ore-reserve + adaptive choice)
Claude +1: Claude Fable 5Unverified signatureThe macro archetypes now actually research their upgrade doctrine in a real match instead of leaving the Refinery unbuilt (units always ate the ore first). - ai.js: a Refinery ore-reserve, the same banking trick as the Foundry but sequenced AFTER it (and skipped while banking for an expansion), so units only ever pause for one investment at a time and the AI reaches a Refinery. Gated by a new archetype `wantsRefinery` flag — Economist and Balanced bank for it; Rushers skip it (their game resolves before an upgrade pays off). - aiDoctrine(): the AI prefers its archetype's doctrine flavour but follows the world's economy when it's clearly richer in the other doctrine's commodity (Assault = radioactives, Bulwark = crystals), so it never builds a Refinery it can't research — e.g. radioactive-poor Vesper now commits to Bulwark and gets both tiers instead of an idle Refinery. Result: five of six macro worlds now tech a full/partial doctrine (Ferros/ Glacius Assault, Vesper/…22b2d4c -
Rework upgrades into two mutually-exclusive doctrines
Claude +1: Claude Fable 5Unverified signatureFixes the "buy both, no decision" upgrade design the review flagged: which upgrade you research is now a real strategic fork with an opportunity cost. - entities.js: the two flat upgrades become two doctrines of two tiers each — Assault (Overcharged Weapons -> Overcharged Core, +damage dealt) and Bulwark (Reinforced Plating -> Reinforced Bulwark, -damage taken). Each carries a doctrine + tier + a Tier-2 `requires` its Tier-1. New committedDoctrine() reports the path a player has locked into. T1 mults eased (1.2->1.15, 0.85->0.88) since a fully-teched doctrine now stacks two tiers. - production.js: researchUpgrade enforces the doctrine lock (committing to one locks the other out) and the tier gate (T2 needs T1, via the tech tree's prereqsMet). Assault costs radioactives, Bulwark crystals, so a world's deposit specialty tilts which comes easier. - combat.js: upgrade multipliers are now applied by iterating researched upgrades (data-driven), so the tiers stack multiplic…d69dcb5 -
Content: terrain — rough ground, high ground, and no-build zones
Claude +1: Claude Fable 5Unverified signatureGives the map spatial identity without any pathfinding rewrite: a static per-cell terrain field (a flat Uint8Array, fog-grid idiom) drives three purely local effects. - map.js: TERRAIN table + generateTerrain (fixed fractional feature specs, mirrored for fairness, scaling self-similarly) + sampleTerrain (O(1), OPEN out of bounds). Consumes ZERO rng draws, so the node layout stays byte-identical and determinism is untouched. Terrain is static for the whole match. Per-world specs on Glacius (rough ice fields flanking a central lane — a soft choke), Forge (rough industrial sprawl), and Pyralis (a high-ground mesa); the original three worlds stay all-open. - movement.js: rough ground slows the step (never to zero — no unit can ever be trapped, so a wave can't deadlock and the resolves-to-a-winner guarantee holds). Honours an optional per-unit allTerrain flag (forward-compat). - fog.js: high ground sees farther (per-source sight scaled by terrain). - combat.js: an attacker …03f71c7 -
Content: tech tree — a Foundry gate for the Tier-2 units
Claude +1: Claude Fable 5Unverified signatureTurns "all four combat units from turn one" into a real build-order fork. - entities.js: new Foundry building (ore-only, requires a Barracks) and a requires field gating Lancer and Breacher behind it. prereqsMet() is the shared source of truth (a building token needs a COMPLETED building; an upgrade token needs it researched). RPS triangle and stats untouched — only WHEN each unit is reachable changes. - production.js / commands.js: queueProduction and issueBuild reject a locked unit/building (prereq checked before affordability, so "locked" outranks "too expensive"). - ai.js: effectiveMix drops tech-locked units so the cycle runs Skiff/Bastion until the Foundry is up and can never stall on a locked entry. The AI builds the Foundry as priority infrastructure and reserves its ore from the unit stream while banking — otherwise it spends every spare 100 on a Skiff and never techs. Rushers drop Lancer from their mix (pure Tier-1, no tech delay); economist/balanced re…e3fdeef -
Content: economy saturation (diminishing returns on over-mined nodes)
Claude +1: Claude Fable 5Unverified signaturePiling workers on one deposit now has diminishing returns, so spreading out and expanding to a fresh field is a real economic decision instead of a free lunch. - entities.js: worker gains minerSoftCap (3) and minerFalloff (0.4). The first three miners on a node run at full rate; each extra pulls only 40% of a share, so the node's per-worker efficiency is the average — floored above zero, so a lone remaining seam never softlocks a poor world. - sim.js: countMiners() tallies gather assignments per node once per tick (frozen before any worker mines, so every miner reads the same count regardless of Map order — determinism-safe). - gather.js: miningEfficiency() applies the falloff at the take; no field / no count reads as full rate, so direct-call unit tests are unchanged. - ai.js: assignIdleWorkers now fills a seam to the soft cap then hops to the next-nearest (a saturation-steer term added to the distance score), shipped atomically so the AI doesn't pile everyone on one …1b1f280 -
Tier 8: balance pass, anti-stall win condition, replayable caches
Claude +1: Claude Fable 5Unverified signatureBalance (entities.js): - Bastion is quicker (speed 60->68) and longer-reaching (range 18->24) so it can actually catch and stick to the Skiffs it's meant to hard-counter, instead of being kited by a faster, longer-ranged Skiff — the clearest hole in the rock-paper-scissors triangle. - Skiff is slightly more fragile (hp 80->72): still the fast, cheap harasser, but its counters punish it faster now, curbing mass-Skiff dominance. - Breacher is a worthwhile investment rather than a trap: cheaper secondary cost (radioactives 100->60) and tankier (hp 100->130), keeping its radioactive-tech identity and anti-building role. (The RPS triangle relationships are unchanged; combat tests derive expected damage from the stats, so they stay self-consistent.) Anti-stall win condition (victory.js): - A match time limit (default 40 min, well beyond a normal game) with a score-based tiebreak (banked resources + built value of everything owned), so a defensive turtle can no longer str…a672b7d -
Tier 7: bring controls & UX up to RTS standard
Claude +1: Claude Fable 5Unverified signatureControls (input.js / commands.js): - Control groups: Shift+1–9 bind, 1–9 recall (Ctrl+digit is the browser's own tab-switch shortcut, so Shift is the conflict-free bind modifier; matched on physical key code so it works with Shift held). - Stop (X) drops orders + queued waypoints; Select Army (Q); Idle Worker (`) cycles to and centres on the next idle gatherer. - Ctrl+drag/click adds to the current selection; double-click selects every on-screen unit of that type. - Edge scroll: cursor at a canvas edge pans the camera. - Right-click the minimap to order the selection there (move / attack-move) without scrolling the main view first. HUD & readability (main.js / render.js / style.css): - Unaffordable produce/build/research buttons grey out and play the denied buzz on click instead of failing silently; buttons carry stat tooltips. - Selected units/buildings keep their health bar even at full HP, and the bar now has three colour bands (green/amber/red) rather than a green/re…4e300be -
Tier 6: performance & scale for large maps
Claude +1: Claude Fable 5Unverified signature- Uniform spatial grid (engine/grid.js), rebuilt once per tick, retires the three per-tick O(n^2) neighbour scans: separation, movement avoidance, and combat target acquisition now query only nearby cells. ~2.6x faster on the separation pass alone at 500 units, and the gap widens with scale. A full-scan fallback keeps every direct unit test byte-for-byte unchanged. - Viewport culling in render.js: fog cells, nodes, buildings and units outside the camera's world rect are skipped, so draw cost tracks what's on screen rather than total map size (16k+ fog cells on a 4x map). - Cache each resource node's silhouette (the seeded-PRNG polygon) instead of recomputing it every frame; only its radius changes as it depletes. - Index map.nodes by id (map.nodesById) — O(1) node lookups in gather, the AI, replacing per-tick linear .find scans that grew with map size. - Loop substep cap so a heavy tick degrades to slow-motion instead of spiralling into an ever-deepening backlog. - Pr…6d7e8fa -
Tier 5: make the AI a real opponent, not a fixed script
Claude +1: Claude Fable 5Unverified signature- Home defense with recall: when the AI can SEE enemy combat units pressing one of its buildings, the whole army (bar the scout) drops its attack and rushes the threat — so hitting its base while it marches on yours is no longer a free win. Exempt from the APM budget like the attack commit. - Garrison: a massed (size-triggered) attack now holds a home guard back (economist 3, balanced 2, rusher 0); a timeout commit still throws everything so the game always resolves. - Dynamic attack targeting: waves march on the nearest SEEN enemy Command Center, then any seen building, then a seen unit (raiding the army/worker line), and only fall back to the fixed start coordinate when it has spotted nothing — instead of forever walking to bases.player even after it's razed. - Scout swings toward the player's side after its centre sweep so the counter-picker actually sees the army it needs to counter; the AI also stops lending a scout while its base is under attack. - New tests: …2cc5301 -
Tier 0: fix latent defects, add determinism/perf tests and CI
Claude +1: Claude Fable 5Unverified signature- Building construction no longer heals away combat damage every tick: updateBuildingConstruction now ADDS the hp built this tick (capped at the progress ceiling) instead of overwriting hp downward, so sustained fire can actually raze a half-built structure — raiding buildings-in-progress works for both sides now. - createGameState resets the entity-id counter so a fresh game is a pure function of its seed; same-seed runs replay byte-identically. - A worker re-tasked to a different-commodity node hauls its existing load home instead of silently discarding the mined resources. - render.js prunes dead entities from the facing Map each frame and exposes resetFacing(), wired into new-game startup — no more unbounded growth. - New tests: full-sim determinism, id-reset reproducibility, a perf guard, construction-under-fire persistence + destruction, cargo preservation. - Add GitHub Actions workflow running `node --test` on push/PR. Co-Authored-By: Claude Fable 5 <noreply@ant…430c532 -
Configurable skirmish: AI speed, map size, and resource abundance
Claude +1: Claude Fable 5Unverified signatureThe splash screen now configures the match before you pick a world. AI speed is a 1–150 actions-per-minute cap on the opponent. Every command it issues — produce a unit, place a building, expand, research, send the scout — spends one action from a budget that accrues at APM/60 per second and caps at a few seconds' burst; when it runs out it waits. So a low setting is a sluggish, forgiving foe and a high one is relentless. The attack commit is deliberately exempt, so even a crawling AI still throws its army at you and the game always resolves. Default (and every headless test) is unthrottled, so existing behaviour is unchanged. Map size scales the field self-similarly — Small (1600×1000), Standard, Large, Gigantic (4×) — with more hidden caches seeded into the bigger contested space, and the camera can now zoom out far enough to take a Gigantic map fully into view (and opens on your own base, not the map centre). At sizeMult 1 the layout is byte-identical to the original. Resources (…19ca109 -
Give the AI its own fog of war — it must scout for intel too
Claude +1: Claude Fable 5Unverified signatureThe AI is no longer omniscient. It now plays under its own fog grid (state.fogAI, updated every tick just like the player's), and its intel-dependent decisions are gated by what it has actually seen: - Counter-building only counts player combat units currently in the AI's vision. No sight of your army means no counter-pick — it falls back to its archetype mix until it scouts or fights you. - Worker assignment and expansion only consider nodes the AI has discovered: charted surface deposits always (map knowledge for both sides), hidden caches only once scouted. It can't mine or expand to a cache it hasn't found. To earn that intel it keeps one spare unit scouting once its army can lend one — a box sweep of the contested middle (plain-move waypoints, so it reveals fog rather than diving into a fight), re-issued whenever the scout falls idle or dies, and kept out of the attack wave. The base-march attack is unchanged: in a mirror 1v1 both sides know the enemy start, so that's …816885c -
Add hidden resource caches discovered by exploration
Claude +1: Claude Fable 5Unverified signatureBeyond the charted deposits near each base, every map now seeds eight hidden caches out in the contested middle and along the vertical extremes — extra ore, crystal, and radioactive deposits the survey missed. They stay invisible (main view and minimap) and untargetable until one of your units scouts their cell; the fog's permanent "explored" memory doubles as the discovery record, so a found cache stays on the map. A new isNodeDiscovered(fog, node) in fog.js is the single gate render, minimap, and right-click picking all share. Caches often hold a commodity a world's surface lacks (crystals on Korrath, radioactives on Vesper), so scouting can unlock a resource — and the tech that needs it — you'd otherwise have no access to, giving exploration a real strategic payoff. They're placed after the near-base ore guarantee (so a hidden cache can never satisfy it) at fixed, mirrored, deterministic positions well clear of both bases. The AI's effectiveMix now keys off surface deposits only, …df20f1d -
Give workers a weak self-defense attack
Claude +1: Claude Fable 5Unverified signatureWorkers can now be ordered to attack (right-click an enemy) and fight back with a weak short-range strike — 4 damage on a 1.4s cooldown, about 2.9 DPS against a Skiff's 12. Crucially they never auto-acquire: a worker only swings when explicitly told to, so it doesn't abandon the economy to go pick fights, and a group ganging up can drive off a lone raider at a real cost (about five workers to kill one Skiff, taking a loss) rather than replacing military units. Workers route through a dedicated updateWorkerCombat (the ordered-attack path only, no acquire/attack-move machinery) that reuses the same performAttack as real units, so a worker's hit shows a tracer and plays its sound. The right-click order now includes any unit with an attack stat instead of combat-role only, so a mixed selection sends workers in too. Attack orders queue as waypoints like any other command. 167 tests pass (was 162): worker deals/queues/clears its ordered attack, closes when out of reach, stays weakest of al…da8e770 -
Use Ctrl instead of Shift as the waypoint-queue modifier
Claude +1: Claude Fable 5Unverified signatureRebind the queue-a-waypoint gesture from Shift+right-click to Ctrl+right-click, and update the in-game hint, README controls, and engine comments to match. The command layer stays modifier-agnostic (it takes a queue boolean); only the input layer names the key. Ctrl also sidesteps the Firefox quirk that let Shift+right-click bypass the page's context-menu suppression, so the window-level preventDefault now holds across every browser — dropped that stale caveat from the comment. Verified in headless Chromium: Ctrl+right-click chains waypoints and the dashed path renders; 162 tests pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AEQUVetLk31Jj7niDQAsXL3f927e2
-
Waypoint queueing: shift+right-click chains orders into a path
Claude +1: Claude Fable 5Unverified signatureUnits now carry an order queue. A plain right-click issues its order immediately and clears the queue (unchanged feel); holding Shift appends the order as a waypoint instead, so a sequence of Shift+right-clicks lays down a path the units run through in order. The queued order is context-sensitive, exactly like a normal right-click — move/attack-move on open ground (combat units keep their aggressive-advance flavor, workers a plain move), attack on an enemy, gather on a node, assist on a construction site — so a chain can mix destinations, targets, and jobs. A Shift command to a fully idle unit still takes effect immediately, so the first waypoint of a chain is never a dead step. The sim pulls the next queued order in the moment the active one finishes (arrival, target killed, node drained), and a combat unit only falls back to auto-acquiring once its whole chain is exhausted. render.js draws the remaining path — a dashed line through each stop with a marker at each — for any selected …845de25 -
Merge Tier 4 into main alongside Tier 3
Claude +1: Claude Fable 5Unverified signaturemain had advanced with Tier 3 (repeated AI attack waves, counter-building, minimap, under-attack alert, combat tracers/death flashes, build-ghost preview, production-queue display + cancel, panel aggregation) while Tier 4 (buildable expansion Command Center, Sentinel Turret + Breacher siege unit, supply cap + Habitat, 9-world roster with per-planet modifiers, AI parity) was built in parallel. This reconciles the two feature sets. Notable resolutions: - Placement validation: the two tiers independently shipped engine/placement.js (isValidPlacement) and engine/colliders.js (canPlaceBuilding + findPlacement). Consolidated on colliders.js — it's a superset the AI's expansion needs — and repointed the build-ghost preview and issueBuild at it; removed placement.js and its now-redundant test. - Combat: kept Tier 4's shared performAttack fire path and folded Tier 3's tracer data (fromX/fromY/unitType) back into its attackHit event, so both the siege heavy-hit sound and the attack …c769ac5 -
Tier 4 AI economy fixes: expansion no longer starves the army; balance ore mining
Claude +1: Claude Fable 5Unverified signaturePost-review headless simulations across all nine worlds surfaced two AI economy regressions, both fixed here. The expansion reserve gated unit production, so on an ore-poor world (Glacius, Forge) the AI would freeze its army for minutes banking toward a 400-ore Command Center its income could never reach before the last seam dried — ending with a token army. The reserve now pauses only the lower-priority infrastructure spends (a second Barracks, the Refinery); unit production always flows, so the army keeps growing while the AI banks, and simply skips the expansion on a world too poor to afford it. Worker assignment sent every idle worker to the nearest spendable node, so on crystal-heavy Helix (its extra-seam modifier) workers piled onto crystals and starved the ore that funds the whole army — it fielded a single unit while banking thousands of crystals. Workers now keep the bulk of the crew on ore (the universal currency) with only a small secondary crew on crystals/radioactives fo…d6f4b4f -
Tier 4 AI parity + planet roster with per-world rule modifiers
Claude +1: Claude Fable 5Unverified signatureThe AI now plays all of Tier 4, driven by extended archetype profiles rather than hardcoding: it fortifies with Sentinel Turrets on the approach vector (Economist 2, Balanced 1, Rusher 0), expands to a second Command Center when home ore runs thin (banking for it via an ore reserve that pauses the unit mix instead of starving it), runs one shared production cycle across multiple Barracks (fixing the one-unit-at-a-time ceiling), and folds the Breacher into the patient mixes where the map can pay for it. A spendable-node worker filter keeps a poor-economy world's AI off dead-end commodities. Every new field is read with a use-site default, so a legacy profile still runs. Opens the picker from 3 to 9 curated worlds, each assigned an archetype and up to one data-driven rule modifier threaded symmetrically through the engine: Glacius slows all units, Nimbus/Pyralis shorten/lengthen sight and aggro, Helix adds a crystal cluster, Oort enriches deposits, Forge speeds construction. All modifie…ac7d42f -
Tier 4 economy: supply cap and the Habitat that raises it
Claude +1: Claude Fable 5Unverified signatureArmy size was bounded only by ore, which flattened macro decisions. Now every unit costs supply (worker/skiff 1, bastion/lancer/breacher 2), Command Centers grant 10, and a cheap Habitat (75 ore, fast) grants 8 — a macro choice, a raidable weak point, and a hard bound on the sim's O(n^2) hot loops all at once. engine/supply.js recomputes used/cap on demand from state — no stored counter, so a destroyed building's queued jobs free their reservation with zero bookkeeping and drift is impossible. queueProduction reserves at queue time (all queued jobs count), rejecting after the affordability check and before payment so nothing needs refunding; a blocked attempt raises a productionBlocked event that the HUD turns into a beep and a red supply readout. Losing a Habitat can leave a player legally over cap — nothing dies, production just blocks until they rebuild. The AI raises a Habitat as it nears the cap (in the same change, so its production never silently stalls) and the HUD shows live…04b2d3e