• TypeScript 97.6%
  • CSS 1.5%
  • HTML 0.7%
  • JavaScript 0.2%
Find a file
2026-10-26 02:24:47 +02:00
.forgejo/workflows Forgejo workflow publishes the server image to git.swipelab.com; compose pulls it 2026-10-13 19:53:51 +03:00
assets Shores and ground: beaches and rocky shores that dip under the sea, a biome paint with farmland on a sunlit ground material, highways with a dirt shoulder, and low-poly rocks (#3308) 2026-10-18 06:17:55 +03:00
mock Boomtown draws each plot's family at its rank, and main's 159 looks leave (#3788) 2026-10-24 18:13:01 +03:00
proto The Game keeps each landed strike through its reveal, saves it and sends it in Nukes (#3773) 2026-10-24 08:11:09 +03:00
public init 2026-10-10 11:17:47 +01:00
scripts On the sunlit ground, marks keep their contrast with the grass and calm cities step back toward the drawn grass (#3312) 2026-10-17 23:04:25 +03:00
src The city layers tests pin a Classic rank-up during a growth or a cross-fade going on from the building its plot stands as, and swapping in at once where its new building draws no taller (#3792) 2026-10-25 16:13:03 +02:00
.dockerignore The production server runs from an esbuild bundle that npm run build writes 2026-10-14 03:10:28 +03:00
.gitignore The production server runs from an esbuild bundle that npm run build writes 2026-10-14 03:10:28 +03:00
AGENTS.md 0.4 new hud 2026-10-12 23:57:30 +01:00
buf.gen.yaml contour fixes, vison fixes 2026-10-12 22:12:48 +01:00
buf.yaml contour fixes, vison fixes 2026-10-12 22:12:48 +01:00
changelog.md The changelog and the help say a city building keeps its style and grows taller where it stands (#3792) 2026-10-25 14:37:07 +02:00
compose.yaml The server logs the TRACE timing breakdown each minute; compose turns TRACE on (#3143) 2026-10-15 12:25:19 +03:00
Dockerfile The production server runs from an esbuild bundle that npm run build writes 2026-10-14 03:10:28 +03:00
index.html HudView builds the HUD into #hud, pinned by DOM tests, a mock page and a WebKit layout run (#3155) 2026-10-15 14:32:45 +03:00
package-lock.json On a phone the lobby grid's rows are as tall as their panels, so the hall and a room scroll instead of squeezing panels over each other 2026-10-14 18:43:35 +03:00
package.json Monuments 1. npm run towns prints the home-town and founding gates from fixed map sets (monuments/towns) 2026-10-17 05:47:42 +03:00
README.md city sprawl mechanics 2026-10-14 22:25:48 +01:00
tsconfig.json networking, ai, music 2026-10-11 18:46:33 +01:00
vite.config.ts npm test stays browser-free: the WebKit phone layout runs through npm run test:phone, and lobby-css.test.ts checks the phone grid rule 2026-10-14 18:51:19 +03:00

AI harness

npm run ai plays a match with every seat controlled by the AI. It uses the same server, fog, and orders as a live game, and it does not wait on the wall clock. One simulated step is issued as soon as the previous one finishes, so a 20 minute match takes seconds of real time.

npm run ai
npm run ai -- --seed 42 --minutes 10
npm run ai -- --size small --players 4 --quiet

The dashboard shows simulated time, how many times faster than realtime the run is, and one row per bot: credits, population, supply, cities, army, and the lanes it considered on its last decision. A short log under that lists each new thought. --quiet skips the dashboard and prints a one-line status each simulated minute. Either way the process ends with a summary: who is still standing, sim time, wall time, and the speedup.

The run stops when one bot is left with units or cities, when --minutes of simulated time elapses (default 20), or when you press Ctrl-C.

Options

Flag Default Meaning
--seed random Map seed. Printed in the summary so a game can be repeated. Tiny maps sometimes collapse; the harness then tries the next seeds and reports the one it used.
--size tiny tiny (64), small (128), medium (192), or large (256).
--players 2 AI seats. Capped by the map (2, 4, 6, or 8).
--minutes 20 Simulated minutes before the match is called.
--pace 1 How often bots think, on the same scale as the lobby pace slider.
--log ai-trace.jsonl Thought trace. Replaced at the start of each run.
--quiet off Log and summary only, no dashboard.

Pass flags after -- so npm forwards them: npm run ai -- --seed 7.

Thought trace

ai-trace.jsonl is one JSON object per line.

  • start records the seed, size, player count, minute limit, and pace.
  • think is one decision: t is simulated seconds, then player, name, candidates, and the orders that were sent.
  • end records why the match stopped, the speedup, and who was still standing.

Each candidate has a lane (home, contact, or march), a scenario (build, garrison, train, defend, explore, capture, assault), a score, a tile, how many orders it issued, and blocked. An empty blocked string means that lane acted. holding in the dashboard means it is already doing the job, so it sent no new order. Block reasons are pop, no site, no target, and army too small.

Diff the trace between runs when changing src/ai/scenarios.ts. A bot that cannot afford a factory shows home build blocked: pop, then either holds a unit in a city that can still grow or sends a scout to capture or explore.