Commit graph

478 commits

Author SHA1 Message Date
Frederic Jung
d1a2504104
Merge branch 'pr270b'
# Conflicts:
#	CHANGELOG.md
#	src/game/93-ui/82-keys.js
2026-11-03 12:10:19 +01: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
9cf90d0ad0
Merge branch 'pr270' 2026-11-03 11:50:47 +01:00
Charlie Allom
c5c5aac970
Merge remote-tracking branch 'origin/main' into keyboard-shortcuts 2026-11-03 10:48:01 +00:00
Charlie Allom
3192f42b5a
$ steps through the open offers, soonest to expire first
$ moves the map to the next offer's city, in the Deals list's order,
opens the Customers tab on a POP and marks the offer under Offers here
(UI.offerAt, the existing .row.on style). Two offers in one city each
get a press; any other selection clears the mark. With nothing on the
table it says so with the Deals tab's own "No open offers" text.
2026-11-03 10:47:51 +00:00
Frederic Jung
b7e5f193b4
pages test: look for raw labels one text node at a time
The check joined whole panels' textContent, so a NOC log line ending in a
full stop ran into its timestamp ('facendo.' + 'proprio ora') and read as a
label. The new cities moved the seeded game onto such a line in Italian.
2026-11-03 10:43:45 +00:00
Charlie Allom
a0acb27c7a
Merge remote-tracking branch 'origin/main' into keyboard-shortcuts
# Conflicts:
#	CHANGELOG.md
2026-11-03 10:39:00 +00:00
Frederic Jung
823e4188be
Pay to hurry the permits and factory of your own subsea cable (closes #258)
Before laying starts, seaRush buys 30 days a step (or all of them at once)
at $500k plus $60 a km, with the market's build prices. The floor is the
factory: 60 days plus a day per ~80 km from the order (prepMin, through
leadDays), then the lay ships still need their time at sea, which a second
ship still halves. 6,000 km: from 600 days of prep to 132 for about $13M.
2026-11-03 10:35:16 +00:00
Charlie Allom
2680f3d82b
The arrow keys and W A S D move the map while held
The map moves at 700 px a second on screen at any zoom. The keys run
their own frame loop only while one is down, so the game loop does no
extra work. Letting go, a window opening or leaving the browser window
stops it, and a slow frame moves at most 50 ms worth. Arrows still
scroll the NOC dashboard when it is open, and Alt or Cmd with an arrow
stays the browser's.
2026-11-03 10:31:42 +00:00
Frederic Jung
4d609d996f
Port Hedland, Townsville and Alice Springs; the wet season up north (closes #255)
Three cities in the gaps of northern Australia, Telstraya everywhere, Hocus
Pocus in Port Hedland and Townsville, Aussie Boyband in Townsville. Port
Hedland lands the No Worries Cable System up to Darwin (the real NWCS) and a
Port Hedland-Singapore pair on the Darwin Award Cable (the DJSC interconnect
onto the ASC). Alice Springs has no cable and its only facility is an old
telegraph station.

Cities in the tropical north (Darwin, Port Hedland, Townsville) are wet: from
November to April a cut on land there takes twice as long to reach, with its
own message. The real DigiCo, iseek, NEXTDC, NWCS and DJSC names go on the
blocklist.
2026-11-03 10:28:03 +00:00
Charlie Allom
d88684d86e
n opens the NOC dashboard, and a letter right after it opens a tab
n then o, u, c, t, r or l, within a second, opens Overview, Customers,
Connections, Traffic, Links & routers or Leased lines. n never closes
the dashboard, so n c switches tabs without it flashing shut; Escape
closes it. Shift on the way does not cancel the wait, any other key
does. The ? list shows the letters.
2026-11-03 10:20:15 +00:00
Frederic Jung
a031b81d4d
Merge branch 'pr269' into HEAD
# Conflicts:
#	CHANGELOG.md
2026-11-03 10:19:15 +00:00
Charlie Allom
23eeddf44f
Keyboard shortcuts: [ ] step through your POPs, - = zoom, ? lists every key
[ and ] select the previous or next of your POPs, in the order Find a
city lists them, and move the map there. - and = (also _ and +) zoom
around the middle of the map. ? opens a list of every shortcut, and Help
links to it on a computer. Keys are ignored while typing, with Ctrl or
Cmd held, or behind an open window.
2026-11-03 10:08:29 +00:00
Frederic Jung
1c498734b4
Merge branch 'pr264' into HEAD 2026-11-03 09:56:14 +00:00
Frederic Jung
3048c18b14
Fit the left tabs on small screens; move routing settings into a modal
The left panel's four tabs overflowed its 272px width on tablets and small
laptops: Goals wrapped its count, Networks ran off the edge. Counts now sit
on the tab's corner, labels stay on one line and shrink last.

Backbone, Auto-TE and DDoS settings sat below every notification in the NOC
tab. A Routing & DDoS button at the top opens them in a modal that redraws
in place after each action, with a red dot when Auto-TE is paused.
2026-11-03 10:20:57 +01:00
Charlie Allom
a47fc0735f
Show the cache hop in traceroute only when a cache is the exit
The hop for an embedded cache sat in a bare else, so every trace that
left over transit, an exchange or a PNI without a peer's cone printed
an "embedded cache in your rack" hop, even with no cache box at all.
2026-11-03 08:32:00 +00:00
Frederic Jung
4a66bbf998
Best Effort: PNIs are up at once, no attack warnings without attacks
A pnis rule (wait or instant): in Best Effort pniLead() is 0, new PNIs are
on the moment they are ordered and augments and LAG members are applied at
once (pniUpDone(), split out of pniDay()). Gaming customers' attack warning
shows only where DDoS can happen.
2026-11-03 08:19:10 +00: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
de4a750cdd Let the intern light new fiber with the biggest optic (#262)
The optics order gets an Optics setting: most Gbps per dollar (the old
behaviour, still the default) or the biggest optic on new fiber, the most
Gbps per channel that fits the budget. It is still an intern: once a fiber
is lit it keeps adding what is in there and never swaps optics or line
systems. X.can() takes a quiet flag so asking about an unaffordable optic
is not logged as the budget running out.
2026-11-03 09:11:08 +01:00
Frederic Jung
3e57b41e13 Keep route-server networks on the route server (#265)
With an Open policy and the route server on, the peering desk still picked
networks the route server already reached and stored them as bilateral
sessions. It now skips a request from a network ixSessions() already has,
after drawing its random numbers, so the desk's draws stay as they were.

The changed peer list still moves seeded games a little: the Mid-Atlantic
scenario's floor goes from day 40 to 30 (main wins on days 34-58 across
seeds), and the past week 2026-W44 is regenerated as rev 3.
2026-11-03 09:03:33 +01:00
Wolfgang Nagele
a72cb7d760 MCP server: typed, checked actions with outcomes and dry-run prices; schema, catalog, state, results and ui tools 2026-11-02 21:10:35 -05:00
Frederic Jung
da1a4e2f3c
Give POPs built by links, fiber, cables and seats the standard routers (#261)
Only Build POP applied the standard. A wave, dark fiber, own subsea cable
or consortium seat to a new city now applies it too, and their offers
quote newPopCost() (the site plus the standard's routers).
2026-11-02 21:45:30 +01:00
Frederic Jung
1a4a62d0f2
Show the standard POP's routers in the price of a new POP (#261)
The Build POP button quoted only the site, though popStdApply then paid
for the standard routers on top. popStdQuote() prices the standard the
way it is paid; the button, a note under it and the intern's one-tap
template now include it, and the toast says what the routers cost.
2026-11-02 21:40:14 +01:00
Frederic Jung
295908f859
Cache boxes sized by the city's own traffic split: Russia, China and Korea use their network lists, no box without local traffic (closes #260) 2026-11-02 07:36:17 +01:00
Frederic Jung
add3d67e48
Merge perf/6-routing-design: routing keeps its structural tables and runs as small functions, about half the CPU, identical results (347 fuzzed games)
# Conflicts:
#	CHANGELOG.md
2026-11-01 21:57:08 +01:00
Frederic Jung
640b65ce9a
Differential random games: main's page and this checkout's play the same seeded game move for move
scripts/route-fuzz.js plays many random games (every mode: presets, sandbox, scenarios,
the weekly, puzzles, architect runs, or a save) on two pages in one process and compares
all of R, R.fl, R.ef, the PNI lists and S after every move and every day, and routing with
the kept tables against routing without them. tests/route-fuzz.test.js plays four.
2026-11-01 21:44:30 +01:00
Frederic Jung
8b0c624b21
Merge remote-tracking branch 'origin/main' into perf/6-routing-design 2026-11-01 19:42:12 +01:00
Frederic Jung
204af83bff
Merge origin/main 2026-11-01 19:27:10 +01:00
Frederic Jung
0dad03727f
Merge #254: a plug-in optic too short for a subsea cable is no longer sent to upgrades that cannot stretch it (closes #253)
# Conflicts:
#	CHANGELOG.md
2026-11-01 19:27:10 +01:00
Frederic Jung
d93d598d01
Tests count calendar months, not 30 days (#257) 2026-11-01 19:27:01 +01:00
Frederic Jung
37def9dd6b
The game as a local MCP server: play, inspect and debug it from an AI client
scripts/mcp.js speaks MCP over stdio and loads the game from src/ in jsdom,
seeded, like the tests. Tools: new_game, load_save, export_save, status,
advance (with per-day timings), network, city, find, traceroute,
peering_check, hot_spots, actions, act, screen, panel, click, open_link.
Actions go through ACT as buttons do; files, slots, settings and the clock
stay out of reach, and nothing evaluates code in the page. Nothing is
hosted and the page is unchanged. See docs/MCP.md.
2026-11-01 18:04:22 +00:00
Frederic Jung
85e62f6392
Routing adds up per-kind traffic in typed arrays and keeps its group array's storage: half the allocation per compute
R.egT and R.netEg were summed by key in push(), which boxes every new value; they are now Float64Array sums written
back after routing, in the same order and key order. The first group G was emptied with length=0 for every flow,
which gives back its storage so the next push allocates it again; it is now G[0..GN). 27.5 MB -> 13.5 MB per compute.
2026-11-01 19:04:17 +01:00
Frederic Jung
a428ed817f
Routing keeps its structural tables between calls and runs its hot loops as small functions, identical results
compute() was one 33 KB function that V8 never kept optimised: it ran in baseline code, boxing every number,
and was recompiled in the background (about a second of compile each time on a loaded machine) only to deopt.
Its stages now run as closures of their own (compute's own bytecode: 7.7 KB) and the money is computeMoney().
The shortest paths and the exit lists (okBy, reach, BRJ/LIST, DSEL) are kept between calls under keys built
from everything they depend on (29-route-cache.js). Exits and paths have one object shape each.
The equivalence tests compare cached against uncached routing; tests/route-cache.test.js checks the keys.
2026-11-01 19:04:17 +01:00
Frederic Jung
3501a642a2
A real calendar: months of 28 to 31 days and leap years; monthly prices, loans, the intern budget and conferences follow it (#257) 2026-11-01 19:02:06 +01:00
Frederic Jung
25a43e22df
A 1.6T transponder takes two ports on 800G routers, one per 800G client (#256) 2026-11-01 19:02:06 +01:00
Frederic Jung
935c08839f
Clicks that change nothing routing reads keep their routing (loans do reroute); CHANGELOG corrected 2026-11-01 18:36:52 +01:00
Frederic Jung
de9b56befe
Puzzle speed test: time the fastest of 7 evaluations, so a busy CI runner cannot fail it 2026-11-01 18:09:52 +01:00
Frederic Jung
fde4279633
M3: the day's rule checks now live in its two halves, dayPre() and dayPost() 2026-11-01 16:39:35 +01:00
Frederic Jung
18db953818
Merge remote-tracking branch 'origin/main' into perf/3-worker
# Conflicts:
#	src/game/80-simulation/30-compute.js
2026-11-01 16:14:07 +01:00
Frederic Jung
b6c2fe677b
Speed test: switch off the routing shortcuts in their new spelling (flows are columns now) 2026-11-01 15:34:42 +01:00
Frederic Jung
9bdc2b70e1
Prototype: route each game day in a Web Worker built from the page's own script
The day is split around its routing (dayPre, compute, dayPost). In play, S goes to a
worker started from a Blob URL of the page's inline game script (nothing fetched), the
day waits for R and finishes when it arrives. Actions, failures, events and the intern
still route synchronously; an action mid-day wins over the worker's stale answer.
R crosses as plain data: R.ef as its raw arrays (transferred), flows as columns.
Tests and any worker failure keep the synchronous path.
2026-11-01 15:04:45 +01:00
Frederic Jung
89fc8b8d03
Routing loop: keep flows in typed-array columns instead of objects, and add up link and transit totals without boxing numbers
Flows are packed into Float64Array/Int32Array columns; R.fl builds the old
objects only when read. Edge egress sums keep a slot per egress in a plain
array, and R.tNet is added up in a typed array and written out at the end,
in the same key order. Results are identical to main.
2026-11-01 14:27:45 +01:00
Frederic Jung
fda5607238
Doitsche Telekomm and Tangerine Telecom are Tier 1s (#194)
Both are typed t1 and count for the Tier 1 goal in new games only (t1v 4);
older saves keep the Tier 1s they were playing for. Doitsche sells transit
at 12/Gbps, the dearest in Europe outside the China crossing, and keeps its
paid peering and 1G PNIs. Tangerine keeps its selective policy, sells at 6,
and gains a Frankfurt PoP like every other Tier 1.

W2 now counts Tier 1 incumbents with home markets; the N3 exceptions for
both are gone, since Tier 1s are not checked there.
2026-11-01 12:23:33 +00:00
thesysadmindev
54f40221d5
Merge branch 'main' into sea-optic-hint 2026-11-01 23:11:36 +11:00
Frederic Jung
19b546f5ab
Damaged saves are retried by the next version and have a Try again button; imports up to 64 MB 2026-11-01 13:08:43 +01:00
Christopher Hawker
0bf27a66c7 A plug-in optic too short for a subsea cable is no longer sent to upgrades that cannot stretch it (closes #253)
On an own subsea cable, the hint under an optic that cannot reach the route
said "Consider submarine terminals or optical engineering" for every optic.
Those upgrades only lengthen the Sienna WaveMagic 1.6T and 3.2T transponder
modes (optModes()); the 400ZR+ and 800ZR+ plug-ins gain nothing, also with
both upgrades in service. Perth to Cape Town (8,891 km) showed it: 800ZR+
reaches 5,400 km and the advice was to buy $17M of upgrades that change
nothing.

chWhy() now asks whether the optic would reach with both upgrades in service
(withSubUps()). If so, the advice stays. If not, the hint says the upgrades do
not stretch this optic and names the optics that do reach the route. A
consortium seat and a leased line keep their own message.
2026-11-01 23:03:47 +11:00
Frederic Jung
66aaaec5f1
A waiting subsea cut offers a charter only when it beats waiting for the club's first ship home 2026-11-01 11:52: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
1fa5566d66
Connections overview prices 400G cache boxes right; tests pin 100G boxes where they mean them 2026-11-01 12:06:20 +01:00
Frederic Jung
7202441716
400G cache boxes behind 400G or faster router ports 2026-11-01 11:37:34 +01:00