A build standard for the whole network, kept by the intern

One sheet sets the target state for every POP, port and fiber: router
model and count, a second building, a generator, LAG members (split over
both buildings), an exchange port wherever there is one, PNIs spread
over the cities that pay, the line system, the fastest optics that reach
and wave sizes. S.popStd keeps its name; an old {g,rt} standard loads
with the same meaning.

One read-only plan prices every job with the game's own cost helpers,
POPs busiest first, then ports, then fiber hottest first. The sheet's
summary, the MCP quote, "Bring everything up now" and the new "Keep to
the build standard" order all use it, so the quote is what the click
spends. The order works a few jobs a shift through the budget and the
cash floor: a second router before a swap on a busy POP, no generator
under a nogen covenant, no De-Kicks, a line system swap only where the
fiber is quiet or a parallel link carries it, one a shift. New POPs get
the POP part of the standard, and the template's kit no longer pays for
it twice. opsMoNow counts generators and second buildings.
This commit is contained in:
jvanvik 2026-11-07 00:41:42 +01:00
parent 647e302f1c
commit 2b48a6ad65
27 changed files with 1153 additions and 61 deletions

View file

@ -38,6 +38,8 @@ const API_DOMAINS={
opsKey:{table:'OPSK',kind:'key'},
opsPopKind:{kind:'enum',values:()=>OPS_POP.slice()},
opsTplKey:{kind:'enum',values:()=>OPS_TPL.slice()},
// The build standard's targets (bstdSet).
bstdKey:{kind:'enum',values:()=>BSTD.map(x=>x.k)},
// The specialist's offers: a seat on a consortium cable, the charter, a vendor demo.
seatPairs:{kind:'enum',values:()=>SEAT_N.slice()},
callAmount:{kind:'enum',values:()=>CALL_AMTS.slice()},

View file

@ -327,7 +327,7 @@ const API_CMD={
opsParam:{args:[['k','opsKey'],['p','string'],['v','string',false]],watch:['ops'],
doc:'Step one of a standing order\'s settings to its next value (the provider to prefer, the port size to order, the load ceiling…). With v (a position in the list the sheet shows, 0 first) it picks that value instead, such as the model to standardize routers on.'},
opsCap:{args:[['k','opsKey'],['v','string',false]],watch:['ops'],
doc:'Step the monthly budget of an order that has one: 10k, 25k, 50k, 100k, 250k, no limit. With v (a position in that list, 0 first) it picks that one.'},
doc:'Step the monthly budget of an order that has one: 10k, 50k, 250k, 1M, 5M, no limit (for caches, a cap on the rent it adds: 1k, 2.5k, 5k, 10k, 25k, no limit). With v (a position in that list, 0 first) it picks that one.'},
opsFloor:{args:[['v','string',false]],watch:['ops'],
doc:'Step the floor under your cash that the intern keeps clear when paying for jobs: 0, 50k, 250k, 1M, 5M. With v (a position in that list, 0 first) it picks that one.'},
opsPop:{args:[['k','opsPopKind'],['city','cityId']],watch:['ops'],
@ -376,11 +376,16 @@ const API_CMD={
layShip:{args:[['id','entityId']],watch:['links.#id'],
quote:a=>{const l=S.links.find(x=>x.id===a.id),q=l&&layQuote(l);return q?{setup:q.cost}:{};},
doc:'Book a second lay ship on your own cable before laying starts: it lays from the other end and halves that part of the build.'},
/* ---------- standard POPs ---------- */
/* ---------- the build standard ---------- */
popStdSet:{args:[['city','cityId']],watch:['popStd'],
doc:'Make a POP\'s routers the standard: every new POP starts with that model and that number of routers while it is still empty.'},
doc:'Make a POP\'s build the standard\'s POP part: its router model, router count, second building and generator. New POPs start with them at once; the other targets are kept.'},
popStdClear:{args:[],watch:['popStd'],
doc:'Stop setting a standard; new POPs go back to one basic router.'},
doc:'Clear the whole build standard; new POPs go back to one basic router.'},
bstdSet:{args:[['k','bstdKey'],['v','string',false]],watch:['popStd'],
doc:'Set one target of the build standard: g router model, rt routers, site2 second building, gen generator, lag LAG members on transit, IX and PNI ports, split LAGs across both buildings, ix an IX port wherever the city has an exchange, pni PNIs per network in at least that many cities, sys line system, opt fastest optics, wv waves at least that size. Without v it steps to the next value; with v (a position in the list the sheet shows, 0 first, "keep" first) it picks that one.'},
bstdApply:{args:[],watch:['pops','transit','pni','ixp','ixn','ixSite','links','spares'],
quote:a=>{const q=bstdQuote(false);return {setup:q.cost,monthly:q.mo,blocked:q.held.map(w=>w.split('|').map(c=>CITY[c].name).join('–')+': its line system waits until the fiber is quiet or a parallel link can carry its load for the day it goes dark')};},
doc:'Bring everything up to the build standard now, the busiest first, while cash lasts: routers, buildings, generators, LAG members, IX ports, PNIs, line systems, optics and waves. A line-system swap waits unless the fiber is quiet or a parallel link carries its load: such a fiber gets the best optics its line system takes, and the quote lists it under blocked. The quote is the whole bill.'},
/* ---------- utilities ---------- */
utilityRouteServers:{args:[['city','cityId',false]],watch:['rs'],
doc:'Join the route server at every IX you have a port at. One call does what the button does.'},
@ -507,6 +512,7 @@ const API_VIEW={
keys:{args:[],doc:'Open the list of keyboard shortcuts (the ? key).'},
routingOpen:{args:[],doc:'Open the Routing & DDoS window: the traceroute, backbone, Auto-TE and DDoS settings (the button at the top of the NOC tab).'},
opsOpen:{args:[],doc:'Open the Ops sheet: the NOC intern\'s mood, weekly shift report and standing orders.'},
bstdOpen:{args:[],doc:'Open the build standard sheet: every target, how many POPs, ports and links are below it, what bringing them up costs, and the intern\'s order that keeps them there.'},
salesOpen:{args:[],doc:'Open the sales desk sheet: the three kinds of salesperson, who is at the desk and what they cost.'},
opsCity:{args:[['v','cityId',false]],doc:'Show one POP\'s standing-order exceptions in the Ops sheet.'},
utilities:{args:[['city','cityId',false]],doc:'Open the utilities sheet: route servers, the redundancy kit, caches and bulk peering, for one city or the whole network.'},

View file

@ -61,7 +61,7 @@ const API_STATE_DOC={
ops:{type:'map',doc:'The NOC intern: who is hired, each standing order\'s on/off switch and settings (network work only: deals belong to the sales desk, slAuto), the monthly budget and what it spent, per-POP exceptions, the new-POP template and the weekly log.'},
core:{type:'map',doc:'Your backbone technology: lv bought, the level it runs at, the interop lab.'},
ddosAuto:{type:'map',doc:'The NOC\'s auto-mitigation switches: rtbh and scrub.'},
popStd:{type:'map',doc:'The standard POP: router model and count new POPs start with, or null for none.'},
popStd:{type:'map',doc:'The build standard, or null for none. g router model (an RG index), rt routers, then only the targets that are set: site2, gen (true), lag (2 or 4 members), split, ix (true), pni (2 or 3 cities per network), sys (roadm, cl), opt (fast), wv (an LT index). New POPs get g, rt, site2 and gen at once; the std standing order and bstdApply bring the rest up.'},
demo:{type:'map',doc:'Vendor demo units on order, by "kind:id" → ready day.'},
seatOff:{type:'map',doc:'The pending consortium-cable seat offer: landings, km, name, expiry day.'},
monkey:{type:'map',doc:'The chaos monkey: next visit day, whether it is in your network now, days left, whether anyone noticed.'},

View file

@ -15,7 +15,7 @@ function apiControls(root,player){
const o=b.dataset.act?{label:apiText(b,200).replace(/\n/g,' ')||b.getAttribute('aria-label')||b.dataset.act,act:b.dataset.act,args:apiParse(b.dataset.args),disabled:!!b.disabled}
// A list the game acts on when its value changes (the change handler in 96-map/95-clicks.js): click it with a value.
:{label:b.getAttribute('aria-label')||(b.closest('label')&&apiText(b.closest('label'),120).split('\n')[0])||b.dataset.chg,
select:b.dataset.chg,value:b.value,options:[...b.options].map(o=>({value:o.value,label:o.textContent.trim()})),disabled:!!b.disabled};
select:b.dataset.chg,args:apiParse(b.dataset.args),value:b.value,options:[...b.options].map(o=>({value:o.value,label:o.textContent.trim()})),disabled:!!b.disabled};
if(player)o.player=true;
out.push(o);}
return out;}

View file

@ -115,7 +115,8 @@ function apiClick(n,value){
if(!b)apiFail(`No button ${n} on the last screen. Call screen first.`);
if(b.disabled)apiFail(`"${b.label}" is greyed out.`);
if(b.player&&apiPlayerWin())apiFail(`"${b.label}" is in a window the player opened: it is theirs to press.`);
const name=b.select||b.act,args=b.select?{v:value===undefined?undefined:String(value)}:b.args;
// A list sends its own arguments with the value picked, as the page's change handler does (96-map/95-clicks.js).
const name=b.select||b.act,args=b.select?{...(b.args||{}),v:value===undefined?undefined:String(value)}:b.args;
if(b.select&&!b.options.some(o=>o.value===args.v))apiFail(`"${b.label}" is a list: click it with a value, one of ${b.options.map(o=>JSON.stringify(o.value)).join(', ')}.`);
const kind=apiAllowed(name,`"${b.label}" runs ${name}, which is not an action.`);
if(kind==='game'){const w=apiWaiting(name);if(w)return {clicked:b.label,...w};}