From 66ac7d0af14265ab6479f4afb148ee556c21ee32 Mon Sep 17 00:00:00 2001 From: jvanvik Date: Thu, 12 Nov 2026 02:25:24 +0100 Subject: [PATCH] Island Wi-Fi, Starblink and late joiners work together Checked after merging the three, and pinned with a test (tests/late-joiners.test.js): a late network with a Starblink zone and a lit spur pays its islanders' income in full but has only its homes matched; investors on a revenue share take their cut of homes, islands and an IPv4 lease, never of the match; a spur cut and a solar storm need a lit spur or a LEO circuit, not a number of days, and come on the network's own outage schedule (S.nextFail, counted from S.day0), so no grace needed moving; a reload keeps the game. - CHANGELOG: Island Wi-Fi names zones as the game does (Abaco and Eleuthera) and says a spur has upkeep but no rent. - Agent: a stray "., " in the pops doc where the Starblink and Island Wi-Fi lines met. - Plans: open question 6 (WISP zones and a rented LEO tier) marked answered and built. --- CHANGELOG.md | 2 +- docs/plans/next-session.md | 7 ++++--- src/agent/30-docs.js | 2 +- tests/late-joiners.test.js | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5054495..01ba670 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] - Investors on a revenue share now take their cut of your IPv4 lease income too, as they already did of fiber pairs you lease out (#150). Selling a block is still a one-off that is all yours, like the up-front price of a fiber pair, and the NOC dashboard's Investor revenue share row now includes the leases. -- Island Wi-Fi: bring the internet to 18 groups of outer islands, over satellite capacity first and your own spur cable later (#83). Each group looks to an island city, like Vanua Levu to Suva or the Out Islands to Nassau: open a POP there and its Customers tab lists them. Rent capacity at the city's teleport and about a third of the islanders sign up over GEO, three quarters over MEO and nine in ten over Starblink from a gateway there; from level 3 a spur cable from the city lets everyone sign up and needs no rent. Islanders pay island prices, their homes are IPv6-only from day one, and their traffic rides the city's routers and links. A spur can be cut and the repair ship takes weeks: a satellite circuit kept beside it carries the islands meanwhile. Investors on a revenue share take their cut of what the islands pay. +- Island Wi-Fi: bring the internet to 18 groups of outer islands, over satellite capacity first and your own spur cable later (#83). Each group looks to an island city, like Vanua Levu to Suva or Abaco and Eleuthera to Nassau: open a POP there and its Customers tab lists them. Rent capacity at the city's teleport and about a third of the islanders sign up over GEO, three quarters over MEO and nine in ten over Starblink from a gateway there; from level 3 a spur cable from the city lets everyone sign up, with upkeep but no rent. Islanders pay island prices, their homes are IPv6-only from day one, and their traffic rides the city's routers and links. A spur can be cut and the repair ship takes weeks: a satellite circuit kept beside it carries the islands meanwhile. Investors on a revenue share take their cut of what the islands pay. - Rent low-orbit satellite capacity from Starblink from level 5: islands near your fiber get circuits at about 30 ms round trip (#83). Host a Starblink gateway at a teleport on your fiber, then rent 5 to 50 Gbps to small islands and remote towns within 1,200 km of it. Users hardly notice the lag, and selective networks peer over it as over a cable; next to a cable it waits on standby, and a GEO or MEO circuit to the same island waits on standby beside it. Every island behind a gateway leans on that POP's routers and fiber, which its teleport section now shows, and a rare solar storm puts the circuits in safe mode for a day or two. Once your own constellation carries traffic, Starblink sells you nothing new. - A POP you mark as a micro POP, medium POP or regional hub now keeps that kind's routers when you also have a build standard (#315). Its router model and count come from its kind: "Bring everything up now" and your intern no longer swap its routers or add more to meet the build standard, while the standard's other targets still apply there. The POP's router section says so. - Send to another device now gives a multiplayer network its session link, on copies of the game you host yourself (#263). The link carries on with the network in the session on the other device, and pasting it under From another device opens it there too; the save file stays a copy that plays on alone. diff --git a/docs/plans/next-session.md b/docs/plans/next-session.md index d9d5546..40965b9 100644 --- a/docs/plans/next-session.md +++ b/docs/plans/next-session.md @@ -97,9 +97,10 @@ Asked on 2026-11-09, not answered yet: settle the clash at the next merge? 5. **#58 whole-fiber splicing.** Is the express lightpath enough, or should a whole fiber pair also splice through a city (one dark fiber A–C through B, with no ROADM at B)? The issue asks for "waves and/or entire fibers". -6. **#83 WISP zones and a rented LEO tier.** Add island demand pools served remotely on top of the existing island - cities, and a tier between MEO and Pie in the Sky that rents LEO capacity from a partner network? Or are teleports - with GEO and MEO circuits enough? +6. ~~**#83 WISP zones and a rented LEO tier.**~~ *Answered 2026-11-11 ("wisp and leo please") and built: Starblink + LEO circuits from a gateway at a teleport on your fiber (level 5), and Island Wi-Fi for 18 zones of outer islands + over GEO, MEO or Starblink and a spur cable (`60-features/45-teleports.js`, `60-features/46-wisp-zones.js`, gameplay + rules O8, W6 and F12).* 7. ~~**Investors' cut of IPv4 lease income.**~~ *Answered 2026-11-11 (yes) and built: investors on a revenue share take their cut of IPv4 lease income, as of fiber pairs leased out; a sale stays all the player's.* 8. **Founding an exchange on a basic router.** Founding your own exchange gives a 400G port even where the POP's router diff --git a/src/agent/30-docs.js b/src/agent/30-docs.js index a8341b2..f78bb54 100644 --- a/src/agent/30-docs.js +++ b/src/agent/30-docs.js @@ -20,7 +20,7 @@ const API_STATE_DOC={ t1v:{type:'integer',doc:'Level at which Tier 1 transit was offered.'}, auV:{type:'integer',doc:'Australia content level gate.'}, seen:{type:'array',doc:'Network ids the deals panel has already shown. Vestigial: written by newGame, read nowhere.'}, - pops:{type:'map',doc:'Your POPs by city id: day opened, broadband (bb: d, its demand in Gbps; v6, the share of its homes that are IPv6-only behind NAT64, absent for dual stack; v6e, the day a swap to IPv6-only finishes, while it runs), ad boost, downtime, routers, generator, second site, teleport (tele: 1 GEO dishes, 2 with MEO tracking antennas), a Starblink LEO gateway on it (leo: 1)., island Wi-Fi zones (wisp: by zone id, {day, d: the homes\' Gbps signed up, sat: the circuit {bird, g, mo, day, ready}, nxt: a move to another bird being commissioned, sp: the spur cable {day, ready}}).'}, + pops:{type:'map',doc:'Your POPs by city id: day opened, broadband (bb: d, its demand in Gbps; v6, the share of its homes that are IPv6-only behind NAT64, absent for dual stack; v6e, the day a swap to IPv6-only finishes, while it runs), ad boost, downtime, routers, generator, second site, teleport (tele: 1 GEO dishes, 2 with MEO tracking antennas), a Starblink LEO gateway on it (leo: 1), island Wi-Fi zones (wisp: by zone id, {day, d: the homes\' Gbps signed up, sat: the circuit {bird, g, mo, day, ready}, nxt: a move to another bird being commissioned, sp: the spur cable {day, ready}}).'}, links:{type:'array',doc:'Your links: waves, dark fiber (df), own cables, fabric circuits (vxc), express lightpaths (xp: via lists the dark fibers it rides from a, ch its optics) and rented satellite circuits (sat: bird, g Gbps, km of radio path, ready day), each with an entity id.'}, transit:{type:'array',doc:'Transit ports: city, net, tier, LAG members, port history for 95th-percentile billing.'}, ixp:{type:'map',doc:'IX ports by exchange city; tier per port (may exceed 1 with LAG members in ixn).'}, diff --git a/tests/late-joiners.test.js b/tests/late-joiners.test.js index 095d3a8..33c26bf 100644 --- a/tests/late-joiners.test.js +++ b/tests/late-joiners.test.js @@ -217,3 +217,38 @@ test('a network that began on day 0 shows none of it', (t) => { assert.deepEqual([ev('lateCard()'), ev('lateBank()')], ['', '']); assert.deepEqual(errors, []); }); + +// Island Wi-Fi and Starblink (#83) on a late network: what islanders pay is theirs to share with investors (as an IPv4 +// lease is) and is never matched; a spur cut or a solar storm is a failure like any other, drawn only once a lit spur or +// a LEO circuit is up and only on the network's own outage schedule (S.nextFail, counted from S.day0), no calendar grace. +test('a late network with island Wi-Fi and Starblink: islanders are not matched, investors share islands and IPv4 leases but not the match', (t) => { + const { ev, errors } = late(t, { home: 'suv' }); + const Z = "wispZ('vanualevu')", sp = "wispZ('tobago')"; + assert.equal(ev('S.nextFail-S.day0'), 45, 'the first outage 45 days into its own life'); + ev(`S.cash=1e8;for(const g of GOALS)S.done[g.id]=0;S.lvl=5; + ACT.launchBB({city:'suv'});S.pops.suv.bb.d=8;ACT.buyTransit({city:'suv',net:NETS.find(n=>sellsAt(n,'suv')).id,tier:1}); + ACT.teleBuild({city:'suv'});ACT.teleLeo({city:'suv'});ACT.wispSat({z:'vanualevu',bird:LEO_BIRD,g:5}); + ACT.buildPop({city:'pos'});ACT.buyTransit({city:'pos',net:NETS.find(n=>sellsAt(n,'pos')).id,tier:1});ACT.wispSpur({z:'tobago'}); + ${Z}.sat.ready=S.day;${sp}.sp.ready=S.day;${Z}.d=4;${sp}.d=2;compute()`); + assert.equal(ev('netAge()'), 0); + assert.equal(ev('leoLive()') && ev('wispSpurs().length'), 1, 'a LEO zone in the sky and a lit spur on its first day'); + // The pool a failure draws from, on its first day: both are there, with no grace of their own. + const pool = () => J(ev, "(()=>{window.__o=null;runNow(eval('('+failureRun.toString().replace('if(!opts.length)return;','__o=opts.map(o=>o[0]);return;')+')')());return __o;})()"); + assert.ok(pool().includes('leostorm') && pool().includes('wspur'), 'a storm and a cut are possible failures from day one'); + // The money: islanders pay, homes are matched, the islands are not. + const r = J(ev, 'R.rev'); + assert.ok(r.wisp > 0 && r.eyeballs > 0, `islanders and homes both pay (${r.wisp}, ${r.eyeballs})`); + assert.equal(r.late, r.eyeballs, 'the match is what homes pay, never what islanders pay'); + // Investors: their share of homes, islands and an IPv4 lease, never of the match. + ev("S.loans.push({id:'v',bank:'vult',start:S.day,amount:1,got:1,bal:0,share:0.1,covs:[]});ACT.ip4Buy({len:20});ACT.ip4Out({id:S.ip4.b.find(b=>b.k==='buy').id});compute()"); + const m = J(ev, '[R.rev,R.cost.revshare,R.revMo]'), v = m[0]; + assert.ok(v.ip4 > 0 && v.wisp > 0 && v.late > 0, `a lease, islanders and a match (${v.ip4}, ${v.wisp}, ${v.late})`); + assert.ok(Math.abs(m[1] - 0.1 * (v.eyeballs + v.business + v.ix + (v.orbit || 0) + v.ip4 + v.wisp)) < 1e-6, 'investors take 10% of homes, islands and the lease'); + assert.ok(Math.abs(m[1] - 0.1 * (m[2] - v.grant - (v.gov || 0) - v.late)) < 1e-6, 'of every revenue but grants and the match'); + // Its first outage comes on its own schedule, and the pool still holds both: a storm or a cut can be that outage. + ev("window.__fr=[];const f0=failureRun;failureRun=function*(o){__fr.push(netAge());yield* f0(o);};S.nextEvent=1e9;__reseed(5)"); + for (let i = 0; i < 46; i++) ev('dayTick()'); + assert.equal(J(ev, '__fr')[0], 45, 'no failure before age 45'); + assert.equal(same(ev), true, 'a reload makes the same game'); + assert.deepEqual(errors, []); +});