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.
This commit is contained in:
Frederic Jung 2026-11-04 14:46:34 +01:00
parent 0d72311911
commit 7295064167
No known key found for this signature in database
9 changed files with 33 additions and 7 deletions

View file

@ -6,6 +6,7 @@ All notable changes to this project are documented here. The project follows
## [Unreleased]
- In Architect runs, a diverse second tube now takes the cheapest other route, as a new tube does, so the Euro Run's plain plan fits its budget again. A failed review also says that every site still connected after a cut needs room for its traffic, not only the mission-critical ones (#282).
- A new button next to the speed controls opens a NOC screen in a window of its own, to keep on a second display beside the map. It is a dark wallboard with a live world map of your links and POPs, traffic and money graphs, alarms, and your hottest ports with their upgrade buttons, which work on the running game; click a POP to see its ports. Details has the full dashboard, and Full screen fills the display. The new window only shows and sends clicks: your network is still played and saved in the game window. Phones do not show the button.
- Cities of one country on one piece of land can be joined by fiber over land, even where there is no road: Pevek to Anadyr or Moscow, Juneau to Seattle, Nuuk to Sisimiut. Inside one country, crossing from Europe into Asia (Moscow–Vladivostok, Istanbul–Ankara) is no longer priced as a crossing between continents.
- No circuit of any kind can be built between North and South Korea, and nothing leaves South Korea over land: every way out is a subsea cable.

View file

@ -37,7 +37,7 @@
"architect.coast_to_coast_joke":"Von der Data Center Alley bis ins Silicon Valley, ein Auftrag nach dem anderen.",
"architect.cut_n_of_m":"Schnitt {n} von {m}…",
"architect.cut_on_x_cuts_off_y":"Ein Schnitt auf {x} schneidet {y} ab.",
"architect.cut_on_x_no_room":"Ein Schnitt auf {x} lässt auf dem Umweg keinen Platz. Es fehlt: {y}.",
"architect.cut_on_x_no_room":"Ein Schnitt auf {x} lässt auf dem Umweg keinen Platz. Es fehlt: {y}. Jeder Standort, der nach einem Schnitt noch verbunden ist, braucht Platz für seinen ganzen Verkehr, ob geschäftskritisch oder nicht.",
"architect.dark_list":"Vorerst offline: {list}. Nicht geschäftskritisch, also ist das erlaubt.",
"architect.drag_from_your_hq":"Zieh von deinem HQ zu einer anderen Stadt, um eine Röhre zu legen",
"architect.euro_1":"Deine Server stehen in Amsterdam. Erster Kunde: Frankfurt. Schließ ihn an.",

View file

@ -35,7 +35,7 @@
"architect.coast_to_coast_joke":"Del callejón de los data centers a Silicon Valley, encargo a encargo.",
"architect.cut_n_of_m":"Corte {n} de {m}…",
"architect.cut_on_x_cuts_off_y":"Un corte en {x} deja aislado a {y}.",
"architect.cut_on_x_no_room":"Un corte en {x} no deja sitio en el desvío. Falta: {y}.",
"architect.cut_on_x_no_room":"Un corte en {x} no deja sitio en el desvío. Falta: {y}. Cada sitio que sigue conectado tras un corte necesita espacio para todo su tráfico, sea crítico o no.",
"architect.dark_list":"A oscuras por ahora: {list}. No es crítico, así que está permitido.",
"architect.drag_from_your_hq":"Arrastra desde tu sede a otra ciudad para tender un tubo",
"architect.euro_1":"Tus servidores viven en Ámsterdam. Primer cliente: Fráncfort. Conéctalo.",

View file

@ -35,7 +35,7 @@
"architect.coast_to_coast_joke":"De l’allée des data centers à la Silicon Valley, un brief à la fois.",
"architect.cut_n_of_m":"Coupure {n} sur {m}…",
"architect.cut_on_x_cuts_off_y":"Une coupure sur {x} isole {y}.",
"architect.cut_on_x_no_room":"Une coupure sur {x} ne laisse pas de place sur le détour. Manque : {y}.",
"architect.cut_on_x_no_room":"Une coupure sur {x} ne laisse pas de place sur le détour. Manque : {y}. Chaque site encore connecté après une coupure a besoin de place pour tout son trafic, critique ou non.",
"architect.dark_list":"Éteint pour l’instant : {list}. Pas critique, donc c’est permis.",
"architect.drag_from_your_hq":"Fais glisser depuis ton QG vers une autre ville pour poser un tube",
"architect.euro_1":"Tes serveurs vivent à Amsterdam. Premier client : Francfort. Connecte-le.",

View file

@ -35,7 +35,7 @@
"architect.coast_to_coast_joke":"Dal vicolo dei data center alla Silicon Valley, un incarico alla volta.",
"architect.cut_n_of_m":"Taglio {n} di {m}…",
"architect.cut_on_x_cuts_off_y":"Un taglio su {x} isola {y}.",
"architect.cut_on_x_no_room":"Un taglio su {x} non lascia spazio sulla deviazione. Manca: {y}.",
"architect.cut_on_x_no_room":"Un taglio su {x} non lascia spazio sulla deviazione. Manca: {y}. Ogni sito ancora collegato dopo un taglio ha bisogno di spazio per tutto il suo traffico, critico o no.",
"architect.dark_list":"Al buio per ora: {list}. Non è critico, quindi si può.",
"architect.drag_from_your_hq":"Trascina dalla tua sede a un’altra città per posare un tubo",
"architect.euro_1":"I tuoi server vivono ad Amsterdam. Primo cliente: Francoforte. Collegalo.",

View file

@ -35,7 +35,7 @@
"architect.coast_to_coast_joke":"Do beco dos data centers ao Vale do Silício, um pedido de cada vez.",
"architect.cut_n_of_m":"Corte {n} de {m}…",
"architect.cut_on_x_cuts_off_y":"Um corte em {x} isola {y}.",
"architect.cut_on_x_no_room":"Um corte em {x} não deixa espaço no desvio. Falta: {y}.",
"architect.cut_on_x_no_room":"Um corte em {x} não deixa espaço no desvio. Falta: {y}. Cada local ainda ligado depois de um corte precisa de espaço para todo o seu tráfego, seja crítico ou não.",
"architect.dark_list":"No escuro por enquanto: {list}. Não é crítico, então pode.",
"architect.drag_from_your_hq":"Arraste da sua sede até outra cidade para lançar um tubo",
"architect.euro_1":"Seus servidores moram em Amsterdã. Primeiro cliente: Frankfurt. Conecte.",

View file

@ -31,7 +31,8 @@ Object.assign(ACT,{
closeModal();sfx('build');haptic(12);floater((CITY[a].x+CITY[a].x+wrapDx(CITY[a].x,CITY[b].x))/2,(CITY[a].y+CITY[b].y)/2-20,S.ar?tr('architect.tube_laid'):tr('links.wave_lit',{wave:LT[tier].n}),'#FF4F9A');UI.sel=null;pzAfter();},
// Another link next to this one: the picker opens on the same pair, on the same route, in the same trench or a diverse one.
pzAddPar:({id,div})=>{const l=pzOn()&&S.links.find(x=>x.id===id);if(!l)return;UI.pzVia=l.cable||'land';UI.pzDiv=!!+div;UI.pzTrench=l.cable?null:pzUnit(l);
if(+div&&l.cable){const o=pzRoutes(l.a,l.b).find(x=>x.via!==l.cable&&!(S.pz.noSub&&x.sub));if(o)UI.pzVia=o.via;}
// A diverse tube takes the cheapest other route at this tube's size, as a new tube does, not the first one listed (#282).
if(+div&&l.cable){const o=pzRoutes(l.a,l.b).filter(x=>x.via!==l.cable&&!(S.pz.noSub&&x.sub)).sort((x,y)=>pzLinkCost(x,l.tier,true)-pzLinkCost(y,l.tier,true))[0];if(o)UI.pzVia=o.via;}
pzLinkModal(l.a,l.b,true);},
pzTier:({id,tier})=>{tier=+tier;const l=pzOn()&&S.links.find(x=>x.id===id);if(!l||!(S.ar?AR_TIERS:PZ_TIERS).includes(tier)||l.tier===tier)return;const why=pzWaveWhy(l.a,l.b,tier,{km:l.km,sub:l.sub});if(why){toast(esc(why),'bad');sfx('err');return;}
pzSnap();if(S.ar){if(arAge(l)<S.ar.bi)S.ar.sunk+=arLinkCost(l);l.ub=S.ar.bi;}l.tier=tier;l.mo=pzMo({km:l.km,sub:l.sub,f:l.mult||1},tier,false);sfx('build');pzAfter();},

View file

@ -36,7 +36,7 @@
"architect.coast_to_coast_joke":"From data center alley to Silicon Valley, one brief at a time.",
"architect.cut_n_of_m":"Cut {n} of {m}…",
"architect.cut_on_x_cuts_off_y":"A cut on {x} cuts off {y}.",
"architect.cut_on_x_no_room":"A cut on {x} leaves no room on the detour. Short: {y}.",
"architect.cut_on_x_no_room":"A cut on {x} leaves no room on the detour. Short: {y}. Every site still connected after a cut needs room for all its traffic, mission-critical or not.",
"architect.dark_list":"Dark for now: {list}. Not mission-critical, so that's allowed.",
"architect.drag_from_your_hq":"Drag from your HQ to another city to lay a tube",
"architect.euro_1":"Your servers live in Amsterdam. First customer: Frankfurt. Connect it.",

View file

@ -180,3 +180,27 @@ test('#231 the puzzle list counts each section\'s own stars: runs above, packs n
assert.match(box, new RegExp(`Stars from the packs⭐ 2 / ${3 * ev('PZ.length')}`), box);
assert.deepEqual(errors, []);
});
test('#282 Euro Run on the game\'s own defaults: new tubes and diverse tubes take the cheapest route, so the plain plan earns three stars', () => {
const { ev, errors } = load();
// Each new tube takes the route the window offers; each second tube comes from the tube's own "diverse" button.
const neu = (a, b) => ev(`ACT.pzLinkTo({a:'${a}',b:'${b}'});ACT.pzLink({tier:AR_TIER});closeModal()`);
const div = (a, b) => ev(`(()=>{const l=S.links.find(x=>edgeKey(x)===edgeKey({a:'${a}',b:'${b}'}));ACT.pzAddPar({id:l.id,div:1});ACT.pzLink({tier:AR_TIER});closeModal()})()`);
ev("ACT.pzArStart({id:'euro'})");
const briefs = [() => neu('ams', 'fra'), () => { neu('ams', 'par'); neu('ams', 'lon'); }, () => neu('par', 'fra'), () => { neu('ams', 'zrh'); neu('par', 'zrh'); },
() => { neu('lon', 'par'); div('ams', 'lon'); }, () => { ev("ACT.pzRmPop({city:'fra'})"); neu('ams', 'dus'); div('ams', 'dus'); }];
briefs.forEach((f, i) => {
f();
assert.equal(review(ev), true, `brief ${i + 1}: ${ev('arEval().why')}`);
if (i === 4) {
const cost = (v) => ev(`pzLinkCost(pzRoutes('ams','lon').find(x=>x.via==='${v}'),AR_TIER,true)`);
const used = ev("S.links.filter(l=>edgeKey(l)===edgeKey({a:'ams',b:'lon'})).map(l=>l.cable).sort().join()");
const other = used.split(',').find((v) => v !== 'nshuttle');
for (const v of ['uly', 'circe', 'concerto']) assert.ok(cost(other) <= cost(v), `the diverse London tube is the cheapest other cable, not ${other}`);
}
if (i < briefs.length - 1) ev('ACT.pzArNext()');
});
assert.equal(ev('arOver()'), 0);
assert.equal(ev('arSpend()<=arRun().budget'), true, `within budget: ${ev('arSpend()')} of ${ev('arRun().budget')}`);
assert.deepEqual(errors, []);
});