Satellite teleports: GEO and MEO circuits for islands and remote towns (#83)

The early and mid-game satellite option, before Pie in the Sky. Build a
teleport at a POP that a satellite sees, then rent capacity from it to
a remote POP: GEO (Intelsplat, Kacophony) needs no capex but costs a lot
a month per Gbps, 1-10 Gbps at about 600 ms; MEO (O3bservant) needs
tracking antennas at the teleport and gives multi-Gbps at about 130 ms
where both ends are under its ring, at least 5 degrees up. Coverage
follows each bird's footprint by ocean region. Latency feeds the latency
model: users who ride a satellite notice, in proportion to the share.

A circuit beside a cable goes on standby, whichever came first, and
carries only what the cable cannot: the classic single-cable island
backup. Satellites are not subsea links for covenants, scenario goals or
subsidies (Pitcairn's UK grant needs a cable). Express fiber and the
build standard leave satellite circuits alone.
This commit is contained in:
jvanvik 2026-11-07 01:12:23 +01:00
parent 8e1f2d66a5
commit e1ae8e0164
46 changed files with 1176 additions and 55 deletions

View file

@ -22,6 +22,8 @@ const API_DOMAINS={
vxcTier:{table:'VXC',kind:'index'},
routerModel:{table:'RG',kind:'index'},
scrubTier:{table:'SCRUB_TIERS',kind:'index'},
satBird:{table:'SATS',kind:'key'},
satG:{kind:'enum',values:()=>[...new Set(Object.values(SAT_ORB).flatMap(o=>o.g))].sort((a,b)=>a-b)},
// Small fixed vocabularies the game itself checks by list membership.
// The link metric presets, plus "custom" for a hand-tuned number (ACT.setMetric).
metric:{kind:'enum',values:()=>[...Object.keys(MET),'custom']},

View file

@ -123,7 +123,7 @@ const API_CMD={
quote:a=>{const A=a.a,B=a.b,tier=a.tier;
if(!S.pops[A])return {blocked:[linkFromWhy(A)]};
if(!waveOk(A,B,tier))return {blocked:[tr('links.a_wave_wave_needs_need_at',{wave:LT[tier].n,need:waveNeed(tier)})]};
const sib=pairLinks(A,B).filter(l=>l.kind!=='vxc'&&l.kind!=='xp'),jn=sib.length?routeJoin(A,B):null,border=cnCity(A)!==cnCity(B);
const sib=pairLinks(A,B).filter(l=>l.kind!=='vxc'&&l.kind!=='xp'&&l.kind!=='sat'),jn=sib.length?routeJoin(A,B):null,border=cnCity(A)!==cnCity(B);
const mult=(sib.length&&!(jn&&jn.k===(landTrenches(A,B)[0]||{}).k)?DIVERSE:1)*(border?3*((a.premiumCrossing&&(A==='hkg'||B==='hkg'))?1.6:1):1);
const wr=waveRoute(A,B,mult,border);if(!wr)return {blocked:[tr('links.no_cable_available_for_that_route')]};
const blocked=[],so=soldOut(A,B,tier,wr.cab);
@ -167,6 +167,22 @@ const API_CMD={
doc:'Egress preference for one exit: high sends more traffic that way, low keeps it for backup.'},
siteSet:{args:[['k','connKind'],['id','entityId'],['s','site']],watch:['transit.#id','pni.#id'],
doc:'Put a transit port, PNI or IX port in building A, B or both. Choosing both with a single member adds a LAG member first, and charges for it.'},
/* ---------- teleports and satellite capacity (#83) ---------- */
teleBuild:{args:[['city','cityId']],watch:['pops.#city'],
quote:a=>({setup:TPORT_COST,monthly:TPORT_MO,blocked:[teleOf(a.city)?'there is a teleport here already':teleWhy(a.city)].filter(Boolean)}),
doc:'Build a teleport (a satellite gateway) at one of your POPs: it rents circuits on GEO birds to small islands and remote towns in their footprint. Refused where no satellite on sale at your level sees the city.'},
teleTrk:{args:[['city','cityId']],watch:['pops.#city'],
quote:a=>({setup:TRK_COST,monthly:TRK_MO,blocked:[teleOf(a.city)===2?'this teleport has tracking antennas already':trkWhy(a.city)].filter(Boolean)}),
doc:'Add tracking antennas to a teleport, so it can work the MEO ring (about 130 ms round trip instead of GEO\'s 600). Only within 50 degrees of the equator, where the ring is in view.'},
teleRm:{args:[['city','cityId']],confirm:'double',watch:['pops.#city'],
doc:'Close a teleport. Refused while circuits still start there.'},
buySat:{args:[['a','cityId'],['b','cityId'],['bird','satBird'],['g','satG']],
quote:a=>{const ok=own(SATS,a.bird),mo=ok?satMo(a.bird,+a.g):0;return {setup:mo+(S.pops[a.b]||!CITY[a.b]?0:popCost(a.b)),monthly:mo,days:ok?leadDays(SAT_ORB[SATS[a.bird].orb].days):0,blocked:[satWhy(a.a,a.b,a.bird,+a.g)].filter(Boolean)};},
doc:'Rent a satellite circuit from your teleport in a to b (a small island or a remote town) on a bird that sees both: GEO 1-10 Gbps, MEO 2-20 with tracking antennas. The first month up front; builds a POP at b if there is none. Next to an existing link between the two it goes on standby, as backup; a link built later between the two puts it on standby too. Cancel with rmLink.'},
satSize:{args:[['id','entityId'],['g','satG']],watch:['links.#id'],
quote:a=>{const l=S.links.find(x=>x.id===a.id&&x.kind==='sat'),g=+a.g,ok=!!l&&g!==l.g&&SAT_ORB[SATS[l.bird].orb].g.includes(g),mo=ok?satMo(l.bird,g):0;
return {setup:ok&&g>l.g?mo:0,monthly:mo,blocked:!l?['not a satellite circuit']:ok?[]:[tr('satellites.no_such_circuit')]};},
doc:'Resize a satellite circuit on the same bird. A bigger one pays its new month up front.'},
/* ---------- dark fiber and own cable ---------- */
orderDf:{args:[['a','cityId'],['b','cityId'],['source','dfSource'],['system','systemId']],
bindsUI:['pending','dfSrc','dfSys'],bind:a=>{UI.pending={a:a.a,b:a.b};UI.dfSrc=a.source;UI.dfSys=a.system;},
@ -574,6 +590,7 @@ const API_BOUND={
teRecipe:{command:'teDeploy',arg:'script',note:'a recipe from catalog(\'TE_RECIPES\')'},
trace:{command:'traceRun',arg:'from'},
decomToggle:{command:'decomGo',arg:'cities'},
satOpen:{command:'buySat',note:'opens the satellite order sheet from a teleport (a) or for a city (b); buySat takes a, b, bird and g itself'},
openVxc:{command:'buyVxc',note:'opens the circuit picker from a fabric port ({from, prov}); buyVxc takes a, b, prov and t itself'},
connCancel:{command:'cancelTransit',note:'the connections list\'s cancel button: it arms, then dispatches cancelTransit, cancelPni, cancelIx, rmCache or rmNni'},
cnPrem:{command:'buildLink',arg:'premiumCrossing'},

View file

@ -19,8 +19,8 @@ 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), ad boost, downtime, routers, generator, second site.'},
links:{type:'array',doc:'Your links: waves, dark fiber (df), own cables, fabric circuits (vxc) and express lightpaths (xp: via lists the dark fibers it rides from a, ch its optics), each with an entity id.'},
pops:{type:'map',doc:'Your POPs by city id: day opened, broadband (bb), ad boost, downtime, routers, generator, second site, teleport (tele: 1 GEO dishes, 2 with MEO tracking antennas).'},
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).'},
rs:{type:'map',doc:'Route-server sessions by exchange city.'},
@ -130,6 +130,7 @@ const API_RESULTS_DOC={
cityEye:{type:'map',doc:'Eyeballs online per city.'},
latF:{type:'map',doc:'Fraction of each city\'s traffic that goes far (over a threshold latency).'},
latFar:{type:'map',doc:'The far exit each slow city sends traffic through.'},
satU:{type:'map',doc:'Of each city\'s served traffic, the Gbps that rode a rented satellite circuit (its users notice the orbit\'s latency on that share). Only there while you have a satellite circuit up.'},
demTo:{type:'map',doc:'Your traffic destined to each network, in Gbps. The number CDN caches ask about.'},
served:{type:'number',doc:'Total traffic served, in Gbps.'},
demand:{type:'number',doc:'Total traffic demanded, in Gbps.'},

View file

@ -26,7 +26,7 @@ function apiJson(v){
carries the keys confGo/confSponsor need, which exist in no field of S; TE_RECIPES renders
each recipe's script, because the source is a function and some read the live network. The
recipes' relevance score is not exposed: judging which one fits is the agent's job. */
const API_TABLES={ROCKETS,CRUSTS,PIE_RD,PIE_SPAT_DEF,SALES,CITIES,NETS,CABLES,XIX,PORT,LT,NNI,VXC,RG,OPT,DF_SYS,FAB,SCRUB_TIERS,BIZ_T,LEVELS,GOALS,BROKER_GOALS,SCN,BANKS,REQS,NSH,MET,PREF,RT,PPOL,CONFS,LAG_MAX,RMAX,REGEN_MAX,START_CASH,CONF_COST,CONF_SP,CAP_COST,CAP_LV,CONF_DAYS,SUB_UPGRADES,SEA_DESIGNS,TE_COST,TE_MO,MYIX_COST,CN_LIC,SITE2_COST,MYIX_FAB,INTERNS,OPSK,CHARTERS,SEAT_N,CORE_LV,CORE_COST,CORE_REQ,CORE_LAB,INTERN_MO,PZ_TIERS,AR_TIERS,PZ_RG};
const API_TABLES={ROCKETS,CRUSTS,PIE_RD,PIE_SPAT_DEF,SATS,SAT_ORB,SAT_PROV,SALES,CITIES,NETS,CABLES,XIX,PORT,LT,NNI,VXC,RG,OPT,DF_SYS,FAB,SCRUB_TIERS,BIZ_T,LEVELS,GOALS,BROKER_GOALS,SCN,BANKS,REQS,NSH,MET,PREF,RT,PPOL,CONFS,LAG_MAX,RMAX,REGEN_MAX,START_CASH,CONF_COST,CONF_SP,CAP_COST,CAP_LV,CONF_DAYS,SUB_UPGRADES,SEA_DESIGNS,TE_COST,TE_MO,MYIX_COST,CN_LIC,SITE2_COST,MYIX_FAB,INTERNS,OPSK,CHARTERS,SEAT_N,CORE_LV,CORE_COST,CORE_REQ,CORE_LAB,INTERN_MO,PZ_TIERS,AR_TIERS,PZ_RG};
const API_MADE={
BADGES:()=>!S?[]:BADGES.map(b=>{const on=S.ach&&S.ach[b.id]!==undefined,ever=!!hof()[b.id];
return b.secret&&!on&&!ever?{id:b.id,i:'❔',t:'???',d:tr('badges.a_secret_badge'),r:b.r,secret:true}:{...b,ever};}),