Repository navigation
feat(gridlock): isometric neon city-builder with pure simulation core - #17
Draft
cloudygetty-ai wants to merge 1 commit into
Draft
cloudygetty-ai wants to merge 1 commit into
cloudygetty-ai wants to merge 1 commit into
Conversation
GRIDLOCK — "Everything runs through you." A SimCity-style builder with three pressures that make placement a decision rather than painting: - Adjacency synergy: 11 rules where the same building is worth materially more or less depending on what it touches (Foot Traffic, Downwind, Coolant Draw…) - Heat Index: industry and compute warm the planet; past 55 cooling demand and approval start to bite, past 88 the city is in crisis - Crisis cards: 12 condition-triggered cards that pause the world and force a trade with no clean answer Architecture: - Zero build step, zero dependencies, native ES modules - config/ is data only; core/ is a pure simulation (tickMonth(state) -> state, no DOM, no clock, no Math.random) so it runs headless under node --test - Every stochastic decision draws from (seed, rollCount), so saves replay exactly - Buildings are catalog entries: adding one makes it appear in the palette, on the map, and in the economy with no other code change - Deterministic priority-ordered utility rationing: water plants and clinics stay lit, factories brown out first; water resolves after power so the cascade runs one way - HEALTH / PRESSURE / EFFICIENCY telemetry behind ` or ?debug=1 77 tests covering placement rules, road connectivity, rationing order, synergy caps, tick purity and determinism, crisis gating, directive streaks, and a 10-year fixture-district balance regression. Includes a guard against comparing the clamped utility ratio to a value above 1 — a bug that made Grid Surge fire every month. Also: /gridlock route on Vercel, an isolated dependency-free CI job, and npm run test:gridlock. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013EjP7McK858rKp62kZajpi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GRIDLOCK — Everything runs through you.
A SimCity-style isometric city-builder at
games/gridlock/. Openindex.html— no build step, no dependencies, no server.What makes it not-SimCity
Three pressures turn zoning from painting into a decision:
The three chains
road ──▶ power ──▶ water ──▶ live. A structure produces nothing unless all three hold. Utility rationing is deterministic and priority-ordered — water plants and clinics stay lit, factories brown out first — and water resolves after power, so an unpowered pump makes no water and the cascade runs one way.Architecture
config/is data only;core/is a pure simulation:tickMonth(state) → state, no DOM, no clock, noMath.random. It runs headless undernode --test, which is what makes any of this testable.(seed, rollCount), so a save file replays exactly and crisis outcomes are reproducible.config/buildings.jsmakes it appear in the palette, on the map, and in the economy with no other code change. The renderer draws all 31 structures procedurally; there is no art pipeline.`or?debug=1. A built-out city ticks in <1ms and draws in ~3ms at 58fps.Tests
77 tests, no framework and no dependencies: placement rules, road connectivity and orphan islands, rationing order, synergy caps, tick purity/determinism, crisis gating, directive streaks, and a 10-year fixture-district balance regression (fills up, pays for itself, stays cool; dirty industry demonstrably overheats it; severing a street takes the district offline).
Two real bugs were caught and fixed during verification:
power.ratio(clamped at 1) against 1.05. There is now a test asserting no crisis condition does this.N CUT OFFchip alongside BROWNOUT / WATER SHORT / GRIDLOCK / DEFICIT / OVERHEATING.Verification
npm run test:gridlock— 77/77 passtype-check/lint/jestare unaffected —tsconfigincludes onlysrc/**, eslint targets only.ts,.tsx, and jest'stestRegexdoes not match.mjs. (Those commands fail in this container only becausenode_modulesis not installed.)Also included
/gridlockroute invercel.json(plus static passthrough forgames/**)npm run test:gridlockat the repo rootGenerated by Claude Code