Spaces:
Paused
Paused
Commit History
-
Setup: a 150 Population cap rung, for frame rate
Claude +1: Claude Opus 5Unverified signatureRaising the Odyssey worker crew made neighbours genuinely develop, and a developed neighbour is a lot of entities. Measured on the heaviest case it now produces -- ferros/aggressive, 60 sim-minutes, timing ONE sim-minute at minute 60 so the cost is measured at full size: popCap 150 supply 150/150 units 100 buildings 39 650ms (92x realtime) popCap 200 supply 200/200 units 129 buildings 43 920ms (65x realtime) popCap 300 supply 300/300 units 184 buildings 56 1420ms (42x realtime) popCap Max supply 1221/1233 units 563 buildings 166 8080ms (7x realtime) 150 is ~12x cheaper to simulate than uncapped. It belongs below 200 because it is a PERFORMANCE option, not a balance one: the cap bounds both sides' armies and the housing that feeds them (engine/aiEconomy.js stops raising Habitats once the raw building total reaches the ceiling), so it is the only dial that bounds total entity count directly. Purely a new value in an existing row -- suppl…695bde6
-
Tier 1, step 2b: expand // @ts-check coverage from 10 files to 20 (D3)
Claude +1: Claude Opus 5Unverified signatureAdopted in the order docs/code-improvement-tiers.md sets out, cheapest and highest bug-class value first: supply, aiCommon, colliders, victory, production, scout, the three AI leaves (aiStrategy, aiDifficulty, aiArchetypes), and finally persist.js — the prize, because every save field is a State/Unit/Building field read by name, so annotating it makes save-shape drift a check-time error. Each file's exports are annotated with the shared typedefs, not just given the pragma: per the guard added in the previous commit, a pragma without annotations checks nothing. Doing it surfaced three more genuine drifts in engine/types.js, all found by the checker rather than by reading: - Building.rally was typed {x, y} but carries nodeId — the rally-to-resource feature, where a rally dropped on a live node makes a produced unit spawn already mining (engine/production.js). - Building.queue entries were typed {unitType, progress} but carry `alt`, which records that a job was charged the unit's…7e764b0
-
Add a configurable population cap (200/250/300/Max) for both sides
ClaudeUnverified signatureNo hard ceiling existed before this — supplyCap (engine/supply.js) was purely additive from completed buildings (Command Center +10, Habitat +8), unbounded above. Added a new setup.js option, Population cap, alongside the existing economy dials (Faction/Resources), offered in both Skirmish and Odyssey (the two modes with a real economy) — Max (the default) is byte-identical to today's always-uncapped behavior. - engine/supply.js: split the old supplyCap into buildingSupplyCap (the raw, unclamped additive total) and a new supplyCap that clamps it to state.popCap when set. Every existing caller (production.js's enforcement gate, hud.js's display) keeps calling supplyCap unchanged and transparently gets the clamped behavior. - state.popCap threads through createGameState, boot.js's startGame AND startOdyssey, and engine/galaxy.js's createGalaxy/addPlanet — applied unconditionally to every world (active seat and background neighbours alike, exactly like sizeMult/resourceMult…dadc0b2
-
Electrify: wire non-power buildings into the grid for +30%
Claude +1: Claude Opus 4.8Unverified signatureAn Odyssey non-power building — a Command Center, Barracks, Star Dock or Habitat — can now be ELECTRIFIED: wired into the power grid to run 30% better. A producer trains its units 30% faster; a Habitat houses 30% more. The upgrade isn't free. An electrified building adds a steady grid draw (ELECTRIFY_POWER, grid-efficiency scaled like any consumer), so lighting up the whole base competes with the factories for Reactor Power. And the payoff scales with the player-wide power throttle: the full +30% only while the grid can carry the load, tapering as it runs short and 0 with no active source at all — so it's worth it once you have Power to spare, not as a free stack. - isElectrifiable(type) (entities.js): a building not already on the power economy (no recipe/reactor/generator/rig/wonder) that has something to boost (produces || supplyGrants). - ELECTRIFY_POWER draw + electrifyBoost(state, owner) = 0.3 × throttle (industry.js); powerDraw counts each electrified building. - Boost a…c2a29e2
-
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