Commit graph

42 commits

Author SHA1 Message Date
Wolfgang Nagele
7438fd1065 Agent mode: an AI agent plays in the player's own tab, with the agent's clock or a running one
The MCP server gains a second session, --browser: the game in the player's tab, reached through the
agent relay npm run dev hosts at /agent (loopback unless --host; Host and Origin checked, no token).
The player turns it on in Settings → Agent API, a section only the development page has, and picks the
clock: a pace of 30 s to 5 min a day that nobody can pause, or the agent's own. Headless gets the
running clock too (--clock realtime --pace MS) and both get a wait tool.

All of it lives in src/agent/ (development page only). The game offers HOOKS, UI.clockLocked,
setSpeed() and runClock(dt), the frame's day block moved out unchanged, and nothing more: the page
players get grows by under 1 KB gzipped and runs exactly as before.
2026-11-03 16:18:43 -05:00
Frederic Jung
48ba0048da
Keyboard shortcuts: the Help button works on the title screen; MCP knows the new actions
Before a game starts the click handler only runs allowlisted actions, so Help's
Keyboard shortcuts button did nothing on the title screen. Allow it, and close
the list with helpClose, so ? returns to the title instead of leaving an empty
map. popStep, zoomStep and keys are views for the MCP server.
2026-11-03 11:50:48 +01:00
Frederic Jung
09f205e458
Add Best Effort, a soft mode, and quiet notifications
A fourth Normal preset, gentler than Change Freeze: calm chaos (so no DDoS
and no chaos monkey), quick builds and no market, plus four new rules that
only it softens: sea cuts mend on their own clock without cable ships, no
conference season, a five-year Ministry of Tubes rescue loan instead of
game over, and customers who sour half as fast. The new rules are written
into S.rules only when they differ from the classic game, so older networks'
rules stay byte for byte what they were.

Quiet notifications is a new setting for every mode, on by default in Best
Effort: toasts the day itself raises pop up only for trouble and milestones,
the rest goes to the NOC log; what a click says still shows. Best Effort
badges count as Freeze-dried. The preset picker is four wide, two by two on
a phone in portrait.
2026-11-03 08:12:09 +00:00
Frederic Jung
dd10a6c19c
Faster routing and map: finished flows leave the rank loop, flows keep their exit table, lazy exit labels, off-screen links culled by box 2026-11-01 13:51:25 +01:00
Frederic Jung
597cc40aef
Faster Networks tab and map labels: count connections without building them, cache exchange lists, grid label check 2026-11-01 13:08:43 +01:00
Frederic Jung
5e27f9e787
Cable ships a tad smaller on the map 2026-11-01 12:07:24 +00:00
Frederic Jung
620253b57b
Cable ships a size bigger on the map; a ship at work sits just off the cut marker 2026-11-01 11:48:42 +00:00
Frederic Jung
96e2c2f537
Cable ships: club repair ships sail out to subsea cuts, private charters jump the queue, lay ships build your cables
A subsea cut sends the nearest free ship of its region's maintenance club from its port, along the cable routes at about 500 km a day; the cut lasts while it sails, waits for permits in slow countries and splices (3-5 days shallow, 6-12 deep). Ships stay busy until home (S.fleet). With the club's ships all out the cut waits; a private charter of the quickest free ship costs $1M + $200/km sailed. Own subsea builds show survey/factory, then a lay ship at 150 km/day; a second lay ship can be booked before laying ($3M + $150k/day saved), and crews no longer speed up cables at sea. Ships are drawn on the map and can be tapped.
2026-11-01 11:24:53 +00:00
Frederic Jung
a8fa75411c
Merge #214-#217: Manila, Cebu and Davao (fmcglinn)
Adapted to main: Globe is main's Globe-Trotter Telecom (now a Philippine
carrier in Cebu and Davao) instead of a second AS4775, the new Philippine
networks buy transit from NTT and Tata like main's other island networks,
cities and networks carry their country, and Philippine transit sits in the
new pricing. Cable names no longer pile up where short cables crowd.
2026-10-31 14:11:12 +01:00
Frederic Jung
72fb233af7
DDoS rework (#242): world-sized floods on customers, spread over every port, RTBH per target, Flowspec rule budgets, magnet scrubbing, new NOC card
Work in progress: the full test suite is still being brought in line.
2026-10-31 12:20:14 +01:00
Frederic Jung
cb90e735fd
Map: cities show their size, and crowded small ones step back to a dot
Five sizes from a city's eyeballs (P: under 15, 100, 350, 800 and up). Far view: dots grow with size and megacities glow. Near view: the skyline goes from a hut to five towers with an antenna. cityRoom() lets the selected city, your POPs and cities with an offer, outage or puzzle part claim space first, then the biggest; a city with no room is a small dot without a label until you zoom in, still tappable. IX tags for exchanges you haven't joined are smaller, and on outposts and towns only from zoom 1.5. Phones draw city icons at 82% (taps unchanged).
2026-10-31 11:36:48 +01:00
Frederic Jung
601f7028bd
Puzzles: city markers move to the top left, clear of the IX badge
The eyeballs, content and circuit markers sat on the IX badge of cities without a
POP yet (reported by Thomas Kjær). Architect's mission-critical marker is now the
siren like everywhere else.
2026-10-30 13:24:08 +01:00
Frederic Jung
7672db1992
Puzzles: show one trench or separate paths on the map in every puzzle
Two tubes between the same cities read as one line until clicked (reported by
Thomas Kjær). Every puzzle now draws a shared trench as a bundle with a '2× one
trench' tag and separate paths bowed apart with a '2 paths' tag, at any zoom.
2026-10-30 13:15:38 +01:00
Frederic Jung
dc4c0f07d5
Merge v2 into architect: the chaos monkey in every puzzle, and in normal games
Starting a run or a puzzle now sends a monkey left over from an Architect review away.
2026-10-30 12:33:33 +01:00
Frederic Jung
cbcb242d90
Architect runs: show whether tubes share a trench or take separate paths
Tubes in one trench are drawn as strands of one bundle with an orange '2× one trench'
pill; separate paths bow well apart with a green '2 paths' pill. Cut tubes no longer
show the backhoe: the monkey does the snipping.
2026-10-30 11:52:54 +01:00
Frederic Jung
cbb7ca8772
Badges: Met the Backhoe becomes Met the Chaos Monkey
Earned on the monkey's first visit instead of any fiber cut; the badge keeps its id,
so ones already earned carry over. Monkey-proof gets a shield. The monkey's cheer
also cancels a spray still pending from its last hop.
2026-10-30 11:44:22 +01:00
Frederic Jung
87364af55d
Architect runs: a skipped review that passes still ends with the monkey's cheer 2026-10-30 11:42:34 +01:00
Frederic Jung
170914b05e
Architect runs: later briefs stay a surprise
No numbered tags beside cities, no "coming up" plan on a city card and no hint
to build there early: you design for today's brief and find out what comes next.
2026-10-30 11:18:54 +01:00
Frederic Jung
f4486ee955
Chaos monkey: a visitor that snips tubes in On-call and BGP at 3 a.m.
Now and then a chaos monkey moves in for 120 to 240 days and snips a tube every
couple of weeks, weak spots first, instead of the usual random outages. Outlast
it without a customer noticing for a bonus and the Monkey-proof badge, or throw
it a banana. Drawn on the map in shades; gameplay rule F4 with its test.
2026-10-30 10:54:25 +01:00
Frederic Jung
4701cefbfd
Architect runs: draw our own chaos monkey, in shades
A hand-drawn monkey in the map's outline style replaces the emoji: sunglasses,
a spray can, a swaying tail, and poses for running, snipping, dancing and cheering.
2026-10-30 09:33:05 +01:00
Frederic Jung
b3351fb7d9
Architect runs: a chaos monkey runs round the map snipping tubes
The review is now an animated monkey that hops from cut to cut and sprays
chaos where it snips, instead of the backhoe.
2026-10-30 09:25:20 +01:00
tkjaer
644e6174d9
Architect runs (prototype): one network, built brief by brief
Three runs (Euro Run, Coast to Coast, Pacific Rim) on the puzzle machinery: briefs add sites,
raise demand, make sites gold, ask for rings or latency caps, or close a city; earlier builds
stay paid for, and the backhoe review cuts every trench and cable in turn. By tkjaer, from
seriesoftubes-architect.
2026-10-30 08:01:42 +01:00
Frederic Jung
e90f5f675e
Puzzles: real traffic routed by the game, routers, link sizes and paths
Every puzzle now carries demand (eyeballs pulling from a content origin, circuits
with latency caps, best-effort flows) routed by compute(). Stars: delivered,
within budget, N-1 under load. Routers, ports, metrics, standby and the
redundancy check work in puzzles; the whole world is open. Weekly schema 2
carries the demand; scripts/lib/puzzle-solver.js sizes and searches builds.
2026-10-29 10:35:28 +01:00
Frederic Jung
efb14680cc
Merge save slots: one network per window, consistent saves 2026-10-29 07:57:00 +01:00
Frederic Jung
5f412f72d8
Merge v2 into v2-saves 2026-10-29 07:32:19 +01:00
Frederic Jung
5c2b3a4758
Map: a link's curve only measures the cities that could be in its way
bezGeom() measured every city against every candidate curve, for every link the
first time the map drew it. A curve stays inside the box of its end and control
points, so a city further than the clearance it needs outside that box always
measures as clear; leaving it out gives the same curve. About 4x faster, and
the curves on the big fixture are byte-identical.
2026-10-29 07:01:01 +01:00
Frederic Jung
adc312f27b
Map: test land polygons against their bounding box first
The sea waves, hills and the far view's islet list test points against every
coastline polygon while the page loads: about 0.8 s of a throttled phone's load.
A point outside a ring's box is outside the ring, so nearly every test stops
there. Waves, hills and the far view's islands come out byte-identical.
2026-10-29 07:00:53 +01:00
Frederic Jung
da8150b7c4
Save slots: several networks per browser, one per window, with a cross-window guard 2026-10-28 20:52:47 +01:00
Frederic Jung
946da17c8b
Merge Puzzles, Tier 1 by customer cone and badge variants into v2 2026-10-28 18:14:56 +01:00
Frederic Jung
8df1b82a2e
Puzzles behind the Puzzles door: merge v2-puzzles onto the ruleset
Puzzles run on the puzzle preset (clock off); the temporary title button is gone and the door opens the puzzle list.
2026-10-28 16:39:05 +01:00
Frederic Jung
7fc8d0f080
Puzzles: small, calm network builds with stars, packs and a weekly puzzle (#190) 2026-10-28 16:21:25 +01:00
Frederic Jung
fa4e30692e
Merge the ruleset and four doors into v2 2026-10-28 15:45:09 +01:00
Frederic Jung
531f90f107
One game, four doors: a per-save ruleset with Change Freeze, On-call and BGP at 3 a.m., a real Sandbox, and a new start screen 2026-10-28 15:27:04 +01:00
Frederic Jung
a6829b3d66 Merge #131: Custom routing metric for links (MurphysHub) 2026-10-28 14:58:12 +01:00
Frederic Jung
8b8bfadbaa
Start anywhere: pick any city with transit as your home 2026-10-28 08:30:17 +01:00
Frederic Jung
87fac683f0
Language is a dropdown on the title screen and in Settings 2026-10-28 08:18:56 +01:00
Frederic Jung
b4f8d9c7f5 Put a link on standby; the routing metric stays per city pair (#122)
A backup-only link next to a normal one still carried traffic, because
parallel links merge into one edge. The metric stays on the city pair
(S.pairMet), and any link can go on standby: it adds capacity that
fills only after the active links, so it idles as a backup, takes the
overflow when they are full and carries the traffic when they are down.
Build order no longer matters, and adding a link never idles the
others. Old saves keep each pair's lowest metric with every link
active, which is how they routed before. The panel says what a standby
link is doing, the redundancy list tags it, the map draws it dashed
while idle, and traceroute shows the active link.
2026-10-28 07:11:47 +01:00
Hugues
a3dd1dd810 Busy maps: no link labels or fiber dots above 1,000 lines on screen
On a save with 2,700 lines on screen, Firefox spent about 95% of each
frame painting, and the dotted line on lit fiber (~160 ms) and the link
labels (~55 ms) were half of it, in a tangle where neither can be read.

draw() now counts the lines it would paint (linesOnScreen(), same box and
margin as its own culling, boxes cached on the geometry) and above
MAP_BUSY = 1000 leaves out both. They come back as soon as fewer lines
show, zooming in for instance. The selected link keeps its label.

Firefox Developer Edition headless, 1600x900 at DPR 2, player save, median
of 3x9 frames: save view 414 -> 214 ms, pan 472 -> 238, zoom 0.6 269 -> 181,
New York zoom 2 213 -> 107, selected link 412 -> 201. Under the threshold
pixels are identical (canvas SHA-1): zoom 3.2 and 6 on the player save, six
views of the big-network fixture.
2026-10-27 14:03:04 +01:00
Hugues
ecb862e70d Map of huge networks: fiber capacity once per frame, skip links off screen
draw() asked dfCap() three to five times per fiber link and per frame (width,
colour, label, up or down), each time over all its channels: on a save with
3,140 dark fibers of 18 channels on average that was about half of draw()'s
JavaScript. dfCap() now keeps its answers in DFC while one frame is drawn
(cleared in a finally, so a failed frame keeps nothing), and the link label is
built once per line instead of once per world copy. Links entirely above or
below the screen are skipped like those left or right of it already were.

Player save (202 POPs, 3,142 links), jsdom: draw() 40 -> 25 ms; perf-bench
"Map at three zoom levels" 89.7 -> 47.1 ms. Canvas call log identical at
every zoom without the vertical skip; Firefox pixels identical (SHA-1 of the
canvas) in 7 views. Firefox still spends ~95% of the frame painting.
2026-10-27 13:44:47 +01:00
Frederic Jung
e817beed1a
Translations keyed by labels instead of English text
tr('pnis.delivery_2_to_6_weeks') instead of tr('Delivery: 2 to 6 weeks'): the
English lives once, in src/i18n/en.js (inlined into the page at build, so no
extra request), and it/pt/fr map the same labels. Changing English wording no
longer renames a key in every dictionary.

- 2,899 labels, made from where each text is used and its first words; short
  shared words are common.*
- plurals are one label with {one, other}: trn('label', n)
- static markup: data-i18n="label", data-i18n-aria-label, data-i18n-title
- saves from 1.33 and older stored English text in a few places; tr() still
  resolves it
- i18n-check: undefined/unused labels, markup drift, plural shape; i18n-add.js
  works on labels and --rename updates src/ too
- the old-branch port tool gives old English-keyed code and dictionaries the
  same labels
2026-10-27 11:05:09 +01:00
Frederic Jung
dbbbdaa1e3
Merge main (city density rule) into the split layout via port-branch 2026-10-27 10:23:42 +01:00
Frederic Jung
67a40942b4
Split the game page into partials under src/, assembled into one index.html at build
site/index.html (900 KB of HTML, CSS and JS in one file) becomes src/: a shell
(src/index.html), styles/ and game/, concatenated in path order by
scripts/lib/page.js. The assembled page is byte-identical to the old file, so
load time and in-game performance are unchanged.

- scripts/build.js replaces build.sh (same env vars, same output)
- npm run dev: a zero-dependency dev server that assembles on every request
- tests assemble the page in memory; npm test runs every tests/*.test.js
- perf-bench takes --base-ref to build a git ref's page
- scripts/legacy/split-index-html.js is the splitter, kept for older branches
2026-10-27 10:05:56 +01:00