Commit graph

492 commits

Author SHA1 Message Date
Frederic Jung
4ec3fb4a1a
Merge pull request #304 from antt0n/fix/map-stale-floaters
fix(map): drop the last network's floaters when another one starts
2026-11-06 06:37:25 +01:00
Frederic Jung
7f3b742451
Own subsea cables land on the city's dot, nudged cities too (#305)
An own cable's map line came straight from its surveyed lon/lat path, so it
ended at the city's exact coordinates, while the city itself is drawn with its
display nudge (CITY_NUDGE). Fujairah's [1,2] left every own cable there 2 px
above the dot; Dubai, Karachi, Barcelona and Osaka are off by more. The ends of
the map line now sit on the drawn city, as commercial cables already do; the
saved path and its length are unchanged.
2026-11-06 01:50:40 +00:00
Antoine
fca11b39d2
fix(map): drop the last network's floaters when another one starts
Floaters ("New POP!", payday money) live in FLOATS and fade on the map's
animation clock, which only runs while the game does. A new network
whose clock stands still (the agent's clock on the development page)
kept the previous network's floaters frozen over its map until a reload:
hundreds of them after a payday on a big network at 8x.

Each floater now records the network that raised it, and the map drops
any that belong to another one (new game, another slot, import, puzzle,
title screen). Same code for the 2D and WebGL maps.
2026-11-05 21:40:13 +01:00
Frederic Jung
908f2e0de9
Puzzles on phones that never scroll, a fairer meet-halfway, Fujairah on its coast (2.10.1) 2026-11-05 17:33:36 +01:00
Frederic Jung
107b0b825a
Puzzles on phones: fixed overlays that never scroll
A bar pinned at the top holds the puzzle's state (name, stars, money,
undo, menu), the goal being worked on with Show me, and a chip per flow
that opens its city. A city or a link opens a short card at the bottom,
split into tabs (links, router, traffic; size, traffic, routing) that
each fit on a 360 px phone, portrait or landscape. Architect runs get
the same bar. Reset moves to the menu on phones. Desktop is unchanged.
The old swipe-up sheet and its peek state are gone.
2026-11-05 17:18:50 +01:00
Frederic Jung
8c96fa5bc1
Meet halfway between the bill and the ask; Fujairah back on its coast (#293, #295)
Meeting halfway split the difference between the ask and today's market
price, which after a fall in prices sat right next to the ask. It now
splits the two prices the Deals row shows, and the button names it.
Fujairah's display nudge moved it a degree south onto Muscat; it now
sits on the UAE's east coast where its cables land.
2026-11-05 17:10:22 +01:00
Frederic Jung
eb294e9b14
WebGL map, customer contracts and a sales desk (2.10.0) 2026-11-05 11:39:40 +01:00
Frederic Jung
aef744af50
Show a cable's name and a repair button from a save as text
The city panel put the name of your own subsea cable and an incident's
repair label into its HTML as they came from the save. Both are escaped
now, and sanitize() keeps a cable's name to a string of 60 characters.
2026-11-05 11:15:05 +01:00
thesysadmindev
e62e4c7c98
Merge branch 'main' into unbuilt-pops 2026-11-05 21:01:24 +11:00
Frederic Jung
13768c61cb
Merge #281: draw the map with WebGL2 by default, 2D as fallback 2026-11-05 10:13:28 +01:00
Frederic Jung
27c4977412
A sales desk: the engineer turned salesdroid, the shark, or the CEO
From customer level 2, one person runs sales at a time, next to the NOC intern:
- The engineer turned salesdroid ($9k/mo) books you into every network operators' meeting 30 days
  ahead at the usual ticket price, brings 40% more offers (half as many again while a meeting's glow
  lasts) but never the huge deals, and their customers leave less often at renewal (half as often
  for the nerdy ones: HFT, ISPs, universities, L2). Haggles badly.
- The shark ($15k/mo) brings bigger sizes at 25% more, takes a month of each deal as commission,
  oversells half of them with a requirement the network does not meet yet, never brings technical
  customers, makes selective peering desks want 25% more traffic, wins most haggles, and their
  customers leave 50% more often.
- The CEO (free) signs the biggest internet customer the network can take on the golf course every
  50-80 days at 30% off, often with a promise nobody checked, signs about a third of the offers you
  decline anyway, and has opinions. He cannot be fired: a board meeting brings a VP of Sales a month
  later.
Customers remember who signed them (by), which the renewals read. Every roll is a hash of the day
or the deal, so games without a salesperson keep their random stream.

The differential fuzz also leaves out buttons for actions main does not have yet.
2026-11-05 09:32:24 +01:00
Frederic Jung
b9860edc77
Dark fiber leases cost half as much again (#203)
A leased pair was $400 + $1/km a month, so a single 400G wave on the
same route cost two to three times the whole fiber. It is now $600 +
$1.50/km (amplifiers as before): a lease pays off at a couple of 400G
waves, as dark fiber does. Leases already signed keep their price (l.mo).
Alien-wave rent follows, since it is priced against the fiber.

The differential route fuzz now also compares link prices, so a
deliberate price change compares this checkout with itself, as a change
to the world already does.
2026-11-05 08:19:05 +00:00
Christopher Hawker
5259e93034 Merge remote-tracking branch 'upstream/main' into unbuilt-pops
# Conflicts:
#	CHANGELOG.md
2026-11-05 18:27:21 +11:00
Christopher Hawker
0cdbef97fe A dashboard tab listing the cities with no POP yet
The dashboard shows what you have built, not what you haven't. The new tab lists every city you could still open, with its eyeballs, exchange and price, and sorts, filters by region and pages like the other long lists. Open selects the city on the map, so a build still goes through the city panel and its warnings. The tab also works in the NOC window.
2026-11-05 18:26:44 +11:00
Frederic Jung
8841fdacb9
Customers come and go: contracts, renewals at the market price, growth, haggles and leaving (#178)
Every customer now signs for a term (enterprise and hosting 1-3 years, wholesale and circuits 2-5,
fiber pairs 10-20). When it ends most renew at today's bandwidth price, happy ones often grow to
the next size, a few with competitors around ask for a discount 30 days ahead (match, meet halfway
or let go in Deals; no answer matches), and some leave: unhappy ones because of the service, others
acquired, bust, insourced, moved (they stay if you have a POP there), multihomed, project ended,
a cheaper bid, or now and then one of the odder reasons (never more than one every 60 days).

The bandwidth market is flat for six months, then about 10% cheaper a year, slowed by dearer
hardware, moving in a slow three-year cycle and pushed up during a shortage. New offers and
renewals are priced in it; one renewal moves a price at most 25% down or 10% up.

Nothing happens in a first term. Rolls are hashes of the customer and its term, never Math.random,
so seeded games keep their stream. Old saves get renewals spread over the next year. Happy
customers of a year or more send a referral about every six weeks. The dashboard's Customers tab
shows customers won and lost each month and why, renewals due and the market; customer rows show
the contract end.

The differential fuzz now leaves out state fields only this checkout has, so a new feature's state
does not fail the comparison with main while everything both games share must still match.
2026-11-05 08:15:53 +01:00
Frederic Jung
b8d313b029
Alien waves priced against their fiber; crews halve a build at most (#203)
An alien wave rented for about as much as leasing the whole fiber, so a
route sold out to its market earned 11 to 35 times its lease and the
gear paid back in one to three months. A wave now rents for 30% of the
fiber's monthly cost (lease plus amplifiers), and each one sold between
the same two cities goes cheaper, down to 40% of the first: a full
route earns 2 to 6 times its lease. Signed contracts keep their price.
Gameplay rule F6.

Extra crews could bring any land build to the next day. They now cut it
to half its planned time at most, and the button says when it would be
done. Gameplay rule F7.

A typed order (the agent API) could end a wave, dark fiber or cable in a
city the map does not show, and opened a POP there.
2026-11-05 06:50:25 +00:00
Frederic Jung
45ffdba8ae
Sweden beyond Stockholm: Gothenburg, Malmö and Haparanda (closes #206)
Gothenburg between Oslo and Copenhagen on Netnod's exchange, Malmö across the Øresund on SONIX, and Haparanda where GlobalConnect's fibre crosses the land border to Finland. A Nordic fibre carrier sells transit along that route; Tele2, Telenor and Arelion reach the new cities.
2026-11-05 07:31:17 +01:00
Frederic Jung
72f4bb54f3
Scrubbed clean traffic no longer shows as DDoS junk on links (#289)
What a scrubbing center sends back to its target is the target's own
traffic, but compute() carried it under the junk bucket, so a small
flood at a big customer showed up as hundreds of gigabits of DDoS junk
on the backbone. It now has its own bucket, shown as scrubbed clean
traffic in the link panel.
2026-11-05 02:09:52 +00:00
Antoine
8c2000f6b1
CHANGELOG: one bullet per change players will see
The WebGL work had eight bullets, so with upstream's three the app's What's new (five bullets) showed only two of
ours, and four described fixes to the WebGL map itself, which no release has had: a zoom that lost the context, the
cities repainted at every step of a zoom, the coastlines' points, the garbage per frame. What a player gets from them
goes into the first bullet (smooth zooms, the coastlines, Always 2D freeing the card, a lost card coming back), which
leaves four, each with the pull request's number.
2026-11-05 00:21:38 +01:00
Antoine
b03bec267c
2D map: keep the land picture on the graphics card in Firefox on a computer
The 2D map paints its land into an offscreen picture. In Firefox that picture was a software canvas
(willReadFrequently), because Firefox on Android garbled big paths on its graphics card (#43). Firefox on a computer
had it too, and a software canvas is sent to the card again on every frame, at a cost that grows with the picture:
the whole world at mid zoom, four screens of it zoomed in.

Only Firefox on Android keeps it now (softCanvas()). Measured in Firefox 159 on Windows (RTX 4090, full screen
2560x1440), 2D map, frames per second at zoom 0.6 / 1.1 / 1.6 / 3.2:
- big-network fixture, main: 56 / 37 / 34 / 26; with this change: 64 / 49 / 51 / 78;
- the 183-POP save, main: 32 / 25 / 25 / 22; with this change: 36 / 26 / 33 / 55.
(Measured with the change injected into main's page; the land picture is the same code on this branch.)

tests/world-layer-firefox.test.js: which browsers get the software canvas, and that the land is an ordinary one
elsewhere.
2026-11-04 22:37:15 +01:00
Antoine
cdc7c6d1eb
Settings: one Diagnostic info readout for the screen, the map's drawing and its speed
Settings › Viewport info is now Diagnostic info, and the frame meter of the WebGL work joins it: one readout in a
corner instead of two, for bug reports. It shows:
- what the screen tells the game, as before (sizes, visual viewport, safe areas, standalone, the tab bar);
- what draws the map: WebGL2 and the graphics card's name, or 2D and why (Always 2D, a puzzle, no WebGL2, a
  processor pretending to be a card, a lost context, a card out of memory: glKill() keeps the reason);
- how fast: frames per second, the 95th percentile and slowest frame, draw()'s mean time, the speed and zoom, and on
  the card its segments and packets.
?vp and ?fps open it, ?novp and ?nofps close it, five taps on the date toggle it, and a device that had the frame
meter on keeps it. Its text stays technical and in English: it is pasted into reports. On a 360 px phone it wraps
inside the screen and never takes a tap. The setting's name and description are translated.

tests/diagnostic-info.test.js: the setting, the readout's parts, each reason for 2D, the frame figures, the address
flags and the old setting, the taps, and the phone layout.
2026-11-04 22:37:15 +01:00
Antoine
87b153db6f
WebGL map: keep the pictures' keys, the waves and the clouds out of the garbage
A frame joined a key for every city, label, quiet dot and stamp it drew, built a closure
to paint each even when the picture was already there, concatenated a prefix onto every
key, made an array per city per copy of the map for its place on screen, and rebuilt
the waves' and the clouds' arrays. Keys are now kept per city (packed into one number for
the yes/no parts), per label text and look, per stamp and scale, and joined again only
when the picture changes; pictures already painted are found before any closure is
made; the card's and the 2D map's pictures are two maps, so keys need no prefix; the
cities' places and the POP lights are computed in place; the waves and the clouds are
written into arrays kept from frame to frame.

Sampled heap profile, TTL save, RTX 4060 Ti: allocations under drawFrame 68 -> 37 MB/s
at x1 and 62 -> 43 MB/s during a pan/zoom sweep; under glBegin 5.4 -> 0.5 MB/s.
2026-11-04 22:37:14 +01:00
Antoine
3482142ae5
WebGL map: simplify the coastlines for the zoom
On the card the land was most of a frame's work (the stencil fills twice, the sand, the
edge), and it scales with vertices, not pixels. The land is now built per zoom level
(powers of 2) with each coastline simplified (Douglas-Peucker) so that no point moves
more than 0.25 px at the level's zoom; zooming in takes the finer level at once, zooming
out keeps it until the zoom is 10 % under it. COAST, onLand() and the 2D map are
unchanged.
2026-11-04 22:37:14 +01:00
Antoine
eeeccc60d4
WebGL map: keep the cities' pictures while the zoom moves, paint them sharp once it rests
The scale of a city's picture is in steps of 1/24, so a pinch repainted every city every
~4 % of zoom: hundreds of pictures a frame, and the atlas full and reset over and over.
On the card, while the zoom moves, pictures that grow with it (cities, ships, badges) keep
the step of the scale held when it began, stretched by up to 1.25x either way by the
card's filtering, and take a new one beyond that; 250 ms after the zoom stops they are
painted at their own step again, and a still map is drawn once more for it. The 2D map
paints every step as before.
2026-11-04 22:37:13 +01:00
Antoine
2ff634a0ed
WebGL map: paint the card's pictures on one canvas, so a long zoom keeps the context
Every sprite kept its own <canvas> once it was in the atlas: a long pan and zoom made
~20,000 of them, then a frame of one to two seconds, then CONTEXT_LOST and a silent
fallback to 2D (4 sweeps out of 5). The card's pictures are now painted on one reused
canvas and sent to the atlas at once (texSubImage2D with a sub-rectangle); a full atlas
restarts and takes the picture at once. The 2D map, and a picture too big for the atlas,
keep a canvas each. The card's and the 2D map's pictures are kept apart, and giving the
card up drops its pictures.
2026-11-04 22:37:13 +01:00
Antoine
39941c257e
WebGL map: keep the 2D map where WebGL is drawn by the processor
With the perf benchmark now waiting for the surface the map was drawn on,
headless Chromium showed what WebGL costs without a graphics card: its
SwiftShader renderer spends about 8 µs per instance, so the coastlines alone
(29k segments, twice) took about 480 ms and a big map 1.4 s a frame, where the
2D canvas takes 46 ms. Players get the same with a blocked driver, a virtual
machine or Mesa's llvmpipe. glInit() now reads the renderer first and keeps
the 2D map on SwiftShader, llvmpipe, softpipe, lavapipe, WARP or any
"software" renderer; GLX.soft lets the GPU benchmark measure them anyway.
2026-11-04 22:37:13 +01:00
Antoine
8491b1a8f6
WebGL map: keep every sprite, the attack ring, an empty title map and a 2D fallback
- A sprite or disc drawn as the queue grows was written into the old array and
  lost: the record is now taken before the array is read.
- A city's picture without an attack shared its cache key with step 0 of a
  DDoS ring (always, with animations off): no attack is now phase -1, and
  cityStatic() reads only what the key holds.
- Back at the title (or on a damaged save), drawFrame() returned before hiding
  the card's layers, so the last network stayed behind the title: the layers
  are now shown or hidden on entry.
- An error from the card (frame start, tube upload, atlas, sprite flush) now
  gives WebGL up and draws the same frame in 2D, once; the 2D context, the
  sprite queue and GLS.frame are reset whatever fails. Other errors still
  reach tickErr() and leave WebGL on.
- Selecting a tube no longer rebuilds and uploads every tube, packet and
  point (about 230 KB on the big-network fixture): its halo is its own small
  buffer.
2026-11-04 22:37:12 +01:00
Antoine
cf9ab5e774
Draw the map with WebGL2 by default, with the 2D canvas as fallback
- Sea, land, waves, clouds, cables, tubes and packets are drawn by the
  graphics card; the land is geometry built once, so panning and zooming
  repaint nothing.
- Cities, labels and markers are painted once into a sprite atlas and drawn
  in one call (with drawImage in 2D, which speeds up the 2D map too).
- Settings > Map drawing: Auto or Always 2D, per device. Browsers without
  WebGL2, a lost context and puzzles keep the 2D map.
- npm run bench:gpu compares 2D and WebGL in a real browser on a real GPU;
  ?fps shows a frame meter.
2026-11-04 22:37:12 +01:00
Frederic Jung
29af343739
Puzzles on phones: three goals in plain words with Show me, the problem marked on the map, a sheet that starts small, and a quieter map
The stars become three goals; the current one says what is wrong and what to do. A red ring marks a city still short, a pulsing ✂ the link whose cut hurts. Cities far from the puzzle are left off the map, and idle stepping stones are nameless dots until tapped, used or zoomed in on.
2026-11-04 21:48:21 +01:00
Frederic Jung
b2dddf8f06
Follow-up to #285: Columbus III-and-a-half comes ashore near Cádiz
It never landed on the Biscay coast: its Spanish landing was Conil, on the Gulf of Cádiz,
between Lisbon and the Mediterranean. Its Miami pair keeps ending at Madrid, as on main,
so saves with a Columbus link keep it.
2026-11-04 21:40:51 +01:00
Frederic Jung
96062ed114
Merge pull request #285 from Lambro-codes/feat/bilbao-landing
feat(world): add Bilbao and land the Biscay cables there
2026-11-04 21:40:51 +01:00
Lambro-codes
bac645ed5b feat(noc): tooltips and clickable legends on the dashboard charts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 18:58:45 +01:00
Lambro-codes
e23a0e2c90 feat(world): add Bilbao and land the Biscay cables there
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 17:40:34 +01:00
Frederic Jung
5b24282224
Kinder jokes, meetings where they meet, a quiet North Korea (2.9.1) 2026-11-04 16:40:38 +01:00
Frederic Jung
6da0449ae9
Jokes target networks, never people; meetings meet where they really do; North Korea is a trickle
Every joke now follows the code of conduct: networks, cables and routers are fair game, people, countries
and beliefs are not. Renamed eight networks, three own-cable names and one AI site, and rewrote about forty
descriptions (state censorship and surveillance jabs, national stereotypes, a parody religion, innuendo, a
real person) in every language.

Event customers named after a network operators' meeting only come to a city where it meets: NANOG in the
US, APRICOT in Asia Pacific and Oceania (not mainland China, Hong Kong, the Middle East or Central Asia),
DENOG in Germany, UKNOF in the UK, RIPE in Europe, the Middle East and Africa, DKNOG in Copenhagen.

Pyongyang's broadband tops out around 0.7 Gbps, and no customer of any kind spawns in North Korea.
2026-11-04 16:36:05 +01:00
Frederic Jung
cfbe1afdcd
Atlas Shrugged Telecom is now Atlas Hold-the-Line Telecom 2026-11-04 15:51:46 +01:00
Frederic Jung
39fb61fd31
NOC in its own window, calling the bank, overland fiber where there is no road, deeper zoom, and the Euro Run fix (2.9.0) 2026-11-04 15:37:37 +01:00
Frederic Jung
7295064167
Architect: a diverse tube takes the cheapest other route, and the detour message names every site (closes #282)
The diverse button picked the first other cable listed, which on Amsterdam–London is the dearest, so the Euro Run's plain plan ended at $416k against a $410k budget.
2026-11-04 14:46:47 +01:00
Frederic Jung
0d72311911
Call the bank from AA up, and weird conditions always apply (#251)
A rating no longer gets the buttons. On top of the usual conditions every
called loan carries this week's quirk from CALL_ODD (a yacht, an odd number
of POPs, no links on a Friday, a job for the nephew...): one at AAA, two at
AA. It turns over every 7 days, so a call still rolls no dice and calling
again the same week gets the same offer.
2026-11-04 13:36:46 +00:00
Frederic Jung
8d709d7fb9
Merge pull request #283 from thesysadmindev/call-the-bank
Call the bank: ask for a loan from the Bank window
2026-11-04 13:34:30 +00:00
Frederic Jung
97e7cb17bd
Merge pull request #279 from thesysadmindev/noc-window
A NOC screen in its own window, for a second display
2026-11-04 13:31:24 +00:00
Frederic Jung
eae0b3d127
Merge pull request #284 from yeled/df-pop-checks
Typed orders get the map's limits: a link starts at a POP, and Build POP and Found IX say why they can't
2026-11-04 14:26:54 +01:00
Frederic Jung
0d8d5df472
Nothing leaves South Korea over land
Its only land border is the DMZ, so a South Korean city and any city of
another country are across the sea (isSub()), whatever landmass they share:
Seoul reaches China, Russia and Japan by subsea cable only.
2026-11-04 13:25:34 +00:00
Charlie Allom
82f3833d8f
Founding your own IX says why it can't
foundIx returned without a word in mainland China, where an exchange
already runs (incumbent or your own), and without a POP, while its dry
run quoted $80k with nothing blocked. foundIxWhy() gives the reason, most
lasting first (China reuses the panel's own text), for the toast and the
quote alike.

The route fuzz's direct moves called foundIx at every POP city. They now
offer it only where the city panel shows the button, as their comment
says, so a refusal that now logs a toast does not count as diverging
from main.
2026-11-04 23:07:57 +10:00
Charlie Allom
034a5de66e
Merge remote-tracking branch 'origin/main' into df-pop-checks
# Conflicts:
#	src/game/90-actions/60-links.js
#	src/game/90-actions/87-fiber-and-hardware.js
#	src/game/90-actions/90-action-helpers.js
2026-11-04 22:49:53 +10:00
Frederic Jung
08bf22cfec
Fiber over land inside one country; no circuits between the Koreas
Towns with no road in (Russia's Arctic and Kamchatka, Juneau and Alaska's
Arctic coast, Greenland's towns) keep their own landmass, which now says
which land it is really part of. isSub() lets two cities of one country on
that land build over land; other countries still need the sea. Inside one
country, Europe to Asia (Moscow-Vladivostok, Istanbul-Ankara) is no longer
a crossing between continents.

North and South Korea join Kyiv-Moscow in a table of pairs nobody sells a
circuit between: the link window says so, the actions refuse, and neither
the diversity map nor the latency floor counts a link there.
2026-11-04 12:46:37 +00:00
Charlie Allom
4b554f2ecb
A POP in a retired city says why it can't open
buildPop returned without a word for a city that is off the map (the small
Brazilian towns retired in 3d469d9), so the agent API reported no_effect
with no toast. It now toasts that the city is off the map and names the
nearest open city in its country to build in instead, and its dry run
reports that as blocked. An old save that kept a POP there is unchanged.
2026-11-04 22:46:10 +10:00
Charlie Allom
3fd44908af
A link starts at one of your POPs, for typed orders too
The map only drags a link from a POP, but buildLink, orderDf and orderCable
read both ends from UI.pending, which the agent API fills from its
arguments. An agent could sign a dark fiber IRU from a city with no POP
(Aracaju got three of them). The three orders now refuse that with a toast,
and their dry-run quotes report it as blocked.

Three tests ordered from a city with no POP (ACT.start ignores city, so the
only POP was Frankfurt); they now open the POP they assumed.
2026-11-04 22:45:52 +10:00
Christopher Hawker
ae70e8e750 Call the bank: ask for a loan from the Bank window
With a rating of A or better, five amount buttons in the Bank window make an
immediate offer. The terms follow from the rating alone (bank, APR, conditions
and limit in CALL_TERMS), so calling again gets nothing better and rolls no
dice. The limit is a multiple of monthly revenue less current debt. An offer
goes through the existing card and takeLoan, and a new call replaces an earlier
called offer.

Fixes #251
2026-11-04 23:40:46 +11:00
thesysadmindev
6c0342ad1f
Merge branch 'main' into noc-window 2026-11-04 23:08:54 +11:00