diff --git a/CHANGELOG.md b/CHANGELOG.md index e87a564..2b0dd5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project are documented here. The project follows ## [2.0.0] — 2026-10-29 +- Scenario tuning: every handmade scenario now asks for what its story is about, with shorter clocks where it was won in a tenth of the time. Mind the Gap, Cape to Cairo and Order and Progress count cities and IX.brrr ports only when your network joins them up; Fibre to the Basement also wants 500 Gbps served; in Anchors Away nobody sells transit in Tallinn and ships really do drag their anchors over the Baltic links, while the Great Firewall's losses no longer break your 99.5% streak; in the Cogentle Spat, Goggle wants a lot more of your traffic before it peers; Flood Season's terabit floods count when your scrubbing or Flowspec took them; Stepping Stones and Mid-Atlantic Accent start with 5M, enough to light the whole 1.6T chain. - Customers now call when your network can already serve them, not only when your level says so (#187). A fast path between two finance cities brings trading firms, lit dark fiber brings AI interconnects, two diverse paths in one country bring sovereign clouds and broadband in a big city brings cloud gaming, each at its smallest size and with a note on what they spotted; your level still makes them bigger and more frequent. - Routers, line systems and optics one level above yours can be had early as a vendor demo unit (#187). Ask the vendor, wait about two weeks, then pay 60% over list until your level catches up; and you can dig your own dark fiber from level 2 as a pioneer, at 60% more than the level 3 price. - Take a seat on a new consortium subsea cable (#173). Capacity conferences offer them, and now and then a consortium calls from level 2: pay your share of the build, wait for the ship, then own one, two or four fiber pairs and light them with your own optics, your way onto your own subsea glass before Tier 1. A cut on that cable cuts your pairs too. diff --git a/scripts/lib/scenario-ref.js b/scripts/lib/scenario-ref.js new file mode 100644 index 0000000..2733491 --- /dev/null +++ b/scripts/lib/scenario-ref.js @@ -0,0 +1,72 @@ +// The reference player for the handmade scenarios (tests/scenarios-playtest.test.js), the sibling of scenario-bot.js +// (which plays the weekly ones). It plays inside the real game, headless, through the game's own actions, one plan +// step at a time whenever the bank allows it, plus the upkeep a careful human does every week: hot waves a size up, hot +// transit and exchange ports a LAG member, new peers at every exchange, routers before they fill. +// +// A plan is a list of steps, each [op, ...args]: +// ['bb', c] POP and broadband ['tr', c, tier] the cheapest transit there ['ix', c, tier] every exchange +// ['pop', c] a POP only ['link', a, b, tier, cable] a wave (routers upgraded first, a swap a day) +// ['hire', orders, params] the NOC intern on standing orders, as soon as the level allows +// ['wait', day] until that day ['served', g] until g Gbps are served ['prep', c, g] capacity for an event +// ['scrub', c, tier] a scrubbing center ['pnis'] a PNI with every unreached network that takes one +// ['loans'] take every loan the banks offer, from now on (the cheese plans) +const REF = String.raw`(()=>{ +const Q=window.__ref={log:[]}; +const quiet=f=>{const t=window.toast;window.toast=()=>{};try{return f();}finally{window.toast=t;}}; +Q.reserve=()=>Math.max(40000,1.3*(R.costMo||0)); +Q.can=x=>S.cash>=x+Q.reserve(); +Q.cheap=c=>NETS.filter(n=>n.price&&sellsAt(n,c)&&!(Q.avoid||[]).includes(n.id)&&!S.transit.some(t=>t.city===c&&t.net===n.id)).sort((a,b)=>a.price*netMult(a,c)-b.price*netMult(b,c))[0]; +Q.pop=c=>{if(!S.pops[c])ACT.buildPop({city:c});return !!S.pops[c];}; +Q.bb=c=>{Q.pop(c);if(S.pops[c]&&!S.pops[c].bb)ACT.launchBB({city:c});return !!(S.pops[c]&&S.pops[c].bb);}; +Q.tr=(c,tier=1)=>{Q.pop(c);const n=Q.cheap(c);if(!n)return true;ACT.buyTransit({city:c,net:n.id,tier});return true;}; +Q.ix=(c,tier=1)=>{if(!S.pops[c])return false;for(const x of ixIdsIn(c)){if(!ixName(x))continue;if(S.ixp[x]===undefined)ACT.buyIx({city:x,tier,signed:true});if(S.ixp[x]===undefined)continue;if(!S.rs[x])ACT.rs({city:x});ACT.peerAll({city:x});}return true;}; +// A wave: big waves need big routers at both ends, and a router swap takes a day, so the step waits (null) until they fit. +Q.link=(a,b,tier=1,via)=>{for(const c of [a,b])Q.pop(c);if(!S.pops[a]||!S.pops[b])return false; + for(const c of [a,b])for(let k=0;k<4&&!waveOk(a,b,tier);k++){const g0=S.pops[c].rgen||0;ACT.upRouter({city:c});if((S.pops[c].rgen||0)===g0)break;} + if(!waveOk(a,b,tier))return null;const n0=S.links.length;UI.via=via||null;UI.route=null;openLinkModal(a,b);ACT.buildLink({tier});closeModal();return S.links.length>n0;}; +Q.hire=(orders,par)=>{Q.wantHire=[orders||['transit','routers','repair'],par||{}];return true;}; +Q.hire0=(orders,par)=>{if(!opsCanHire()||!Q.can(20000))return false;if(!opsHired()){ACT.opsHire({id:'kevin'});closeModal();}if(!opsHired())return false; + for(const k of orders)if(!S.ops.on[k])ACT.opsToggle({k});for(const k in par)for(const [p,v] of Object.entries(par[k]))for(let i=0;i<8&&opsP(k,p)!==v;i++)ACT.opsParam({k,p});closeModal();return true;}; +Q.pnis=(tier=0)=>{for(const n of NETS.filter(n=>!R.reachable[n.id]).sort((a,b)=>NSH[b.id]-NSH[a.id])){const b=pniBatch(n.id,tier);if(!b||!b.orders.length||!Q.can(b.cost))continue;ACT.pniAll({net:n.id,tier});}return true;}; +Q.scrub=(c,tier=0)=>{ACT.buildScrub({city:c,tier});return true;}; +Q.loans=()=>{Q.loan=true;return true;}; +Q.served=g=>R.served>=g||null; +Q.wait=d=>S.day>=d||null; +// Before an event: transit for the event on top of the usual peak, and routers that can take it. +Q.prep=(c,g)=>{const need=(S.stats.peak||R.served||0)*1.2+g*1.15,cap=()=>S.transit.filter(t=>t.city===c).reduce((a,t)=>a+PORT[t.tier].g*(t.n||1),0); + for(let k=0;k<12&&cap()t.city===c).sort((a,b)=>PORT[a.tier].g*(a.n||1)-PORT[b.tier].g*(b.n||1))[0];if(!t)break;const c0=cap(); + if(t.tier=need/4&&portOk(c,t.tier+1))ACT.buyTransit({city:c,net:t.net,tier:t.tier+1});else ACT.lagT({id:t.id,d:1}); + if(cap()===c0){if(t.tier=RMAX)break;const r0=p.routers||1;ACT.addRouter({city:c});if((p.routers||1)===r0)break;}return true;}; +Q.est={pop:c=>S.pops[c]?0:popCost(c),bb:c=>(S.pops[c]?0:popCost(c))+bbCost(c),tr:()=>20000,ix:()=>25000,hire:()=>0,scrub:(c,t)=>SCRUB_TIERS[t||0].cost, + link:(a,b,t)=>(S.pops[a]?0:popCost(a))+(S.pops[b]?0:popCost(b))+waveMo(kmBetween(a,b),isSub(a,b),t)*2+20000}; +Q.upkeep=()=>{ + for(const l of S.links){if(l.kind!=='wave'||l.tier>=LT.length-1||linkDown(l)||(R.load[l.id]||0)=PORT.length-1||!portOk(t.city,t.tier+1)){if(Q.can(PORT[t.tier].setup+20000))ACT.lagT({id:t.id,d:1});if(lagCap(PORT[t.tier].g,t.n)===cap&&Q.can(80000))ACT.upRouter({city:t.city});} + else if(Q.can(PORT[t.tier+1].setup+30000))ACT.buyTransit({city:t.city,net:t.net,tier:t.tier+1});} + for(const x in S.ixp){if(S.myIx&&S.myIx[x])continue;const u=(R.useIx&&R.useIx[x])||0;if(u>=lagCap(PORT[S.ixp[x]].g,(S.ixn||{})[x])*0.75&&Q.can(30000))ACT.lagIx({city:x,d:1});} + if(!(opsHired()&&S.ops.on.routers))for(const c in S.pops){if((R.nodeLoad[c]||0)/(R.nodeCap[c]||nodeCap(c)||1)>0.8&&Q.can(80000)){if((S.pops[c].routers||1)<2)ACT.addRouter({city:c});else ACT.upRouter({city:c});}}}; +Q.step=()=>{for(let k=0;k<6;k++){const s=Q.steps[Q.i];if(!s)return;const [op,...a]=s; + if(Q.est[op]&&!Q.can(Q.est[op](...a)))return;const ok=Q[op](...a);if(ok===null)return;Q.log.push(S.day+' '+op+' '+a.join(',')+(ok?'':' (failed)'));Q.i++;}}; +Q.day=()=>quiet(()=>{if(Q.wantHire&&Q.hire0(...Q.wantHire)){Q.log.push(S.day+' hired');Q.wantHire=null;} + if(Q.loan)for(const o of (S.loanOffers||[]).slice())ACT.takeLoan({id:o.id});closeModal(); + Q.step();if(S.day%7===0)Q.upkeep();}); +Q.start=(steps,o={})=>quiet(()=>{Q.steps=steps;Q.i=0;Q.avoid=o.avoid||[];Q.step();}); +})()`; + +// Starts scenario `id` (with `seed`, or its own), plays `plan` for up to `days` days (default: the scenario's), and +// returns the day it was won (or null), whether the network went broke, and the end state. +function play(ev, id, plan, { seed, days, avoid } = {}) { + ev(`localStorage.removeItem('sot-scn');beginGame('Ref',SCN.find(x=>x.id==='${id}').city,{scn:SCN.find(x=>x.id==='${id}')${seed ? ',seed:' + seed : ''}});if(UI.pendGame)ACT.pitchSkip();UI.speed=0;closeModal()`); + if (ev('typeof __ref') === 'undefined') ev(REF); + ev(`__ref.start(${JSON.stringify(plan)},${JSON.stringify({ avoid })})`); + const n = days || ev('S.scn.days'); + return JSON.parse(ev(`(()=>{let won=null;for(let i=0;i<${n};i++){__ref.day();dayTick();closeModal();if(S.scn.done){won=S.scn.done;break;}if(S.lost||S.scn.failed)break;} + return JSON.stringify({won,lost:!!S.lost,day:S.day,limit:S.scn.days,cash:Math.round(S.cash),served:Math.round(R.served)});})()`)); +} + +module.exports = { REF, play }; diff --git a/site/i18n/de.js b/site/i18n/de.js index 08da46f..1c13625 100644 --- a/site/i18n/de.js +++ b/site/i18n/de.js @@ -2921,16 +2921,16 @@ "progress.a_port_on_ix_brrr_manaus":"Ein Port am IX.brrr Manaus", "progress.broadband_in_city":"Breitband in {city}", "progress.carnaval_delivered_in_full":"Karneval vollständig ausgeliefert", +"progress.city_on_your_network":"{city} in deinem Netz", "progress.customer_level_lv_of_max":"Kundenlevel {lv} von {max}", "progress.days_in_a_row_at_g":"Tage am Stück mit {g} oder mehr", "progress.days_in_a_row_with_99":"Tage am Stück mit 99,5 % bedient", "progress.done_in_d_days":"Geschafft in {d} Tagen!", "progress.floods_that_got_through":"Fluten, die durchgekommen sind", -"progress.ix_brrr_ports":"IX.brrr-Ports", +"progress.ix_brrr_ports_on_your_backbone":"IX.brrr-Ports an deinem Backbone", "progress.n_of_m":"{n} von {m}", "progress.next_name_unlocks_what":"Als Nächstes: {name} schaltet {what} frei", "progress.not_tier_1_right_now_why":"Gerade nicht Tier 1: {why}.", -"progress.pop_in_city":"POP in {city}", "progress.terabit_floods_held":"Abgewehrte Terabit-Fluten", "progress.under_attack_now":"Gerade unter Beschuss", "progress.your_score_peak_traffic":"Dein Ergebnis: Spitzen-Traffic", @@ -3360,14 +3360,15 @@ "scenarios.90_days_in_a_row_with":"90 Tage am Stück mit 99,5 % der Nachfrage bedient", "scenarios.99_reach_and_150_gbps_served":"99 % Reichweite und 150 Gbps bedient", "scenarios.99_reach_and_200_gbps_served":"99 % Reichweite und 200 Gbps bedient, ohne pleitezugehen", -"scenarios.a_path_from_cape_town_to":"Ein Pfad von Kapstadt nach Kairo, POPs in Lagos und Nairobi, und 150 Gbps bedient", +"scenarios.a_path_from_cape_town_to_cairo_lagos":"Ein Pfad von Kapstadt nach Kairo, Lagos und Nairobi auch in deinem Netz, und 150 Gbps bedient", "scenarios.a_path_from_los_angeles_to":"Ein Pfad von Los Angeles nach Sydney mit 1.6T auf jedem Hop, ein Pfad von Los Angeles nach Tokio, und 150 Gbps bedient", "scenarios.a_path_from_marseille_to_singapore":"Ein Pfad von Marseille nach Singapur, und 80 Gbps zwischen Asien und dem Rest deines Netzes, 30 Tage am Stück", "scenarios.amsterdam_hosting_capital_of_europe":"Amsterdam, Hosting-Hauptstadt Europas, mitten in der Botnetz-Hochsaison. Jeder smarte Toaster, jedes Babyfon und jeder ungepatchte Kühlschrank der Welt hat sich für eine Seite entschieden, und es ist nicht deine. Alle paar Tage eine Flut, immer mehr davon im Terabit-Bereich, während auch alles andere weiter kaputtgeht. Du startest mit größerer Hardware freigeschaltet, und die wirst du brauchen.", -"scenarios.broadband_in_sydney_melbourne":"Breitband in Sydney, Melbourne, Brisbane, Adelaide und Perth, und zwei verschiedene Kabel nach Übersee", +"scenarios.broadband_in_sydney_melbourne_served":"Breitband in Sydney, Melbourne, Brisbane, Adelaide und Perth, zwei verschiedene Kabel nach Übersee, und 500 Gbps bedient", "scenarios.cape_to_cairo":"Vom Kap nach Kairo", "scenarios.cape_town_build_a_network_across":"Kapstadt. Bau ein Netz quer durch Afrika: Jede Grenze will ihre eigene Genehmigung, und die Hälfte der Stromnetze ist nicht auf deiner Seite.", "scenarios.cogentle_and_goggle_are_not_speaking":"Cogentle und Goggle reden nicht miteinander, und diesmal für immer. Kauf den billigen Transit, wenn du dich traust.", +"scenarios.connect_panama_city_to_bogota_lima":"Bogotá, Lima, Santiago und São Paulo mit Panama-Stadt verbunden, und 150 Gbps bedient", "scenarios.deliver_carnaval_in_full":"Liefere den Karneval vollständig aus", "scenarios.every_cable_through_the_red_sea":"Jedes Kabel durchs Rote Meer ist gekappt, und der Hop nach Ägypten auch. Bring Marseille trotzdem mit Singapur ins Gespräch: um Afrika herum, über Land oder andersherum um den Planeten.", "scenarios.every_ix_is_run_by_de":"Jeder IX wird von DE-KICKS betrieben", @@ -3379,9 +3380,8 @@ "scenarios.mid_atlantic_accent":"Mittelatlantischer Akzent", "scenarios.only_spatzle_ix":"Nur Spätzle-IX", "scenarios.order_and_progress":"Ordnung und Fortschritt", -"scenarios.ponta_delgada_in_the_azores_halfway":"Ponta Delgada auf den Azoren, mitten im Atlantik. Florida–Spanien und Lissabon–Lagos sind einfach zu lang für eine 1.6T-Wave: direkt hinüber trägt jede nur 1.2T. Lande auf den Inseln dazwischen, starte das Licht neu, und jeder Hop läuft mit 1.6T oder besser. Du startest mit freigeschalteter 1.6T-Hardware.", -"scenarios.pops_in_bogota_lima_santiago_and":"POPs in Bogotá, Lima, Santiago und São Paulo, und 150 Gbps bedient", -"scenarios.ports_on_15_ix_brrr_exchanges":"Ports an 15 IX.brrr-Exchanges, einer davon in Manaus, und 200 Gbps bedient", +"scenarios.ponta_delgada_azores_lisbon_lagos":"Ponta Delgada auf den Azoren, mitten im Atlantik. Florida–Spanien ist einfach zu lang für eine 1.6T-Wave: direkt hinüber trägt sie nur 1.2T. Lande auf den Inseln dazwischen, starte das Licht neu, und jeder Hop läuft mit 1.6T oder besser. Lissabon–Lagos schafft 1.6T am Stück, aber teuer: über die Kanaren ist es billiger. Du startest mit freigeschalteter 1.6T-Hardware.", +"scenarios.ports_on_15_ix_brrr_exchanges_backbone":"Ports an 15 IX.brrr-Exchanges, die dein Backbone mit São Paulo verbindet, einer davon in Manaus, und 200 Gbps bedient", "scenarios.reach_50_of_the_internet_and":"Erreiche 50 % des Internets und bediene 300 Gbps", "scenarios.red_sea_crisis":"Krise im Roten Meer", "scenarios.rio_from_scratch_carnaval_starts_in":"Rio, ganz von vorn. Der Karneval beginnt in 90 Tagen und will fünf Tage am Stück 400 Gbps. Die ganze Welt schaut zu.", @@ -3394,7 +3394,7 @@ "scenarios.start_in_stuttgart_where_nobody":"Start in Stuttgart, wo niemand Transit verkauft. Erreiche das Internet nur über Peering, PNIs, Caches und deine eigene Glasfaser. Kein Transit, nirgends, niemals.", "scenarios.start_with_only_100k":"Start mit nur $100k", "scenarios.sydney_2013_the_toilet_paper_group":"Sydney, 2013. Die Toilet Paper Group hat ihre eigene Glasfaser in die Keller von Wohnhäusern verlegt, und das nationale Netz hat „Rosinenpickerei“ geschrien. Du bist dran: Lass das Nearly Broadband Network links liegen, zahl die Abgabe und sei als Erster da.", -"scenarios.tallinn_ships_drag_their_anchors":"Tallinn. Schiffe schleifen ihre Anker dreimal so oft wie üblich über die Ostseekabel.", +"scenarios.tallinn_nobody_sells_transit_anchors":"Tallinn, wo niemand Transit verkauft: dein Internet liegt jenseits des Wassers. Schiffe schleifen ihre Anker dreimal so oft wie üblich über die Ostseekabel.", "scenarios.the_cogentle_spat":"Der Cogentle-Zoff", "scenarios.transit_costs_30_more":"Transit kostet 30 % mehr", "scenarios.twice_the_failures":"Doppelt so viele Ausfälle", diff --git a/site/i18n/es.js b/site/i18n/es.js index 804f9e4..03be971 100644 --- a/site/i18n/es.js +++ b/site/i18n/es.js @@ -2919,16 +2919,16 @@ "progress.a_port_on_ix_brrr_manaus":"Un puerto en IX.brrr Manaos", "progress.broadband_in_city":"Banda ancha en {city}", "progress.carnaval_delivered_in_full":"Carnaval entregado por completo", +"progress.city_on_your_network":"{city} en tu red", "progress.customer_level_lv_of_max":"Nivel de cliente {lv} de {max}", "progress.days_in_a_row_at_g":"Días seguidos con {g} o más", "progress.days_in_a_row_with_99":"Días seguidos con el 99,5 % servido", "progress.done_in_d_days":"¡Hecho en {d} días!", "progress.floods_that_got_through":"Inundaciones que pasaron", -"progress.ix_brrr_ports":"Puertos IX.brrr", +"progress.ix_brrr_ports_on_your_backbone":"Puertos IX.brrr en tu backbone", "progress.n_of_m":"{n} de {m}", "progress.next_name_unlocks_what":"Siguiente: {name} desbloquea {what}", "progress.not_tier_1_right_now_why":"Ahora no eres Tier 1: {why}.", -"progress.pop_in_city":"POP en {city}", "progress.terabit_floods_held":"Inundaciones de terabits contenidas", "progress.under_attack_now":"Bajo ataque ahora", "progress.your_score_peak_traffic":"Tu puntuación: tráfico pico", @@ -3358,14 +3358,15 @@ "scenarios.90_days_in_a_row_with":"90 días seguidos con el 99,5 % de la demanda servida", "scenarios.99_reach_and_150_gbps_served":"99 % de alcance y 150 Gbps servidos", "scenarios.99_reach_and_200_gbps_served":"99 % de alcance y 200 Gbps servidos sin arruinarte", -"scenarios.a_path_from_cape_town_to":"Un camino de Ciudad del Cabo a El Cairo, POPs en Lagos y Nairobi, y 150 Gbps servidos", +"scenarios.a_path_from_cape_town_to_cairo_lagos":"Un camino de Ciudad del Cabo a El Cairo, con Lagos y Nairobi también en tu red, y 150 Gbps servidos", "scenarios.a_path_from_los_angeles_to":"Un camino de Los Ángeles a Sídney con 1.6T en cada salto, un camino de Los Ángeles a Tokio, y 150 Gbps servidos", "scenarios.a_path_from_marseille_to_singapore":"Un camino de Marsella a Singapur, y 80 Gbps entre Asia y el resto de tu red durante 30 días seguidos", "scenarios.amsterdam_hosting_capital_of_europe":"Ámsterdam, capital del hosting de Europa, en plena temporada de botnets. Todas las tostadoras inteligentes, vigilabebés y frigoríficos sin parchear del planeta han elegido bando, y no es el tuyo. Una inundación cada pocos días, cada vez más en terabits, mientras todo lo demás también se rompe. Empiezas con equipo mayor desbloqueado, y lo vas a necesitar.", -"scenarios.broadband_in_sydney_melbourne":"Banda ancha en Sídney, Melbourne, Brisbane, Adelaida y Perth, y dos cables distintos al extranjero", +"scenarios.broadband_in_sydney_melbourne_served":"Banda ancha en Sídney, Melbourne, Brisbane, Adelaida y Perth, dos cables distintos al extranjero, y 500 Gbps servidos", "scenarios.cape_to_cairo":"De El Cabo a El Cairo", "scenarios.cape_town_build_a_network_across":"Ciudad del Cabo. Construye una red por África: cada frontera quiere su propio permiso, y la mitad de las redes eléctricas no están de tu parte.", "scenarios.cogentle_and_goggle_are_not_speaking":"Cogentle y Goggle no se hablan, y esta vez es para siempre. Compra el tránsito barato si te atreves.", +"scenarios.connect_panama_city_to_bogota_lima":"Bogotá, Lima, Santiago y São Paulo unidas a Ciudad de Panamá, y 150 Gbps servidos", "scenarios.deliver_carnaval_in_full":"Entrega el Carnaval por completo", "scenarios.every_cable_through_the_red_sea":"Todos los cables del Mar Rojo están cortados, y también el salto a Egipto. Consigue igualmente que Marsella hable con Singapur: rodeando África, por tierra, o dando la vuelta al planeta por el otro lado.", "scenarios.every_ix_is_run_by_de":"Todos los IX los gestiona DE-KICKS", @@ -3377,9 +3378,8 @@ "scenarios.mid_atlantic_accent":"Acento mesoatlántico", "scenarios.only_spatzle_ix":"Solo Spätzle-IX", "scenarios.order_and_progress":"Orden y Progreso", -"scenarios.ponta_delgada_in_the_azores_halfway":"Ponta Delgada, en las Azores, a medio camino por el Atlántico. De Florida a España y de Lisboa a Lagos es demasiado largo para una onda de 1.6T: en línea recta, cada una lleva 1.2T. Aterriza en las islas intermedias, empieza la luz de nuevo, y cada salto va a 1.6T o más. Empiezas con equipo de 1.6T desbloqueado.", -"scenarios.pops_in_bogota_lima_santiago_and":"POPs en Bogotá, Lima, Santiago y São Paulo, y 150 Gbps servidos", -"scenarios.ports_on_15_ix_brrr_exchanges":"Puertos en 15 intercambios IX.brrr, uno de ellos en Manaos, y 200 Gbps servidos", +"scenarios.ponta_delgada_azores_lisbon_lagos":"Ponta Delgada, en las Azores, a medio camino por el Atlántico. De Florida a España es demasiado largo para una onda de 1.6T: en línea recta, lleva 1.2T. Aterriza en las islas intermedias, empieza la luz de nuevo, y cada salto va a 1.6T o más. De Lisboa a Lagos el 1.6T llega de un tirón, pero caro: las Canarias salen más baratas. Empiezas con equipo de 1.6T desbloqueado.", +"scenarios.ports_on_15_ix_brrr_exchanges_backbone":"Puertos en 15 intercambios IX.brrr que tu backbone une a São Paulo, uno de ellos en Manaos, y 200 Gbps servidos", "scenarios.reach_50_of_the_internet_and":"Llega al 50 % de internet y sirve 300 Gbps", "scenarios.red_sea_crisis":"Crisis del Mar Rojo", "scenarios.rio_from_scratch_carnaval_starts_in":"Río desde cero. El Carnaval empieza en 90 días y quiere 400 Gbps durante cinco días seguidos. Todo el mundo está mirando.", @@ -3392,7 +3392,7 @@ "scenarios.start_in_stuttgart_where_nobody":"Empieza en Stuttgart, donde nadie vende tránsito. Llega a internet solo por peering, PNIs, cachés y tu propia fibra. Sin tránsito en ningún sitio, nunca.", "scenarios.start_with_only_100k":"Empieza con solo $100k", "scenarios.sydney_2013_the_toilet_paper_group":"Sídney, 2013. El Toilet Paper Group tendió su propia fibra hasta los sótanos de los edificios, y la red nacional gritó que escogía lo mejor. Te toca: sáltate la Nearly Broadband Network, paga el gravamen y llega primero.", -"scenarios.tallinn_ships_drag_their_anchors":"Tallin. Los barcos arrastran sus anclas sobre los cables del Báltico tres veces más a menudo de lo normal.", +"scenarios.tallinn_nobody_sells_transit_anchors":"Tallin, donde nadie vende tránsito: tu internet está al otro lado del agua. Los barcos arrastran sus anclas sobre los cables del Báltico tres veces más a menudo de lo normal.", "scenarios.the_cogentle_spat":"La riña de Cogentle", "scenarios.transit_costs_30_more":"El tránsito cuesta un 30 % más", "scenarios.twice_the_failures":"El doble de fallos", diff --git a/site/i18n/fr.js b/site/i18n/fr.js index 3fef0e1..4f7ccad 100644 --- a/site/i18n/fr.js +++ b/site/i18n/fr.js @@ -2919,16 +2919,16 @@ "progress.a_port_on_ix_brrr_manaus":"Un port sur IX.brrr Manaus", "progress.broadband_in_city":"Internet à domicile à {city}", "progress.carnaval_delivered_in_full":"Carnaval servi en entier", +"progress.city_on_your_network":"{city} sur votre réseau", "progress.customer_level_lv_of_max":"Niveau clients {lv} sur {max}", "progress.days_in_a_row_at_g":"Jours d’affilée à {g} ou plus", "progress.days_in_a_row_with_99":"Jours d’affilée à 99,5 % servi", "progress.done_in_d_days":"Fini en {d} jours !", "progress.floods_that_got_through":"Vagues passées", -"progress.ix_brrr_ports":"Ports IX.brrr", +"progress.ix_brrr_ports_on_your_backbone":"Ports IX.brrr sur votre backbone", "progress.n_of_m":"{n} sur {m}", "progress.next_name_unlocks_what":"Prochain : {name} débloque {what}", "progress.not_tier_1_right_now_why":"Pas Tier 1 pour l’instant : {why}.", -"progress.pop_in_city":"POP à {city}", "progress.terabit_floods_held":"Vagues térabit encaissées", "progress.under_attack_now":"Sous attaque", "progress.your_score_peak_traffic":"Ton score : pic de trafic", @@ -3358,14 +3358,15 @@ "scenarios.90_days_in_a_row_with":"90 jours d’affilée avec 99,5 % de la demande servie", "scenarios.99_reach_and_150_gbps_served":"99 % de couverture et 150 Gbps servis", "scenarios.99_reach_and_200_gbps_served":"99 % de couverture et 200 Gbps servis sans faire faillite", -"scenarios.a_path_from_cape_town_to":"Un chemin du Cap au Caire, des POP à Lagos et Nairobi, et 150 Gbps servis", +"scenarios.a_path_from_cape_town_to_cairo_lagos":"Un chemin du Cap au Caire, avec Lagos et Nairobi aussi sur votre réseau, et 150 Gbps servis", "scenarios.a_path_from_los_angeles_to":"Un chemin de Los Angeles à Sydney en 1.6T sur chaque saut, un chemin de Los Angeles à Tokyo, et 150 Gbps servis", "scenarios.a_path_from_marseille_to_singapore":"Un chemin de Marseille à Singapour, et 80 Gbps entre l’Asie et le reste de ton réseau pendant 30 jours d’affilée", "scenarios.amsterdam_hosting_capital_of_europe":"Amsterdam, capitale européenne de l’hébergement, en pleine saison des botnets. Chaque grille-pain connecté, babyphone et frigo jamais patché de la planète a choisi son camp, et ce n’est pas le tien. Une vague tous les quelques jours, de plus en plus souvent dans les térabits, pendant que tout le reste continue de casser aussi. Tu commences avec du matériel plus gros déjà débloqué, et tu en auras besoin.", -"scenarios.broadband_in_sydney_melbourne":"Internet à domicile à Sydney, Melbourne, Brisbane, Adélaïde et Perth, et deux câbles différents vers l’étranger", +"scenarios.broadband_in_sydney_melbourne_served":"Internet à domicile à Sydney, Melbourne, Brisbane, Adélaïde et Perth, deux câbles différents vers l’étranger, et 500 Gbps servis", "scenarios.cape_to_cairo":"Du Cap au Caire", "scenarios.cape_town_build_a_network_across":"Le Cap. Construis un réseau à travers l’Afrique : chaque frontière veut son propre permis, et la moitié des réseaux électriques ne sont pas de ton côté.", "scenarios.cogentle_and_goggle_are_not_speaking":"Cogentle et Goggle ne se parlent plus, et cette fois c’est définitif. Achète le transit pas cher, si tu l’oses.", +"scenarios.connect_panama_city_to_bogota_lima":"Bogotá, Lima, Santiago et São Paulo reliées à Panama, et 150 Gbps servis", "scenarios.deliver_carnaval_in_full":"Assurer tout le Carnaval", "scenarios.every_cable_through_the_red_sea":"Tous les câbles de la mer Rouge sont coupés, tout comme le saut vers l’Égypte. Fais quand même parler Marseille et Singapore : par le tour de l’Afrique, par voie terrestre, ou par l’autre côté de la planète.", "scenarios.every_ix_is_run_by_de":"Tous les IX sont gérés par DE-KICKS", @@ -3377,9 +3378,8 @@ "scenarios.mid_atlantic_accent":"Accent mi-atlantique", "scenarios.only_spatzle_ix":"Que du Spätzle-IX", "scenarios.order_and_progress":"Ordre et progrès", -"scenarios.ponta_delgada_in_the_azores_halfway":"Ponta Delgada, aux Açores, à mi-chemin de l’Atlantique. De la Floride à l’Espagne et de Lisbonne à Lagos, c’est juste trop long pour une onde de 1.6T : en ligne droite, chacune transporte 1.2T. Atterrissez sur les îles entre les deux, relancez la lumière, et chaque saut passe à 1.6T ou mieux. Vous commencez avec l’équipement 1.6T débloqué.", -"scenarios.pops_in_bogota_lima_santiago_and":"Des POP à Bogotá, Lima, Santiago et São Paulo, et 150 Gbps servis", -"scenarios.ports_on_15_ix_brrr_exchanges":"Des ports sur 15 IX.brrr, dont un à Manaus, et 200 Gbps servis", +"scenarios.ponta_delgada_azores_lisbon_lagos":"Ponta Delgada, aux Açores, à mi-chemin de l’Atlantique. De la Floride à l’Espagne, c’est juste trop long pour une onde de 1.6T : en ligne droite, elle transporte 1.2T. Atterrissez sur les îles entre les deux, relancez la lumière, et chaque saut passe à 1.6T ou mieux. De Lisbonne à Lagos, le 1.6T passe d’une traite, mais cher : les Canaries coûtent moins. Vous commencez avec l’équipement 1.6T débloqué.", +"scenarios.ports_on_15_ix_brrr_exchanges_backbone":"Des ports sur 15 IX.brrr que votre backbone relie à São Paulo, dont un à Manaus, et 200 Gbps servis", "scenarios.reach_50_of_the_internet_and":"Couvre 50 % d’internet et sers 300 Gbps", "scenarios.red_sea_crisis":"Crise en mer Rouge", "scenarios.rio_from_scratch_carnaval_starts_in":"Rio en partant de zéro. Le Carnaval commence dans 90 jours et veut 400 Gbps pendant cinq jours d’affilée. Le monde entier regarde.", @@ -3392,7 +3392,7 @@ "scenarios.start_in_stuttgart_where_nobody":"Démarre à Stuttgart, où personne ne vend de transit. Atteins Internet uniquement via peering, PNI, caches et ta propre fibre. Aucun transit, nulle part, jamais.", "scenarios.start_with_only_100k":"Démarre avec seulement $100k", "scenarios.sydney_2013_the_toilet_paper_group":"Sydney, 2013. Le Toilet Paper Group a tiré sa propre fibre jusqu’au sous-sol des immeubles, et le réseau national a crié à l’écrémage. À toi : passe outre le Nearly Broadband Network, paie la taxe et arrive le premier.", -"scenarios.tallinn_ships_drag_their_anchors":"Tallinn. Les navires traînent leurs ancres sur les câbles de la Baltique trois fois plus souvent que d’habitude.", +"scenarios.tallinn_nobody_sells_transit_anchors":"Tallinn, où personne ne vend de transit : votre internet est de l’autre côté de l’eau. Les navires traînent leurs ancres sur les câbles de la Baltique trois fois plus souvent que d’habitude.", "scenarios.the_cogentle_spat":"La brouille Cogentle", "scenarios.transit_costs_30_more":"Le transit coûte 30 % de plus", "scenarios.twice_the_failures":"Deux fois plus de pannes", diff --git a/site/i18n/it.js b/site/i18n/it.js index 72a39f6..df570c3 100644 --- a/site/i18n/it.js +++ b/site/i18n/it.js @@ -2919,16 +2919,16 @@ "progress.a_port_on_ix_brrr_manaus":"Una porta su IX.brrr Manaus", "progress.broadband_in_city":"Banda larga a {city}", "progress.carnaval_delivered_in_full":"Carnevale servito per intero", +"progress.city_on_your_network":"{city} sulla tua rete", "progress.customer_level_lv_of_max":"Livello clienti {lv} di {max}", "progress.days_in_a_row_at_g":"Giorni di fila con almeno {g}", "progress.days_in_a_row_with_99":"Giorni di fila con il 99,5% servito", "progress.done_in_d_days":"Fatto in {d} giorni!", "progress.floods_that_got_through":"Ondate passate", -"progress.ix_brrr_ports":"Porte IX.brrr", +"progress.ix_brrr_ports_on_your_backbone":"Porte IX.brrr sulla tua dorsale", "progress.n_of_m":"{n} su {m}", "progress.next_name_unlocks_what":"Prossimo: {name} sblocca {what}", "progress.not_tier_1_right_now_why":"Al momento non sei Tier 1: {why}.", -"progress.pop_in_city":"POP a {city}", "progress.terabit_floods_held":"Ondate terabit respinte", "progress.under_attack_now":"Sotto attacco ora", "progress.your_score_peak_traffic":"Il tuo punteggio: picco di traffico", @@ -3358,14 +3358,15 @@ "scenarios.90_days_in_a_row_with":"90 giorni di fila con il 99.5% della domanda servita", "scenarios.99_reach_and_150_gbps_served":"99% di copertura e 150 Gbps serviti", "scenarios.99_reach_and_200_gbps_served":"99% di copertura e 200 Gbps serviti senza andare in rovina", -"scenarios.a_path_from_cape_town_to":"Un percorso da Città del Capo al Cairo, POP a Lagos e Nairobi, e 150 Gbps serviti", +"scenarios.a_path_from_cape_town_to_cairo_lagos":"Un percorso da Città del Capo al Cairo, con Lagos e Nairobi anche loro sulla tua rete, e 150 Gbps serviti", "scenarios.a_path_from_los_angeles_to":"Un percorso da Los Angeles a Sydney con 1.6T su ogni tratta, un percorso da Los Angeles a Tokyo e 150 Gbps serviti", "scenarios.a_path_from_marseille_to_singapore":"Un percorso da Marsiglia a Singapore, e 80 Gbps tra l’Asia e il resto della tua rete per 30 giorni di fila", "scenarios.amsterdam_hosting_capital_of_europe":"Amsterdam, capitale europea dell’hosting, in piena stagione delle botnet. Ogni tostapane smart, baby monitor e frigo mai aggiornato della Terra ha scelto da che parte stare, e non è la tua. Un’ondata ogni pochi giorni, sempre più spesso nei terabit, mentre tutto il resto continua a rompersi. Parti con l’attrezzatura più grossa già sbloccata, e ti servirà.", -"scenarios.broadband_in_sydney_melbourne":"Banda larga a Sydney, Melbourne, Brisbane, Adelaide e Perth, e due cavi diversi verso l’estero", +"scenarios.broadband_in_sydney_melbourne_served":"Banda larga a Sydney, Melbourne, Brisbane, Adelaide e Perth, due cavi diversi verso l’estero, e 500 Gbps serviti", "scenarios.cape_to_cairo":"Dal Capo al Cairo", "scenarios.cape_town_build_a_network_across":"Città del Capo. Costruisci una rete attraverso l’Africa: ogni confine vuole il suo permesso, e metà delle reti elettriche non sono dalla tua parte.", "scenarios.cogentle_and_goggle_are_not_speaking":"Cogentle e Goggle non si parlano, e stavolta è per sempre. Compra il transit economico, se hai il coraggio.", +"scenarios.connect_panama_city_to_bogota_lima":"Bogotá, Lima, Santiago e São Paulo collegate a Panama City, e 150 Gbps serviti", "scenarios.deliver_carnaval_in_full":"Servi il Carnaval per intero", "scenarios.every_cable_through_the_red_sea":"Ogni cavo nel Mar Rosso è tagliato, e anche il salto verso l’Egitto. Fai parlare Marseille con Singapore lo stesso: girando intorno all’Africa, via terra o dall’altra parte del pianeta.", "scenarios.every_ix_is_run_by_de":"Ogni IX è gestito da DE-KICKS", @@ -3377,9 +3378,8 @@ "scenarios.mid_atlantic_accent":"Accento medio-atlantico", "scenarios.only_spatzle_ix":"Solo Spätzle-IX", "scenarios.order_and_progress":"Ordine e Progresso", -"scenarios.ponta_delgada_in_the_azores_halfway":"Ponta Delgada, nelle Azzorre, a metà dell’Atlantico. Dalla Florida alla Spagna e da Lisbona a Lagos è appena troppo lungo per un’onda da 1.6T: in linea diretta ognuna porta 1.2T. Approda sulle isole in mezzo, fai ripartire la luce e ogni tratto va a 1.6T o più. Parti con l’attrezzatura da 1.6T sbloccata.", -"scenarios.pops_in_bogota_lima_santiago_and":"POP a Bogotá, Lima, Santiago e São Paulo, e 150 Gbps serviti", -"scenarios.ports_on_15_ix_brrr_exchanges":"Porte su 15 exchange IX.brrr, una delle quali a Manaus, e 200 Gbps serviti", +"scenarios.ponta_delgada_azores_lisbon_lagos":"Ponta Delgada, nelle Azzorre, a metà dell’Atlantico. Dalla Florida alla Spagna è appena troppo lungo per un’onda da 1.6T: in linea diretta porta 1.2T. Approda sulle isole in mezzo, fai ripartire la luce e ogni tratto va a 1.6T o più. Da Lisbona a Lagos l’1.6T arriva in un colpo solo, ma a caro prezzo: le Canarie costano meno. Parti con l’attrezzatura da 1.6T sbloccata.", +"scenarios.ports_on_15_ix_brrr_exchanges_backbone":"Porte su 15 exchange IX.brrr che la tua dorsale collega a São Paulo, una delle quali a Manaus, e 200 Gbps serviti", "scenarios.reach_50_of_the_internet_and":"Raggiungi il 50% di internet e servi 300 Gbps", "scenarios.red_sea_crisis":"Crisi nel Mar Rosso", "scenarios.rio_from_scratch_carnaval_starts_in":"Rio da zero. Il Carnaval comincia tra 90 giorni e vuole 400 Gbps per cinque giorni di fila. Il mondo intero sta guardando.", @@ -3392,7 +3392,7 @@ "scenarios.start_in_stuttgart_where_nobody":"Parti da Stuttgart, dove nessuno vende transit. Raggiungi internet solo con peering, PNI, cache e la tua fibra. Niente transit, da nessuna parte, mai.", "scenarios.start_with_only_100k":"Parti con soli $100k", "scenarios.sydney_2013_the_toilet_paper_group":"Sydney, 2013. Il Toilet Paper Group ha portato la sua fibra nelle cantine dei condomini, e la rete nazionale ha gridato al cherry-picking. Tocca a te: salta la Nearly Broadband Network, paga il contributo e arriva per primo.", -"scenarios.tallinn_ships_drag_their_anchors":"Tallinn. Le navi trascinano le ancore sui cavi del Baltico tre volte più spesso del solito.", +"scenarios.tallinn_nobody_sells_transit_anchors":"Tallinn, dove nessuno vende transit: la tua internet è al di là del mare. Le navi trascinano le ancore sui cavi del Baltico tre volte più spesso del solito.", "scenarios.the_cogentle_spat":"La lite Cogentle", "scenarios.transit_costs_30_more":"Il transit costa il 30% in più", "scenarios.twice_the_failures":"Guasti raddoppiati", diff --git a/site/i18n/pt.js b/site/i18n/pt.js index 54cb90c..e3ae318 100644 --- a/site/i18n/pt.js +++ b/site/i18n/pt.js @@ -2919,16 +2919,16 @@ "progress.a_port_on_ix_brrr_manaus":"Uma porta no IX.brrr Manaus", "progress.broadband_in_city":"Banda larga em {city}", "progress.carnaval_delivered_in_full":"Carnaval entregue por completo", +"progress.city_on_your_network":"{city} na sua rede", "progress.customer_level_lv_of_max":"Nível de clientes {lv} de {max}", "progress.days_in_a_row_at_g":"Dias seguidos com {g} ou mais", "progress.days_in_a_row_with_99":"Dias seguidos com 99,5% atendido", "progress.done_in_d_days":"Feito em {d} dias!", "progress.floods_that_got_through":"Enxurradas que passaram", -"progress.ix_brrr_ports":"Portas no IX.brrr", +"progress.ix_brrr_ports_on_your_backbone":"Portas no IX.brrr no seu backbone", "progress.n_of_m":"{n} de {m}", "progress.next_name_unlocks_what":"Próximo: {name} desbloqueia {what}", "progress.not_tier_1_right_now_why":"Não é Tier 1 agora: {why}.", -"progress.pop_in_city":"POP em {city}", "progress.terabit_floods_held":"Enxurradas de terabit contidas", "progress.under_attack_now":"Sob ataque agora", "progress.your_score_peak_traffic":"Sua pontuação: pico de tráfego", @@ -3358,14 +3358,15 @@ "scenarios.90_days_in_a_row_with":"90 dias seguidos com 99.5% da demanda servida", "scenarios.99_reach_and_150_gbps_served":"99% de alcance e 150 Gbps servidos", "scenarios.99_reach_and_200_gbps_served":"99% de alcance e 200 Gbps entregues sem quebrar", -"scenarios.a_path_from_cape_town_to":"Um caminho da Cidade do Cabo ao Cairo, POPs em Lagos e Nairóbi, e 150 Gbps atendidos", +"scenarios.a_path_from_cape_town_to_cairo_lagos":"Um caminho da Cidade do Cabo ao Cairo, com Lagos e Nairóbi também na sua rede, e 150 Gbps atendidos", "scenarios.a_path_from_los_angeles_to":"Um caminho de Los Angeles a Sydney com 1.6T em cada trecho, um caminho de Los Angeles a Tóquio e 150 Gbps atendidos", "scenarios.a_path_from_marseille_to_singapore":"Um caminho de Marselha a Singapura, e 80 Gbps entre a Ásia e o resto da sua rede por 30 dias seguidos", "scenarios.amsterdam_hosting_capital_of_europe":"Amsterdã, capital europeia do hosting, em plena temporada de botnets. Cada torradeira smart, babá eletrônica e geladeira sem patch da Terra escolheu um lado, e não é o seu. Uma enxurrada a cada poucos dias, cada vez mais na casa dos terabits, enquanto todo o resto continua quebrando também. Você começa com equipamento maior desbloqueado, e vai precisar.", -"scenarios.broadband_in_sydney_melbourne":"Banda larga em Sydney, Melbourne, Brisbane, Adelaide e Perth, e dois cabos diferentes para o exterior", +"scenarios.broadband_in_sydney_melbourne_served":"Banda larga em Sydney, Melbourne, Brisbane, Adelaide e Perth, dois cabos diferentes para o exterior, e 500 Gbps servidos", "scenarios.cape_to_cairo":"Do Cabo ao Cairo", "scenarios.cape_town_build_a_network_across":"Cidade do Cabo. Construa uma rede pela África: cada fronteira quer sua própria licença, e metade das redes elétricas não está do seu lado.", "scenarios.cogentle_and_goggle_are_not_speaking":"Cogentle e Goggle não se falam, e desta vez é pra sempre. Compre o transit barato, se tiver coragem.", +"scenarios.connect_panama_city_to_bogota_lima":"Bogotá, Lima, Santiago e São Paulo ligadas à Cidade do Panamá, e 150 Gbps servidos", "scenarios.deliver_carnaval_in_full":"Entregue o Carnaval completo", "scenarios.every_cable_through_the_red_sea":"Todos os cabos pelo Mar Vermelho foram cortados, e o salto para o Egito também. Faça Marseille falar com Singapore mesmo assim: contornando a África, por terra ou pelo outro lado do planeta.", "scenarios.every_ix_is_run_by_de":"Todo IX é operado pela DE-KICKS", @@ -3377,9 +3378,8 @@ "scenarios.mid_atlantic_accent":"Sotaque do meio do Atlântico", "scenarios.only_spatzle_ix":"Só Spätzle-IX", "scenarios.order_and_progress":"Ordem e Progresso", -"scenarios.ponta_delgada_in_the_azores_halfway":"Ponta Delgada, nos Açores, no meio do Atlântico. Da Flórida à Espanha e de Lisboa a Lagos é um pouco longo demais para uma onda de 1.6T: em linha direta, cada uma leva 1.2T. Pouse nas ilhas no meio, recomece a luz, e cada trecho roda a 1.6T ou mais. Você começa com equipamento de 1.6T desbloqueado.", -"scenarios.pops_in_bogota_lima_santiago_and":"POPs em Bogotá, Lima, Santiago e São Paulo, e 150 Gbps servidos", -"scenarios.ports_on_15_ix_brrr_exchanges":"Portas em 15 exchanges IX.brrr, uma delas em Manaus, e 200 Gbps servidos", +"scenarios.ponta_delgada_azores_lisbon_lagos":"Ponta Delgada, nos Açores, no meio do Atlântico. Da Flórida à Espanha é um pouco longo demais para uma onda de 1.6T: em linha direta, ela leva 1.2T. Pouse nas ilhas no meio, recomece a luz, e cada trecho roda a 1.6T ou mais. De Lisboa a Lagos dá 1.6T de uma vez, mas sai caro: as Canárias custam menos. Você começa com equipamento de 1.6T desbloqueado.", +"scenarios.ports_on_15_ix_brrr_exchanges_backbone":"Portas em 15 exchanges IX.brrr que o seu backbone liga a São Paulo, uma delas em Manaus, e 200 Gbps servidos", "scenarios.reach_50_of_the_internet_and":"Alcance 50% da internet e atenda 300 Gbps", "scenarios.red_sea_crisis":"Crise no Mar Vermelho", "scenarios.rio_from_scratch_carnaval_starts_in":"Rio do zero. O Carnaval começa em 90 dias e quer 400 Gbps por cinco dias seguidos. O mundo inteiro está assistindo.", @@ -3392,7 +3392,7 @@ "scenarios.start_in_stuttgart_where_nobody":"Comece em Stuttgart, onde ninguém vende transit. Alcance a internet só com peering, PNIs, caches e sua própria fibra. Nada de transit, em lugar nenhum, nunca.", "scenarios.start_with_only_100k":"Comece com só $100k", "scenarios.sydney_2013_the_toilet_paper_group":"Sydney, 2013. O Toilet Paper Group levou a própria fibra até o porão dos prédios, e a rede nacional reclamou de cherry-picking. Sua vez: pule a Nearly Broadband Network, pague a taxa e chegue primeiro.", -"scenarios.tallinn_ships_drag_their_anchors":"Tallinn. Os navios arrastam âncoras sobre os cabos do Báltico três vezes mais que o normal.", +"scenarios.tallinn_nobody_sells_transit_anchors":"Tallinn, onde ninguém vende trânsito: a sua internet fica do outro lado do mar. Os navios arrastam âncoras sobre os cabos do Báltico três vezes mais que o normal.", "scenarios.the_cogentle_spat":"A briga da Cogentle", "scenarios.transit_costs_30_more":"Transit custa 30% a mais", "scenarios.twice_the_failures":"O dobro de falhas", diff --git a/src/game/60-features/20-scenarios.js b/src/game/60-features/20-scenarios.js index 82738b6..123bd62 100644 --- a/src/game/60-features/20-scenarios.js +++ b/src/game/60-features/20-scenarios.js @@ -8,21 +8,30 @@ function pathExists(a,b){if(!S.pops[a]||!S.pops[b])return false;const adj={};for // Looked up rather than read from the save, so it follows a language switch mid-scenario. const scnName=()=>S.scn.wk?wsTxt(S.scn.wk.name):S.scn.id==='weekly'?tr('scenarios.weekly_key',{key:S.scn.key}):SCN.find(x=>x.id===S.scn.id)?.n||S.scn.name; const AU_BB=['syd','mel','bne','adl','per'],auExits=()=>new Set(S.links.filter(l=>l.sub&&!!CITY[l.a].au!==!!CITY[l.b].au&&!(l.ready>S.day)).map(l=>l.cable||l.id)).size; -const brIxN=()=>CITIES.filter(c=>c.br&&S.ixp[c.id]!==undefined).length; +// Ports count only on POPs your backbone joins to São Paulo: islands of POPs with a port each skipped the Amazon (playtest). +const FTTB_G=500; +const brIxN=()=>CITIES.filter(c=>c.br&&S.ixp[c.id]!==undefined&&(c.id==='sao'||pathExists('sao',c.id))).length; +// Days and cash were tuned in the 2.0.0 playtest (tests/scenarios-playtest.test.js): a reference player wins each one in +// roughly a fifth to a half of its days, and the obvious shortcut does not win. The 1.6T scenarios start with enough cash to +// build the whole chain on day 0 and still last until the traffic goal. const SCN=[ - {id:'stg',n:tr('scenarios.only_spatzle_ix'),city:'stg',cash:400000,days:730,rules:{noTransit:true,local:true},d:tr('scenarios.start_in_stuttgart_where_nobody'),goal:tr('scenarios.reach_50_of_the_internet_and'),ok:()=>R.reach>=0.5&&R.served>=300}, - {id:'redsea',n:tr('scenarios.red_sea_crisis'),city:'mrs',cash:2500000,days:540,rules:{banCities:['cai','jed'],banPairs:['eig:dxb-mrs','gbi:fuj-mrs','smw4:khi-mrs','smw6:mrs-bom','smw6:mrs-sin','peace:mrs-sin','aae:mrs-hkg','twoaf:mrs-bom','medn:cai-mrs','medn:ist-mrs','twoaf:jnb-mrs','eassy:nbo-mrs']},d:tr('scenarios.every_cable_through_the_red_sea'),goal:tr('scenarios.a_path_from_marseille_to_singapore'),ok:()=>pathExists('mrs','sin')&&(S.stats.asiaRun||0)>=RS_DAYS}, - {id:'spat',n:tr('scenarios.the_cogentle_spat'),city:'nyc',cash:700000,days:540,rules:{spat:true},d:tr('scenarios.cogentle_and_goggle_are_not_speaking'),goal:tr('scenarios.99_reach_and_150_gbps_served'),ok:()=>R.reach>=0.99&&R.served>=150}, + {id:'stg',n:tr('scenarios.only_spatzle_ix'),city:'stg',cash:400000,days:365,rules:{noTransit:true,local:true},d:tr('scenarios.start_in_stuttgart_where_nobody'),goal:tr('scenarios.reach_50_of_the_internet_and'),ok:()=>R.reach>=0.5&&R.served>=300}, + {id:'redsea',n:tr('scenarios.red_sea_crisis'),city:'mrs',cash:2500000,days:365,rules:{banCities:['cai','jed'],banPairs:['eig:dxb-mrs','gbi:fuj-mrs','smw4:khi-mrs','smw6:mrs-bom','smw6:mrs-sin','peace:mrs-sin','aae:mrs-hkg','twoaf:mrs-bom','medn:cai-mrs','medn:ist-mrs','twoaf:jnb-mrs','eassy:nbo-mrs']},d:tr('scenarios.every_cable_through_the_red_sea'),goal:tr('scenarios.a_path_from_marseille_to_singapore'),ok:()=>pathExists('mrs','sin')&&(S.stats.asiaRun||0)>=RS_DAYS}, + {id:'spat',n:tr('scenarios.the_cogentle_spat'),city:'nyc',cash:700000,days:240,rules:{spat:true},d:tr('scenarios.cogentle_and_goggle_are_not_speaking'),goal:tr('scenarios.99_reach_and_150_gbps_served'),ok:()=>R.reach>=0.99&&R.served>=150}, {id:'carnaval',n:tr('common.carnaval'),city:'rio',cash:600000,days:100,rules:{},setup:()=>{S.biz.push({id:uid(),scripted:true,city:'rio',city2:null,reqs:[],name:'Carnaval Parade in Rio de Janeiro',type:'event',bw:400,rate:0,mood:100,since:0,start:90,dur:5,fee:400*5*70});},d:tr('scenarios.rio_from_scratch_carnaval_starts_in'),goal:tr('scenarios.deliver_carnaval_in_full'),ok:()=>(S.stats.evFull||0)>=1}, - {id:'darien',n:tr('common.mind_the_gap'),city:'pan',cash:900000,days:730,rules:{},d:tr('scenarios.start_in_panama_city_nothing_crosses'),goal:tr('scenarios.pops_in_bogota_lima_santiago_and'),ok:()=>['bog','lim','scl','sao'].every(c=>S.pops[c])&&R.served>=150}, - {id:'c2c',n:tr('scenarios.cape_to_cairo'),city:'cpt',cash:2000000,days:1095,rules:{},d:tr('scenarios.cape_town_build_a_network_across'),goal:tr('scenarios.a_path_from_cape_town_to'),ok:()=>pathExists('cpt','cai')&&S.pops.lag&&S.pops.nbo&&R.served>=150}, - {id:'ixbr',n:tr('scenarios.order_and_progress'),city:'sao',cash:2500000,days:1095,rules:{},d:tr('scenarios.sao_paulo_brazil_is_a_continent'),goal:tr('scenarios.ports_on_15_ix_brrr_exchanges'),ok:()=>brIxN()>=15&&S.ixp.mao!==undefined&&R.served>=200}, - {id:'gangnam',n:tr('scenarios.gangnam_style_peering'),city:'icn',cash:900000,days:365,rules:{},d:tr('scenarios.seoul_the_fastest_hungriest_eyeballs'),goal:tr('scenarios.99_reach_and_200_gbps_served'),ok:()=>R.reach>=0.99&&R.served>=200}, + // Connected, not just present: four island POPs with local transit won on day 40 without crossing anything (playtest). + {id:'darien',n:tr('common.mind_the_gap'),city:'pan',cash:900000,days:180,rules:{},d:tr('scenarios.start_in_panama_city_nothing_crosses'),goal:tr('scenarios.connect_panama_city_to_bogota_lima'),ok:()=>['bog','lim','scl','sao'].every(c=>pathExists('pan',c))&&R.served>=150}, + // Lagos and Nairobi on the network too: one long wave to Cairo plus two empty POPs was not a network across Africa. + {id:'c2c',n:tr('scenarios.cape_to_cairo'),city:'cpt',cash:2000000,days:365,rules:{},d:tr('scenarios.cape_town_build_a_network_across'),goal:tr('scenarios.a_path_from_cape_town_to_cairo_lagos'),ok:()=>pathExists('cpt','cai')&&pathExists('cpt','lag')&&pathExists('cpt','nbo')&&R.served>=150}, + {id:'ixbr',n:tr('scenarios.order_and_progress'),city:'sao',cash:600000,days:240,rules:{},d:tr('scenarios.sao_paulo_brazil_is_a_continent'),goal:tr('scenarios.ports_on_15_ix_brrr_exchanges_backbone'),ok:()=>brIxN()>=15&&S.ixp.mao!==undefined&&R.served>=200}, + {id:'gangnam',n:tr('scenarios.gangnam_style_peering'),city:'icn',cash:900000,days:240,rules:{},d:tr('scenarios.seoul_the_fastest_hungriest_eyeballs'),goal:tr('scenarios.99_reach_and_200_gbps_served'),ok:()=>R.reach>=0.99&&R.served>=200}, {id:'flood',n:tr('common.flood_season'),city:'ams',cash:2000000,days:365,rules:{ddos:true},setup:()=>{S.lvl=Math.max(S.lvl||1,3);},d:tr('scenarios.amsterdam_hosting_capital_of_europe'),goal:tr('scenarios.hold_20_floods_5_of_them'),ok:()=>(S.stats.ddosOk||0)>=20&&(S.stats.ddosOkBig||0)>=5}, - {id:'fttb',n:tr('scenarios.fibre_to_the_basement'),city:'syd',cash:1500000,days:730,rules:{levy:true},d:tr('scenarios.sydney_2013_the_toilet_paper_group'),goal:tr('scenarios.broadband_in_sydney_melbourne'),ok:()=>AU_BB.every(c=>S.pops[c]&&S.pops[c].bb)&&auExits()>=2}, - {id:'baltic',n:tr('common.anchors_away'),city:'tll',cash:500000,days:540,rules:{anchors:3},d:tr('scenarios.tallinn_ships_drag_their_anchors'),goal:tr('scenarios.90_days_in_a_row_with'),ok:()=>(S.stats.clean||0)>=90}, - {id:'pac',n:tr('common.stepping_stones'),city:'hnl',cash:3000000,days:1095,rules:{},setup:()=>{S.lvl=Math.max(S.lvl||1,4);},d:tr('scenarios.honolulu_in_the_middle_of_the'),goal:tr('scenarios.a_path_from_los_angeles_to'),ok:()=>fastPath('lax','syd',1600)&&pathExists('lax','tok')&&R.served>=150}, - {id:'atl',n:tr('scenarios.mid_atlantic_accent'),city:'pdl',cash:3000000,days:1095,rules:{},setup:()=>{S.lvl=Math.max(S.lvl||1,4);},d:tr('scenarios.ponta_delgada_in_the_azores_halfway'),goal:tr('scenarios.1_6t_on_every_hop_from'),ok:()=>fastPath('mia','mad',1600)&&fastPath('lis','lag',1600)&&R.served>=100}, + // Traffic served too: broadband in five cities and two cables were bought on day 1 and won on day 2 (playtest). + {id:'fttb',n:tr('scenarios.fibre_to_the_basement'),city:'syd',cash:1500000,days:365,rules:{levy:true},d:tr('scenarios.sydney_2013_the_toilet_paper_group'),goal:tr('scenarios.broadband_in_sydney_melbourne_served'),ok:()=>AU_BB.every(c=>S.pops[c]&&S.pops[c].bb)&&auExits()>=2&&R.served>=FTTB_G}, + // Nobody sells transit in Tallinn here: with local transit, a network that never crossed the water won (playtest). + {id:'baltic',n:tr('common.anchors_away'),city:'tll',cash:500000,days:365,rules:{anchors:3,noTransitIn:['tll']},d:tr('scenarios.tallinn_nobody_sells_transit_anchors'),goal:tr('scenarios.90_days_in_a_row_with'),ok:()=>(S.stats.clean||0)>=90}, + {id:'pac',n:tr('common.stepping_stones'),city:'hnl',cash:5000000,days:240,rules:{},setup:()=>{S.lvl=Math.max(S.lvl||1,4);},d:tr('scenarios.honolulu_in_the_middle_of_the'),goal:tr('scenarios.a_path_from_los_angeles_to'),ok:()=>fastPath('lax','syd',1600)&&pathExists('lax','tok')&&R.served>=150}, + {id:'atl',n:tr('scenarios.mid_atlantic_accent'),city:'pdl',cash:5000000,days:240,rules:{},setup:()=>{S.lvl=Math.max(S.lvl||1,4);},d:tr('scenarios.ponta_delgada_azores_lisbon_lagos'),goal:tr('scenarios.1_6t_on_every_hop_from'),ok:()=>fastPath('mia','mad',1600)&&fastPath('lis','lag',1600)&&R.served>=100}, ]; const WEEK_CITIES=['fra','ams','lon','nyc','ash','sjc','sin','tok','syd','sao','jnb','bom','waw','ist','scl','hkg']; const WEEK_MODS=[{id:'pricey',n:tr('scenarios.transit_costs_30_more')},{id:'chaos',n:tr('scenarios.twice_the_failures')},{id:'poor',n:tr('scenarios.start_with_only_100k')},{id:'boom',n:tr('scenarios.eyeballs_grow_50_faster')},{id:'dk',n:tr('scenarios.every_ix_is_run_by_de')},{id:'sharks',n:tr('scenarios.shark_season_subsea_cuts_twice_as')}]; diff --git a/src/game/60-features/94-scenarios-weekly.js b/src/game/60-features/94-scenarios-weekly.js index 7d01c02..fa8c053 100644 --- a/src/game/60-features/94-scenarios-weekly.js +++ b/src/game/60-features/94-scenarios-weekly.js @@ -27,7 +27,7 @@ const WS_GOALS={ path:{p:{a:['c'],b:['c'],g:['n',10,12800],n:['n',1,120]},daily:p=>fastPath(p.a,p.b,p.g),l:N_('wkscn.goal_g_on_every_hop_from'),ok:p=>wsRun()>=p.n,m:()=>wsRun(), prog:p=>[pChk(tr('wkscn.p_path_g_a_b',{g:fmtG(p.g),a:CITY[p.a].name,b:CITY[p.b].name}),fastPath(p.a,p.b,p.g)),{l:tr('wkscn.p_days_in_a_row'),v:wsRun(),max:p.n,txt:`${wsRun()} / ${p.n}`}]}, ix:{p:{reg:['r'],n:['n',2,60]},l:N_('wkscn.goal_ports_on_n_exchanges_in'),ok:p=>wsIxN(p.reg)>=p.n,m:p=>wsIxN(p.reg),prog:p=>{const n=wsIxN(p.reg);return [{l:tr('wkscn.p_exchange_ports_in_reg',{reg:WAVE_NAME[p.reg]}),v:n,max:p.n,txt:`${n} / ${p.n}`}];}}, - pops:{p:{cs:['cs',1,8]},l:N_('wkscn.goal_a_connected_pop_in_list'),ok:p=>p.cs.every(c=>pathExists(S.scn.home,c)),m:p=>p.cs.filter(c=>pathExists(S.scn.home,c)).length,prog:p=>p.cs.map(c=>pChk(tr('progress.pop_in_city',{city:CITY[c].name}),pathExists(S.scn.home,c)))}, + pops:{p:{cs:['cs',1,8]},l:N_('wkscn.goal_a_connected_pop_in_list'),ok:p=>p.cs.every(c=>pathExists(S.scn.home,c)),m:p=>p.cs.filter(c=>pathExists(S.scn.home,c)).length,prog:p=>p.cs.map(c=>pChk(tr('progress.city_on_your_network',{city:CITY[c].name}),pathExists(S.scn.home,c)))}, event:{p:{city:['c'],g:['n',10,6400],day:['n',20,360],dur:['n',1,10]},l:N_('wkscn.goal_deliver_the_event_in_city'),ok:()=>(S.stats.evFull||0)>=1,m:()=>S.stats.evFull||0, setup:p=>S.biz.push({id:uid(),scripted:true,city:p.city,city2:null,reqs:[],name:tr('wkscn.event_name_city',{city:CITY[p.city].name}),type:'event',bw:p.g,rate:0,mood:100,since:0,start:p.day,dur:p.dur,fee:p.g*p.dur*70}), prog:p=>[pChk(tr('wkscn.p_event_delivered_in_full'),(S.stats.evFull||0)>=1),{l:tr('common.traffic_served'),v:0,max:0,txt:tr('wkscn.p_g_on_day_d',{g:fmtG(p.g),d:p.day})}]}, diff --git a/src/game/70-rules/20-exchanges.js b/src/game/70-rules/20-exchanges.js index f1332ec..7a27f83 100644 --- a/src/game/70-rules/20-exchanges.js +++ b/src/game/70-rules/20-exchanges.js @@ -5,7 +5,9 @@ Not That Telecom and Level Tree (whose real-world network lists no sites in PeeringDB at all, but sells in Sydney). Others can sit in an Australian city, like the Pacific carriers backhauling to Sydney (or Glowball Sakura Lager), but reach Australian customers only from overseas. */ -const AU_SELLERS=['tsy','voc','spl','sgt','drz','cog','ntt','lvl'],sellsAt=(n,c)=>!!n.price&&(n.pops.includes(c)||!!n.premOnly&&n.premOnly.includes(c))&&(!CITY[c].au||AU_SELLERS.includes(n.id)); +const AU_SELLERS=['tsy','voc','spl','sgt','drz','cog','ntt','lvl'],sellsAt=(n,c)=>!!n.price&&(n.pops.includes(c)||!!n.premOnly&&n.premOnly.includes(c))&&(!CITY[c].au||AU_SELLERS.includes(n.id))&&!noTransitIn(c); +// A scenario city where nobody sells transit (Anchors Away: Tallinn's internet is across the water). +const noTransitIn=c=>{const x=S&&S.scn&&S.scn.rules&&S.scn.rules.noTransitIn;return Array.isArray(x)&&x.includes(c);}; /* China Telecomet's premium crossing into China (CN-Too) is sold where its border routes start: Hong Kong, and Moscow (#195), where it rides the land route east and nothing else of theirs is on offer (premOnly). It costs the same wherever you buy it: the Hong Kong price. */ diff --git a/src/game/70-rules/70-sold-out.js b/src/game/70-rules/70-sold-out.js index 748ae49..eda5b0c 100644 --- a/src/game/70-rules/70-sold-out.js +++ b/src/game/70-rules/70-sold-out.js @@ -15,7 +15,8 @@ function peerOk(id,via,city){ if(msfNope(id,city))return {ok:false,why:tr(MSF_NOPE[hstr(ixCity(city)+S.day)%MSF_NOPE.length])}; if(via==='ix'&&city&&isRemote(city)&&noRemote(id))return {ok:false,remote:true,why:REMOTE_WHY[hstr(id)%REMOTE_WHY.length]}; if(n.pol==='open')return {ok:true}; - if(n.pol==='selective'){const need=Math.round((via==='pni'?n.minPni:n.minIx)*confBoost(id)*repMul());return dem>=need?{ok:true}:{ok:false,why:tr('sold_out.wants_need_gbps_of_traffic_from',{need,dem:dem.toFixed(1)})};} + // In the Cogentle Spat, Goggle's peering desk wants eight times the usual traffic first, so cheap Cogentle-only transit really costs you Goggle (playtest). + if(n.pol==='selective'){const need=Math.round((via==='pni'?n.minPni:n.minIx)*confBoost(id)*repMul()*(id==='ggl'&&scnRule('spat')?8:1));return dem>=need?{ok:true}:{ok:false,why:tr('sold_out.wants_need_gbps_of_traffic_from',{need,dem:dem.toFixed(1)})};} if(n.pol==='paid'&&paidFree(n))return via==='pni'?{ok:true,free:true}:{ok:false,why:tr('sold_out.peers_with_you_for_free_now')}; if(n.pol==='paid')return via==='pni'?{ok:true,fee:n.paidFee}:{ok:false,why:n.perG?tr('sold_out.sender_pays_a_paid_pni_only',{fee:fmt$(n.paidFee),g:fmt$(n.perG)}):tr('sold_out.paid_peering_only_over_a_pni')}; if(n.type!=='t1'){if(via!=='pni')return {ok:false,why:tr('sold_out.only_peers_over_pnis_and_only')};const need=Math.round(60*confBoost(id));return dem>=need||isTier2()?{ok:true}:{ok:false,why:tr('sold_out.wants_you_to_be_a_tier',{need,dem:dem.toFixed(1)})};} diff --git a/src/game/80-simulation/80-geography-and-latency.js b/src/game/80-simulation/80-geography-and-latency.js index db11458..79ef628 100644 --- a/src/game/80-simulation/80-geography-and-latency.js +++ b/src/game/80-simulation/80-geography-and-latency.js @@ -16,6 +16,8 @@ const borderPair=(a,b)=>CITY[a].reg==='AF'&&CITY[b].reg==='AF'&&CITY[a].cc!==CIT // fiber costs a little more again because the incumbents own it. const NULLARBOR=1.7,nullPair=(a,b)=>!!CITY[a].au&&!!CITY[b].au&&(a==='per')!==(b==='per'); const andesPair=(a,b)=>!!CITY[a].andes&&!!CITY[b].andes&&CITY[a].andes!==CITY[b].andes; +// A pair an anchor-prone cable serves (the Baltic): the map calls it overland, but the fibre lies on the seabed (Anchors Away). +let ANCHOR_P=null;const anchorPair=l=>(ANCHOR_P||(ANCHOR_P=new Set(CABLE_PAIRS.filter(p=>CAB[p.cid]&&CAB[p.cid].anchor).map(p=>edgeKey(p))))).has(edgeKey(l)); /* Overland between continents (Europe to the Middle East and Asia) crosses a dozen borders and as many carriers, each taking a cut: in real life it costs ten times the subsea route or more (#40). */ const LAND_X=45,landX=(a,b)=>!isSub(a,b)&&CITY[a].reg!==CITY[b].reg; diff --git a/src/game/85-incidents/20-failures.js b/src/game/85-incidents/20-failures.js index c7eaebf..dd13d16 100644 --- a/src/game/85-incidents/20-failures.js +++ b/src/game/85-incidents/20-failures.js @@ -1,4 +1,6 @@ -function fireFailure(){ +// Anchors Away (Baltic): a link on an anchor-prone cable, or on a pair one serves (the map calls those overland). +const anchorProne=l=>!!(l.cable&&CAB[l.cable]&&CAB[l.cable].anchor)||anchorPair(l); +function fireFailure(only){ const opts=[]; const live=S.links.filter(l=>l.kind!=='vxc'&&!linkDown(l));const fabsUsed=[...new Set(S.links.filter(l=>l.kind==='vxc').map(l=>l.prov))]; if(live.length){opts.push(['cut',2+Math.min(6,live.length/2)]);} @@ -17,6 +19,7 @@ function fireFailure(){ if(!opts.length)return; let tot=opts.reduce((a,o)=>a+o[1],0),r=Math.random()*tot,type=opts[0][0]; for(const o of opts){r-=o[1];if(r<=0){type=o[0];break;}} + if(only)type=only; if(type==='funny'){const f=['oops','cleaner','harmless','harmless','harmless','ac'];if(live.length)f.push('fatwave','fatwave','mtu','label','loss','loss');if(lagsN().length)f.push('lacp','lacp');if(R.demand>1)f.push('pmtud');if(Object.keys(S.ixp).length)f.push('maxpfx');if(S.transit.length)f.push('prepend');if(S.day>30)f.push('rpki');if(lit.length)f.push('roadmff');type=pick(f);} const before=R.served; if(type==='harmless'){const m=pick(HARMLESS);S.stats.incidents++;S.stats.survived++;toast(`${m[0]}
${m[1]}`,'goal');sfx('alert');return;} @@ -79,8 +82,8 @@ function fireFailure(){ const l=pick(lit),A=CITY[l.a].name,B=CITY[l.b].name,o=pick(l.ch),dur=l.spares?1:4;l.chFail={n:1,o,until:S.day+dur}; addInc({type,ref:l.id,until:S.day+dur,msg:pick([tr('failures.a_optic_on_a_b_overheated',{optic:OPT[o].n,a:A,b:B}),tr('failures.the_laser_in_a_optic_on',{optic:OPT[o].n,a:A,b:B}),tr('failures.a_optic_on_a_b_started',{optic:OPT[o].n,a:A,b:B})])+(l.spares?' '+tr('failures.swapped_from_your_spares_kit_by'):''),cost:l.spares?0:OPT[o].cost,fix:tr('failures.buy_a_replacement')}); }else if(type==='cut'){ - const mon=Math.floor((S.day%365)/30.42),monsoon=mon>=5&&mon<=8,tw=x=>x.sub&&(x.a==='tpe'||x.b==='tpe'||(x.cable&&CAB[x.cable].anchor)),vn=x=>x.sub&&(x.a==='sgn'||x.b==='sgn'),inl=x=>!x.sub&&(CITY[x.a].india||CITY[x.b].india); - const l=pick(live.flatMap(x=>{const w=(x.cable&&CAB[x.cable].age==='old'?3:1)*(x.cable&&CAB[x.cable].fragile?3:1)*(tw(x)?4*(scnRule('anchors')?3:1):1)*(scnRule('sharks')&&x.sub?2:1)*(vn(x)?3:1)*(!x.sub&&andesPair(x.a,x.b)?4:1)*(monsoon&&inl(x)?3:1)*(x.sub&&(x.a==='oos'||x.b==='oos')?3:1);return Array(w).fill(x);})),dur=10+Math.floor(Math.random()*8),trc=l.trench||l.id,hit=S.links.filter(x=>(x.trench||x.id)===trc);hit.forEach(x=>x.cut=Math.max(x.cut||0,S.day+dur)); + const mon=Math.floor((S.day%365)/30.42),monsoon=mon>=5&&mon<=8,tw=x=>(x.sub&&(x.a==='tpe'||x.b==='tpe'||(x.cable&&CAB[x.cable].anchor)))||(scnRule('anchors')&&anchorProne(x)),vn=x=>x.sub&&(x.a==='sgn'||x.b==='sgn'),inl=x=>!x.sub&&(CITY[x.a].india||CITY[x.b].india); + const pool=only&&scnRule('anchors')?live.filter(anchorProne):live;if(!pool.length)return;const l=pick(pool.flatMap(x=>{const w=(x.cable&&CAB[x.cable].age==='old'?3:1)*(x.cable&&CAB[x.cable].fragile?3:1)*(tw(x)?4*(scnRule('anchors')?3:1):1)*(scnRule('sharks')&&x.sub?2:1)*(vn(x)?3:1)*(!x.sub&&andesPair(x.a,x.b)?4:1)*(monsoon&&inl(x)?3:1)*(x.sub&&(x.a==='oos'||x.b==='oos')?3:1);return Array(w).fill(x);})),dur=10+Math.floor(Math.random()*8),trc=l.trench||l.id,hit=S.links.filter(x=>(x.trench||x.id)===trc);hit.forEach(x=>x.cut=Math.max(x.cut||0,S.day+dur)); const A=CITY[l.a].name,B=CITY[l.b].name,au=CITY[l.a].au&&CITY[l.b].au,auSummer=mon>=11||mon<=1; const en=l.sub&&(CITY[l.a].au||CITY[l.b].au)&&!(l.cable&&CAB[l.cable].fragile)&&Math.random()<0.35?pick([N_('failures.box_jellyfish_season_at_the_a'),N_('failures.a_great_white_took_an_interest')]):l.cable&&CAB[l.cable].fragile&&Math.random()<0.8?pick([N_('failures.your_a_b_cable_is_cut'),N_('failures.a_b_is_down_same_cable')]):!l.sub&&CITY[l.a].land==='nzs'&&CITY[l.b].land==='nzs'&&Math.random()<0.75?pick([N_('failures.a_kea_pulled_the_rubber_seals'),N_('failures.the_sandflies_drove_your_splicing'),N_('failures.a_farmer_s_post_hole_digger')]):l.cable==='cook'&&Math.random()<0.6?N_('failures.a_ferry_dropped_anchor_in_cook'):!l.sub&&au&&Math.random()<0.75?pick([N_('failures.a_sulphur_crested_cockatoo_chewed'),N_('failures.a_kangaroo_hit_the_fiber_hut'),N_('failures.thieves_dug_up_your_a_b'),N_('failures.a_kilometre_of_copper_went_missing'),N_('failures.a_backhoe_putting_in_a_new'),N_('failures.the_emus_won_again_a_mob'),N_('failures.a_kangaroo_boxed_your_field_tech'),N_('failures.a_drop_bear_fell_on_the'),N_('failures.an_eastern_brown_snake_moved_into'),...((S.day%365)/30.42>=8&&(S.day%365)/30.42<11?[N_('failures.magpie_swooping_season_the_field')]:[]),...(auSummer?[N_('failures.bushfire_season_the_fiber_along_a')]:[]),...(nullPair(l.a,l.b)?[N_('failures.your_a_b_fiber_broke_somewhere')]:[])]):l.sub&&(l.a==='bda'||l.b==='bda')&&Math.random()<0.7?pick([N_('failures.your_a_b_cable_went_quiet'),N_('failures.the_repair_ship_s_compass_spun')]):l.sub&&(l.a==='tbu'||l.b==='tbu')&&Math.random()<0.7?pick([N_('failures.an_undersea_volcano_erupted_next_to'),N_('failures.the_seabed_off_tonga_slid_down')]):vn(l)&&Math.random()<0.8?pick([N_('failures.another_of_vietnam_s_subsea_cables'),N_('failures.your_a_b_cable_broke_in')]):!l.sub&&(l.a==='drw'||l.b==='drw')&&Math.random()<0.7?pick([N_('failures.a_crocodile_took_a_bite_out'),N_('failures.termites_ate_the_duct_on_a')]):tw(l)&&Math.random()<0.8?pick([N_('failures.a_cargo_ship_forgot_to_raise'),N_('failures.another_anchor_another_cut_your_a'),N_('failures.a_fishing_boat_with_an_unusually')]):l.sub&&(l.a==='oos'||l.b==='oos')&&Math.random()<0.8?pick([N_('failures.a_trawler_off_ostend_dragged_its'),N_('failures.a_wind_farm_service_vessel_dropped')]):!l.sub&&(CITY[l.a].ca||CITY[l.b].ca)&&Math.random()<0.4?pick([N_('failures.a_beaver_chewed_through_your_a'),N_('failures.your_a_b_fiber_is_down'),N_('failures.frost_heave_cracked_the_duct_on')]):!l.sub&&andesPair(l.a,l.b)?pick([N_('failures.a_landslide_in_the_andes_buried'),N_('failures.snow_closed_the_mountain_pass_and'),N_('failures.an_earthquake_shook_your_a_b'),N_('failures.a_llama_herd_trampled_the_fiber')]):!l.sub&&(CITY[l.a].india||CITY[l.b].india)?pick([N_('failures.road_widening_near_a_cut_your'),N_('failures.the_monsoon_flooded_a_manhole_on'),N_('failures.a_digger_found_your_a_b')]):l.sub?pick([N_('failures.a_curious_shark_bit_your_subsea'),N_('failures.a_ship_dragged_its_anchor_across'),N_('failures.an_undersea_landslide_snapped_a_b')]):pick([N_('failures.a_backhoe_found_your_fiber_between'),N_('failures.squirrels_chewed_through_a_b_they'),N_('failures.road_works_cut_a_b_nobody')]); addInc({type,ref:trc,until:S.day+dur,msg:tr(en,{a:A,b:B})+(hit.length>1?' '+tr('failures.all_n_links_in_that_trench',{n:hit.length}):''),cost:Math.max(4000,Math.round(hit.reduce((a,x)=>a+x.mo,0)*0.5))},en); @@ -166,7 +169,8 @@ function ddosAttack(recompute=true){const type='ddos',fl=scnRule('ddos');ddosExp sfx('alert');} // When an attack is over: was it held? Held means the city under attack got at least 97% of its traffic every day. function ddosDone(a){if(!a||a.done)return;a.done=1;if(a.worst===undefined&&S.pops[a.city])a.worst=ddosSf(a);const ok=(a.worst===undefined?1:a.worst)>=0.97; - if(ok){S.stats.ddosOk=(S.stats.ddosOk||0)+1;if(a.gbps>=1000)S.stats.ddosOkBig=(S.stats.ddosOkBig||0)+1;}else S.stats.ddosLost=(S.stats.ddosLost||0)+1; + // In Flood Season a terabit flood counts only when scrubbing or Flowspec took it: spare exits held some by luck (playtest). + if(ok){S.stats.ddosOk=(S.stats.ddosOk||0)+1;if(a.gbps>=1000&&(!scnRule('ddos')||hasScrub()||(DDOS_VEC[a.vec]&&DDOS_VEC[a.vec].fs&&fsAt(a.city))))S.stats.ddosOkBig=(S.stats.ddosOkBig||0)+1;}else S.stats.ddosLost=(S.stats.ddosLost||0)+1; if(scnRule('ddos')){const w=tr(FLOOD_WHO.includes(a.who)?a.who:FLOOD_WHO[0]),who=esc(w.charAt(0).toUpperCase()+w.slice(1));toast(ok?tr('failures.flood_held_g_who_gave_up',{g:fmtG(a.gbps),who}):tr('failures.that_one_got_through_g_city',{g:fmtG(a.gbps),city:esc(CITY[a.city]?CITY[a.city].name:tr('common.your_network')),p:pct(a.worst||0),who:esc(w)}),ok?'goal':'bad');}} // Flood Season: 3 to 7 days apart as before, shrinking with age, level and gamers only when attacks are spicy. const floodGap=()=>!ddosSpicy()?3+Math.floor(Math.random()*5):Math.max(0.05,(3+Math.random()*5)/(Math.sqrt(1+S.day/180)*(1+gamingCount()/10+Math.max(0,(S.lvl||1)-1)/12))); diff --git a/src/game/88-days/10-day-tick.js b/src/game/88-days/10-day-tick.js index eb2c34c..4f5b445 100644 --- a/src/game/88-days/10-day-tick.js +++ b/src/game/88-days/10-day-tick.js @@ -11,7 +11,8 @@ function dayTick(){ for(const a of ddosAll(S,false))if(a.until>=d&&R&&S.pops[a.city])a.worst=Math.min(a.worst===undefined?1:a.worst,ddosSf(a)); ddosExpire(); ddosTick(); - if(R&&R.demand>0)S.stats.clean=R.served/R.demand>=0.995?(S.stats.clean||0)+1:0; + // What the Great Firewall drops is not your outage: it alone kept Anchors Away's 99.5% out of reach (playtest). + if(R&&R.demand>0)S.stats.clean=(R.served+(R.gfwLost||0))/R.demand>=0.995?(S.stats.clean||0)+1:0; if(S.scn&&S.scn.id==='redsea')S.stats.asiaRun=asiaG()>=RS_G?(S.stats.asiaRun||0)+1:0; if(S.ev.php===d)toast(tr('day_tick.the_internet_is_back_half_of'),'good'); for(const k in S.peers){const [id,c]=k.split('@'),sn=snub(id,c);if(!sn)continue;delete S.peers[k];S.stats.depeered=(S.stats.depeered||0)+1; @@ -63,6 +64,8 @@ function dayTick(){ // Chaos (the rules) scales how often: calm waits about three times as long, spicy comes almost twice as often, none never. let dirty=false;const cm=chaosMul(); if(cm&&d>=S.nextFail){dirty=true;fireFailure();const size=S.links.length+Object.keys(S.pops).length;S.nextFail=d+Math.round((Math.max(22,50-size*1.5)+Math.floor(Math.random()*25))*(scnRule('chaos')?0.5:1)/cm);} + // Anchors Away: on top of the usual failures, ships drag anchors over each Baltic seabed link (about three cuts a link-year). + if(cm&&d>45&&scnRule('anchors')){const n=S.links.filter(l=>l.kind!=='vxc'&&!linkDown(l)&&anchorProne(l)).length;if(n&&Math.random()=S.nextEvent){dirty=true;fireEvent();S.nextEvent=d+Math.round((45+Math.floor(Math.random()*45))/cm);} if(dirty)compute(); opsDay(d); diff --git a/src/game/94-dashboard/10-progress.js b/src/game/94-dashboard/10-progress.js index a400b8e..234cc54 100644 --- a/src/game/94-dashboard/10-progress.js +++ b/src/game/94-dashboard/10-progress.js @@ -5,13 +5,13 @@ const pSrv=g=>({l:tr('common.traffic_served'),v:R.served,max:g,txt:`${fmtG(R.ser const pReach=()=>({l:tr('common.reach'),v:R.reach,max:0.99,txt:`${pct(R.reach)} / 99%`}); const pChk=(l,ok)=>({l,v:ok?1:0,max:1,txt:ok?'✓':'—'}); const SCN_PROG={stg:()=>[{l:tr('common.reach'),v:R.reach,max:0.5,txt:`${pct(R.reach)} / 50%`},pSrv(300)],redsea:()=>{const g=asiaG(),n=S.stats.asiaRun||0;return [pChk(tr('progress.a_path_from_marseille_to_singapore'),pathExists('mrs','sin')),{l:tr('progress.your_traffic_to_and_from_asia'),v:Math.min(g,RS_G),max:RS_G,txt:`${fmtG(g)} / ${fmtG(RS_G)}`},{l:tr('progress.days_in_a_row_at_g',{g:fmtG(RS_G)}),v:n,max:RS_DAYS,txt:`${n} / ${RS_DAYS}`}];},spat:()=>[pReach(),pSrv(150)], - carnaval:()=>[pChk(tr('progress.carnaval_delivered_in_full'),(S.stats.evFull||0)>=1)],ixbr:()=>{const n=brIxN();return [{l:tr('progress.ix_brrr_ports'),v:n,max:15,txt:`${n} / 15`},pChk(tr('progress.a_port_on_ix_brrr_manaus'),S.ixp.mao!==undefined),pSrv(200)];}, - c2c:()=>[pChk(tr('progress.a_path_from_cape_town_to'),pathExists('cpt','cai')),...['lag','nbo'].map(c=>pChk(tr('progress.pop_in_city',{city:CITY[c].name}),!!S.pops[c])),pSrv(150)], + carnaval:()=>[pChk(tr('progress.carnaval_delivered_in_full'),(S.stats.evFull||0)>=1)],ixbr:()=>{const n=brIxN();return [{l:tr('progress.ix_brrr_ports_on_your_backbone'),v:n,max:15,txt:`${n} / 15`},pChk(tr('progress.a_port_on_ix_brrr_manaus'),S.ixp.mao!==undefined),pSrv(200)];}, + c2c:()=>[pChk(tr('progress.a_path_from_cape_town_to'),pathExists('cpt','cai')),...['lag','nbo'].map(c=>pChk(tr('progress.city_on_your_network',{city:CITY[c].name}),pathExists('cpt',c))),pSrv(150)], pac:()=>[pChk(tr('progress.1_6t_on_every_hop_from'),fastPath('lax','syd',1600)),pChk(tr('progress.a_path_from_los_angeles_to'),pathExists('lax','tok')),pSrv(150)], atl:()=>[pChk(tr('progress.1_6t_on_every_hop_from_a90b'),fastPath('mia','mad',1600)),pChk(tr('progress.1_6t_on_every_hop_from_da01'),fastPath('lis','lag',1600)),pSrv(100)], - darien:()=>[...['bog','lim','scl','sao'].map(c=>pChk(tr('progress.pop_in_city',{city:CITY[c].name}),!!S.pops[c])),pSrv(150)], + darien:()=>[...['bog','lim','scl','sao'].map(c=>pChk(tr('progress.city_on_your_network',{city:CITY[c].name}),pathExists('pan',c))),pSrv(150)], gangnam:()=>[pReach(),pSrv(200)], - fttb:()=>[...AU_BB.map(c=>pChk(tr('progress.broadband_in_city',{city:CITY[c].name}),!!(S.pops[c]&&S.pops[c].bb))),{l:tr('common.cables_overseas'),v:Math.min(2,auExits()),max:2,txt:`${auExits()} / 2`}], + fttb:()=>[...AU_BB.map(c=>pChk(tr('progress.broadband_in_city',{city:CITY[c].name}),!!(S.pops[c]&&S.pops[c].bb))),{l:tr('common.cables_overseas'),v:Math.min(2,auExits()),max:2,txt:`${auExits()} / 2`},pSrv(FTTB_G)], flood:()=>{const ok=S.stats.ddosOk||0,big=S.stats.ddosOkBig||0,attacks=ddosAll(); return [{l:tr('common.floods_held'),v:ok,max:20,txt:`${ok} / 20`},{l:tr('progress.terabit_floods_held'),v:big,max:5,txt:`${big} / 5`},{l:tr('progress.floods_that_got_through'),v:0,max:0,txt:String(S.stats.ddosLost||0)}].concat(attacks.map(a=>({l:tr('progress.under_attack_now'),v:0,max:0,txt:`${fmtG(a.gbps)} · ${CITY[a.city].name} · ${pct(a.worst===undefined?1:a.worst)}`})));},baltic:()=>[{l:tr('progress.days_in_a_row_with_99'),v:S.stats.clean||0,max:90,txt:tr('progress.n_of_m',{n:S.stats.clean||0,m:90})}]}; function scnProg(){const sc=S&&S.scn;if(!sc)return null; diff --git a/src/i18n/en.js b/src/i18n/en.js index b4c8bbe..329113b 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -2920,16 +2920,16 @@ "progress.a_port_on_ix_brrr_manaus":"A port on IX.brrr Manaus", "progress.broadband_in_city":"Broadband in {city}", "progress.carnaval_delivered_in_full":"Carnaval delivered in full", +"progress.city_on_your_network":"{city} on your network", "progress.customer_level_lv_of_max":"Customer level {lv} of {max}", "progress.days_in_a_row_at_g":"Days in a row at {g} or more", "progress.days_in_a_row_with_99":"Days in a row with 99.5% served", "progress.done_in_d_days":"Done in {d} days!", "progress.floods_that_got_through":"Floods that got through", -"progress.ix_brrr_ports":"IX.brrr ports", +"progress.ix_brrr_ports_on_your_backbone":"IX.brrr ports on your backbone", "progress.n_of_m":"{n} of {m}", "progress.next_name_unlocks_what":"Next: {name} unlocks {what}", "progress.not_tier_1_right_now_why":"Not Tier 1 right now: {why}.", -"progress.pop_in_city":"POP in {city}", "progress.terabit_floods_held":"Terabit floods held", "progress.under_attack_now":"Under attack now", "progress.your_score_peak_traffic":"Your score: peak traffic", @@ -3359,14 +3359,15 @@ "scenarios.90_days_in_a_row_with":"90 days in a row with 99.5% of demand served", "scenarios.99_reach_and_150_gbps_served":"99% reach and 150 Gbps served", "scenarios.99_reach_and_200_gbps_served":"99% reach and 200 Gbps served without going broke", -"scenarios.a_path_from_cape_town_to":"A path from Cape Town to Cairo, POPs in Lagos and Nairobi, and 150 Gbps served", +"scenarios.a_path_from_cape_town_to_cairo_lagos":"A path from Cape Town to Cairo, Lagos and Nairobi on your network too, and 150 Gbps served", "scenarios.a_path_from_los_angeles_to":"A path from Los Angeles to Sydney with 1.6T on every hop, a path from Los Angeles to Tokyo, and 150 Gbps served", "scenarios.a_path_from_marseille_to_singapore":"A path from Marseille to Singapore, and 80 Gbps between Asia and the rest of your network for 30 days in a row", "scenarios.amsterdam_hosting_capital_of_europe":"Amsterdam, hosting capital of Europe, in peak botnet season. Every smart toaster, baby monitor and unpatched fridge on Earth has picked a side, and it is not yours. A flood every few days, more and more of them in the terabits, while everything else keeps breaking too. You start with bigger gear unlocked, and you will need it.", -"scenarios.broadband_in_sydney_melbourne":"Broadband in Sydney, Melbourne, Brisbane, Adelaide and Perth, and two different cables overseas", +"scenarios.broadband_in_sydney_melbourne_served":"Broadband in Sydney, Melbourne, Brisbane, Adelaide and Perth, two different cables overseas, and 500 Gbps served", "scenarios.cape_to_cairo":"Cape to Cairo", "scenarios.cape_town_build_a_network_across":"Cape Town. Build a network across Africa: every border wants its own permit, and half the power grids are not on your side.", "scenarios.cogentle_and_goggle_are_not_speaking":"Cogentle and Goggle are not speaking, and this time it is permanent. Buy the cheap transit if you dare.", +"scenarios.connect_panama_city_to_bogota_lima":"Bogotá, Lima, Santiago and São Paulo joined up to Panama City, and 150 Gbps served", "scenarios.deliver_carnaval_in_full":"Deliver Carnaval in full", "scenarios.every_cable_through_the_red_sea":"Every cable through the Red Sea is cut, and so is the hop to Egypt. Get Marseille talking to Singapore anyway: round Africa, overland, or the other way round the planet.", "scenarios.every_ix_is_run_by_de":"Every IX is run by DE-KICKS", @@ -3378,9 +3379,8 @@ "scenarios.mid_atlantic_accent":"Mid-Atlantic Accent", "scenarios.only_spatzle_ix":"Only Spätzle-IX", "scenarios.order_and_progress":"Order and Progress", -"scenarios.ponta_delgada_in_the_azores_halfway":"Ponta Delgada, in the Azores, halfway across the Atlantic. Florida to Spain and Lisbon to Lagos are just too long for a 1.6T wave: straight across, each carries 1.2T. Land on the islands in between, start the light fresh, and every hop runs at 1.6T or better. You start with 1.6T gear unlocked.", -"scenarios.pops_in_bogota_lima_santiago_and":"POPs in Bogotá, Lima, Santiago and São Paulo, and 150 Gbps served", -"scenarios.ports_on_15_ix_brrr_exchanges":"Ports on 15 IX.brrr exchanges, one of them in Manaus, and 200 Gbps served", +"scenarios.ponta_delgada_azores_lisbon_lagos":"Ponta Delgada, in the Azores, halfway across the Atlantic. Florida to Spain is just too long for a 1.6T wave: straight across, it carries 1.2T. Land on the islands in between, start the light fresh, and every hop runs at 1.6T or better. Lisbon to Lagos does 1.6T in one go, at a price: the Canaries are cheaper. You start with 1.6T gear unlocked.", +"scenarios.ports_on_15_ix_brrr_exchanges_backbone":"Ports on 15 IX.brrr exchanges your backbone joins to São Paulo, one of them in Manaus, and 200 Gbps served", "scenarios.reach_50_of_the_internet_and":"Reach 50% of the internet and serve 300 Gbps", "scenarios.red_sea_crisis":"Red Sea Crisis", "scenarios.rio_from_scratch_carnaval_starts_in":"Rio from scratch. Carnaval starts in 90 days and wants 400 Gbps for five days straight. The whole world is watching.", @@ -3393,7 +3393,7 @@ "scenarios.start_in_stuttgart_where_nobody":"Start in Stuttgart, where nobody sells transit. Reach the internet through peering, PNIs, caches and your own fiber only. No transit anywhere, ever.", "scenarios.start_with_only_100k":"Start with only $100k", "scenarios.sydney_2013_the_toilet_paper_group":"Sydney, 2013. The Toilet Paper Group ran its own fibre into apartment basements, and the national network cried cherry-picking. Your turn: skip the Nearly Broadband Network, pay the levy, and get there first.", -"scenarios.tallinn_ships_drag_their_anchors":"Tallinn. Ships drag their anchors over Baltic cables three times as often as usual.", +"scenarios.tallinn_nobody_sells_transit_anchors":"Tallinn, where nobody sells transit: your internet is across the water. Ships drag their anchors over Baltic cables three times as often as usual.", "scenarios.the_cogentle_spat":"The Cogentle Spat", "scenarios.transit_costs_30_more":"Transit costs 30% more", "scenarios.twice_the_failures":"Twice the failures", diff --git a/tests/modes.test.js b/tests/modes.test.js index 95ef1bd..92c56c8 100644 --- a/tests/modes.test.js +++ b/tests/modes.test.js @@ -299,12 +299,12 @@ test('#34 scenario goal, progress and customer level are always in view', () => ev("UI.left='goals';UI.leftOpen=true;UI.sel=null;renderAll()"); const left = () => dom.window.document.getElementById('leftBody').textContent; assert.match(left(), /Mind the Gap/); - assert.match(left(), /POP in Bogotá/); + assert.match(left(), /Bogotá on your network/); assert.match(left(), /days left/); assert.match(left(), /Customer level 1 of 13/); assert.equal(ev("$('hScn').hidden"), false, 'scenario chip in the top bar'); const f0 = ev('scnProg().f'); - ev("S.cash=1e8;ACT.buildPop({city:'bog'});ACT.buildPop({city:'lim'});compute();renderAll()"); + ev("S.cash=1e8;UI.via='pccs';openLinkModal('pan','bog');ACT.buildLink({tier:1});closeModal();compute();renderAll()"); assert.ok(ev('scnProg().f') > f0, 'progress moves when a goal step is reached'); assert.match(ev("$('hScnVal').textContent"), /%/); assert.match(ev("$('hTier').textContent"), /Lv 1/); @@ -361,8 +361,10 @@ test('Flood Season: attacks keep coming, grow, and only count when service held' for (let i = 0; i < 40; i++) { ev('dayTick()'); if (ev('ddosAll().some(a=>a.start===S.day)')) n++; } assert.ok(n >= 4, `attacks keep coming (${n} in 40 days)`); assert.ok(ev('(S.stats.ddosOk||0)+(S.stats.ddosLost||0)') >= 3, 'finished attacks are scored'); - // scoring: held only if service stayed at 97%+ - ev("S.stats.ddosOk=0;S.stats.ddosOkBig=0;S.stats.ddosLost=0;ddosDone({city:'ams',gbps:1500,worst:0.99});ddosDone({city:'ams',gbps:20,worst:0.5});ddosDone({city:'xyz',gbps:30,worst:1})"); + // scoring: held only if service stayed at 97%+, and a terabit one only with scrubbing or Flowspec + ev("S.stats.ddosOk=0;S.stats.ddosOkBig=0;S.stats.ddosLost=0;ddosDone({city:'ams',gbps:1500,vec:'http',worst:0.99})"); + assert.equal(ev('S.stats.ddosOk+S.stats.ddosOkBig'), 1, 'held, but no terabit credit without mitigation'); + ev("S.scrubs.push({city:'ams',tier:1});S.stats.ddosOk=0;S.stats.ddosOkBig=0;S.stats.ddosLost=0;ddosDone({city:'ams',gbps:1500,worst:0.99});ddosDone({city:'ams',gbps:20,worst:0.5});ddosDone({city:'xyz',gbps:30,worst:1})"); assert.equal(ev('S.stats.ddosOk'), 2); assert.equal(ev('S.stats.ddosOkBig'), 1); assert.equal(ev('S.stats.ddosLost'), 1); diff --git a/tests/puzzles.test.js b/tests/puzzles.test.js index de3ba39..1ba9ef3 100644 --- a/tests/puzzles.test.js +++ b/tests/puzzles.test.js @@ -18,7 +18,7 @@ const REF = { downunder: { one: [['syd', 'mel', 'land', 1], ['syd', 'bne', 'land', 1], ['mel', 'adl', 'land', 1]], three: [['syd', 'mel', 'land', 1], ['syd', 'bne', 'land', 1], ['mel', 'adl', 'land', 1], ['bne', 'adl', 'land', 1]] }, edgelord: { one: [['@rt', 'ams', 5, 1], ['@rt', 'lon', 5, 1], ['ams', 'lon', 'nshuttle', 2], ['ams', 'lon', 'circe', 1]], three: [['@rt', 'ams', 5, 1], ['@rt', 'lon', 5, 1], ['ams', 'lon', 'concerto', 2], ['ams', 'lon', 'nshuttle', 2], ['ams', 'lon', 'circe', 1]] }, hubcap: { one: [['@rt', 'lon', 5, 1], ['lon', 'par', 'pasdc', 1], ['lon', 'ams', 'concerto', 1], ['lon', 'ams', 'circe', 1], ['lon', 'ams', 'nshuttle', 1], ['lon', 'par', 'pasdc', 1], ['ams', 'fra', 'land', 1], ['ams', 'fra', 'land', 1]], three: [['@rt', 'lon', 5, 1], ['lon', 'par', 'chn', 1], ['lon', 'par', 'pasdc', 1], ['ams', 'fra', 'land', 1], ['lon', 'ams', 'concerto', 1], ['lon', 'ams', 'circe', 1], ['lon', 'ams', 'nshuttle', 1], ['lon', 'par', 'chn', 1], ['lon', 'par', 'pasdc', 1], ['ams', 'fra', 'land', 1], ['ams', 'fra', 'land', 1], ['lon', 'ams', 'uly', 1]] }, - flash: { one: [['nyc', 'lon', 'grace', 1], ['nyc', 'lon', 'hibx', 0]], three: [['nyc', 'lon', 'grace', 1], ['nyc', 'lon', 'hibx', 0]] }, + flash: { one: [['nyc', 'lon', 'hibx', 1]], three: [['nyc', 'lon', 'grace', 1], ['nyc', 'lon', 'hibx', 0]] }, baltic: { one: [['fra', 'hel', 'clion', 1], ['tll', 'hel', 'land', 1], ['@route', 1, 'fast']], three: [['fra', 'hel', 'clion', 1], ['tll', 'hel', 'land', 1], ['fra', 'tll', 'land', 1], ['@route', 1, 'fast']] }, fjord: { one: [['par', 'lon', 'pasdc', 1], ['svg', 'lon', 'tampn', 1], ['@route', 1, 'fast']], three: [['par', 'svg', 'land', 1], ['par', 'lon', 'pasdc', 1], ['svg', 'lon', 'tampn', 1], ['@route', 1, 'fast']] }, braces: { one: [['nyc', 'dub', 'havf', 1], ['lon', 'dub', 'celtix', 1]], three: [['nyc', 'lon', 'grace', 1], ['nyc', 'dub', 'havf', 1], ['lon', 'dub', 'celtix', 1]] }, @@ -530,3 +530,18 @@ test('a POP in a thin market costs its higher monthly rent too, and the panel sa assert.ok(ev("document.getElementById('panelBody').textContent").includes(ev("fmt$(popMo('suv'))") + '/mo')); assert.deepEqual(errors, []); }); + +test('each pack\'s idea is needed: three stars without it fail, and the one-star builds are not secretly three', () => { + const { ev, errors } = load(); + const stars = (id, steps) => { ev(`pzBegin(pzDef('${id}'))`); build(ev, steps); return evalP(ev).stars; }; + const packs = JSON.parse(ev('JSON.stringify(Object.fromEntries(PZ.map(p=>[p.id,p.pack])))')); + for (const id of Object.keys(REF)) { + // A ring puzzle's cheapest delivering build is a ring, which is already N-1. + if (id !== 'fire') assert.ok(stars(id, REF[id].one) < 3, `${id}: the one-star reference earns three stars`); + if (packs[id] === 'rodeo') assert.ok(stars(id, REF[id].three.filter((s) => s[0] !== '@rt')) < 3, `${id}: three stars on the starter routers`); + if (REF[id].three.some((s) => s[0] === '@route')) assert.ok(stars(id, REF[id].three.filter((s) => s[0] !== '@route')) < 3, `${id}: three stars without the routing choice`); + // N-1 Club: the brute-force answer (every one-star link doubled) is over budget or not N-1. + if (packs[id] === 'n1') assert.ok(stars(id, [...REF[id].one, ...links(REF[id].one)]) < 3, `${id}: doubling every link earns three stars`); + } + assert.deepEqual(errors, []); +}); diff --git a/tests/regions.test.js b/tests/regions.test.js index 0ae73fa..202def9 100644 --- a/tests/regions.test.js +++ b/tests/regions.test.js @@ -563,8 +563,10 @@ test('the Amazon doubles overland fiber, and there is a national-operator scenar assert.equal(ev('S.scn.id'), 'ixbr'); assert.equal(ev('brIxN()'), 0); ev("S.cash=1e9;for(const c of ['sao','rio','mao'])ACT.buildPop({city:c});S.ixp.sao=1;S.ixp.mao=1;compute()"); - assert.equal(ev('brIxN()'), 2); + assert.equal(ev('brIxN()'), 1, 'a Manaus port on a POP the backbone does not reach does not count'); assert.equal(ev("scnProg().items[1].v"), 1, 'Manaus step done'); + ev("S.links.push({id:'y1',a:'sao',b:'mao',km:2700,sub:false,kind:'wave',tier:0,mo:1});compute()"); + assert.equal(ev('brIxN()'), 2, 'joined up, it counts'); assert.deepEqual(errors, []); }); @@ -670,8 +672,10 @@ test('Fibre to the Basement: own fibre skips the wholesale cut but pays the levy assert.equal(ev("SCN.find(s=>s.id==='fttb').ok()"), false, 'still needs cables overseas'); ev("S.links.push({id:'x1',a:'syd',b:'tok',km:8000,sub:true,cable:'sushi',kind:'wave',tier:1,mo:1},{id:'x2',a:'per',b:'sin',km:4000,sub:true,cable:'avo',kind:'wave',tier:1,mo:1},{id:'x3',a:'mel',b:'hba',km:600,sub:true,cable:'ferry',kind:'wave',tier:1,mo:1})"); assert.equal(ev('auExits()'), 2, 'Bass Strait does not count as overseas'); + assert.equal(ev("SCN.find(s=>s.id==='fttb').ok()"), false, 'still needs the traffic'); + ev('R.served=FTTB_G'); assert.equal(ev("SCN.find(s=>s.id==='fttb').ok()"), true); - assert.equal(ev("SCN_PROG.fttb().length"), 6); + assert.equal(ev("SCN_PROG.fttb().length"), 7); assert.deepEqual(errors, []); }); diff --git a/tests/scenarios-playtest.test.js b/tests/scenarios-playtest.test.js new file mode 100644 index 0000000..47cd222 --- /dev/null +++ b/tests/scenarios-playtest.test.js @@ -0,0 +1,60 @@ +// Rule C1, played (gameplay-rules): every handmade scenario has a reference strategy (scripts/lib/scenario-ref.js, +// the player's own actions, a plan a sensible human would follow) that wins within its days, and the obvious shortcut +// does not. The win days below were recorded in the 2.0.0 playtest; a balance change that moves them far is a change +// in how the scenario plays, so look before you re-record. +const test = require('node:test'); +const assert = require('node:assert/strict'); +const { load } = require('./harness'); +const { play } = require('../scripts/lib/scenario-ref'); + +const HIRE = ['hire', ['transit', 'routers', 'repair', 'sales', 'ix']]; +const home = (c) => [['bb', c], ['tr', c, 1], ['ix', c]]; +// ref: the reference plan; win: [earliest, latest] day it may win on; cheese: the shortcut, and `by`, the day before +// which it must not win (null: never within the scenario's days). +const PLAY = { + stg: { ref: [['bb', 'stg'], ['ix', 'stg'], ['link', 'stg', 'fra', 1], ['ix', 'fra'], ['bb', 'fra'], ['link', 'fra', 'ams', 1], ['ix', 'ams'], ['bb', 'ams'], ['link', 'ams', 'lon', 1], ['ix', 'lon'], ['bb', 'lon'], ['link', 'fra', 'par', 1], ['ix', 'par'], ['bb', 'par'], ['hire', ['routers', 'repair', 'caches', 'pni', 'ix', 'sales'], { pni: { paid: true } }], ['link', 'stg', 'muc', 1], ['ix', 'muc'], ['bb', 'muc'], ['wait', 120], ['pnis'], ['link', 'lon', 'nyc', 2], ['ix', 'nyc'], ['bb', 'nyc'], ['wait', 200], ['pnis']], + win: [120, 240], cheese: [['bb', 'stg'], ['ix', 'stg'], ['link', 'stg', 'fra', 1], ['ix', 'fra'], ['bb', 'fra'], ['loans'], ['hire', ['routers', 'repair']]], by: null }, + // The other way round the planet: Paris, New York, Los Angeles, Tokyo, Hong Kong, Singapore. + redsea: { ref: [...home('mrs'), ['link', 'mrs', 'par', 1], ['bb', 'par'], ['ix', 'par'], ['link', 'par', 'nyc', 1, 'amitie'], ['tr', 'nyc', 1], ['ix', 'nyc'], ['link', 'nyc', 'lax', 1], ['ix', 'lax'], ['tr', 'lax', 1], ['link', 'lax', 'tok', 1, 'jup'], ['bb', 'tok'], ['tr', 'tok', 1], ['ix', 'tok'], ['link', 'tok', 'hkg', 1, 'apg'], ['bb', 'hkg'], ['tr', 'hkg', 1], ['ix', 'hkg'], ['link', 'hkg', 'sin', 1], ['bb', 'sin'], ['tr', 'sin', 1], ['ix', 'sin'], HIRE], + win: [100, 250], cheese: [...home('mrs'), ['loans'], ['link', 'mrs', 'sin', 1], ['bb', 'sin']], by: null }, + spat: { ref: [...home('nyc'), HIRE], avoid: ['cog'], win: [50, 140], cheese: [...home('nyc'), ['hire', ['routers', 'repair']]], by: 160 }, + carnaval: { ref: [...home('rio'), ['hire'], ['wait', 69], ['prep', 'rio', 400], ['wait', 76], ['prep', 'rio', 400], ['wait', 83], ['prep', 'rio', 400]], win: [95, 95], cheese: [...home('rio'), ['loans']], by: null }, + darien: { ref: [...home('pan'), ['link', 'pan', 'bog', 1, 'pccs'], ['bb', 'bog'], ['ix', 'bog'], ['link', 'bog', 'lim', 1], ['bb', 'lim'], ['ix', 'lim'], ['link', 'lim', 'scl', 1], ['bb', 'scl'], ['ix', 'scl'], ['link', 'scl', 'sao', 1], ['bb', 'sao'], ['tr', 'sao', 1], ['ix', 'sao'], HIRE], + win: [30, 90], cheese: [...['pan', 'bog', 'lim', 'scl', 'sao'].flatMap((c) => [['bb', c], ['tr', c, 1]]), ['hire']], by: null }, + c2c: { ref: [...home('cpt'), ['link', 'cpt', 'jnb', 1], ['bb', 'jnb'], ['tr', 'jnb', 1], ['ix', 'jnb'], ['link', 'jnb', 'nbo', 1], ['bb', 'nbo'], ['ix', 'nbo'], ['link', 'nbo', 'cai', 1], ['bb', 'cai'], ['ix', 'cai'], ['link', 'jnb', 'lag', 1], ['bb', 'lag'], ['ix', 'lag'], HIRE], + win: [70, 200], cheese: [...home('cpt'), ['link', 'cpt', 'cai', 0], ['pop', 'lag'], ['pop', 'nbo'], ['hire']], by: null }, + ixbr: { ref: [...home('sao'), ...[['sao', 'rio', 1], ['sao', 'cpq', 0], ['sao', 'cwb', 0], ['cwb', 'poa', 0], ['rio', 'bhz', 0], ['bhz', 'bsb', 0], ['bsb', 'gyn', 0], ['rio', 'ssa', 0], ['ssa', 'rec', 0], ['rec', 'for', 0], ['rec', 'nat', 0], ['for', 'bel', 0], ['bel', 'mao', 0], ['bsb', 'cgb', 0], ['sao', 'vix', 0]].flatMap(([a, b, t]) => [['link', a, b, t], ['ix', b, 0]]), ['bb', 'rio'], ['tr', 'rio', 1], ['bb', 'bsb'], ['tr', 'bsb', 1], ['bb', 'for'], ['tr', 'for', 1], HIRE], + win: [40, 120], cheese: [['bb', 'sao'], ['tr', 'sao', 1], ...['sao', 'rio', 'bsb', 'bhz', 'cwb', 'poa', 'for', 'rec', 'ssa', 'cpq', 'gyn', 'bel', 'mao', 'nat', 'vix', 'cgb'].flatMap((c) => [['pop', c], ['ix', c, 0]]), ['hire']], by: null }, + // Seoul at home is enough here: the cheese is just playing, so it only must not be instant. + gangnam: { ref: [...home('icn'), ['link', 'icn', 'tok', 1], ['ix', 'tok'], ['tr', 'tok', 1], ['link', 'icn', 'hkg', 1], ['ix', 'hkg'], ['tr', 'hkg', 1], HIRE], win: [50, 120], cheese: [...home('icn'), ['loans']], by: 50 }, + // Bigger routers bring Flowspec, which also takes floods: without a scrubbing center it takes twice as long. + flood: { ref: [...home('ams'), ['scrub', 'ams', 1], ['tr', 'ams', 1], HIRE], win: [80, 200], cheese: [...home('ams'), ['tr', 'ams', 1], ['loans']], by: 180 }, + fttb: { ref: [...home('syd'), ['link', 'syd', 'akl', 0, 'tasman'], ['link', 'syd', 'nou', 0, 'gond'], ...['mel', 'bne', 'adl', 'per'].flatMap((c) => [['bb', c], ['tr', c, 1]]), ['link', 'syd', 'mel', 1], ['link', 'syd', 'bne', 1], ['link', 'mel', 'adl', 1], ['link', 'adl', 'per', 0], HIRE], + win: [80, 200], cheese: [...['syd', 'mel', 'bne', 'adl', 'per'].map((c) => ['bb', c]), ['tr', 'syd', 1], ['link', 'syd', 'akl', 0, 'tasman'], ['link', 'syd', 'nou', 0, 'gond'], ['loans']], by: 60 }, + // Tallinn has no transit: over the water to Helsinki and Stockholm on two cables each way, and round by land to Riga. + baltic: { ref: [['bb', 'tll'], ['ix', 'tll'], ['link', 'tll', 'hel', 1, 'balt'], ['tr', 'hel', 1], ['link', 'tll', 'sto', 1, 'balt'], ['tr', 'sto', 1], ['link', 'tll', 'hel', 1, 'elisa'], ['link', 'tll', 'rix', 1], ['tr', 'rix', 1], ['hire', ['transit', 'routers', 'repair', 'ix']]], + win: [90, 200], cheese: [['bb', 'tll'], ['ix', 'tll'], ['loans']], by: null }, + // The 1.6T chains: grow the traffic first, then light every hop at once (a day-0 build also gets there, just). + pac: { ref: [...home('hnl'), ...home('lax'), ...home('syd'), ['link', 'lax', 'tok', 1, 'jup'], HIRE, ['served', 145], ['link', 'lax', 'hnl', 4, 'seaus'], ['link', 'hnl', 'suv', 4, 'scx'], ['link', 'suv', 'syd', 4, 'scx']], + win: [50, 120], cheese: [...home('hnl'), ...home('lax'), ...home('syd'), ['link', 'lax', 'tok', 1, 'jup'], ['link', 'lax', 'syd', 3, 'hwk'], ['loans']], by: null }, + atl: { ref: [['bb', 'pdl'], ['tr', 'pdl', 1], ...home('mia'), ...home('mad'), ...home('lis'), HIRE, ['link', 'mia', 'bda', 4, 'sol'], ['link', 'bda', 'pdl', 4, 'sol'], ['link', 'pdl', 'mad', 4, 'sol'], ['served', 90], ['link', 'lis', 'tci', 4, 'ace'], ['link', 'tci', 'lag', 4, 'twoaf'], ['bb', 'lag']], + win: [40, 120], cheese: [['bb', 'pdl'], ['tr', 'pdl', 1], ...home('mia'), ...home('mad'), ...home('lis'), ['link', 'mia', 'mad', 3, 'col3'], ['link', 'lis', 'lag', 3, 'equi'], ['loans']], by: null }, +}; + +test('C1 played: every scenario has a reference strategy and a shortcut that fails', () => { + const g = load(); + const ids = JSON.parse(g.ev('JSON.stringify(SCN.map(x=>x.id))')); + assert.deepEqual(Object.keys(PLAY).sort(), ids.slice().sort(), 'C1: every scenario has a reference strategy here'); +}); + +for (const [id, P] of Object.entries(PLAY)) { + test(`${id}: the reference wins in its days, the shortcut does not`, () => { + const g = load(); + const r = play(g.ev, id, P.ref, { avoid: P.avoid }); + assert.ok(r.won !== null, `${id}: the reference does not win (${JSON.stringify(r)})`); + assert.ok(r.won >= P.win[0] && r.won <= P.win[1] && (id === 'carnaval' || r.won <= r.limit * 0.75), `${id}: won on day ${r.won}, want ${P.win.join('-')} of ${r.limit}`); + const c = play(g.ev, id, P.cheese, { days: P.by || undefined }); + assert.ok(c.won === null, `${id}: the shortcut wins on day ${c.won}${P.by ? ` (before day ${P.by})` : ''}`); + assert.deepEqual(g.errors, []); + }); +}