diff --git a/CHANGELOG.md b/CHANGELOG.md index 738dc06..ecf661e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ All notable changes to this project are documented here. The project follows ## [Unreleased] +- Big POPs can now run up to 16 routers (#157). The standard cage still holds six: each router past that costs half again to install and adds rent for a cage extension. + ## [1.34.1] — 2026-10-27 - The game starts faster in Italian, Portuguese and French: their translations are about 40% smaller to download. diff --git a/site/i18n/fr.js b/site/i18n/fr.js index cc2a128..1e875f1 100644 --- a/site/i18n/fr.js +++ b/site/i18n/fr.js @@ -572,6 +572,7 @@ "city_panel.build_pop_cost_mo_mo":"Construire le POP {cost} + {mo}/mois", "city_panel.build_tier_cost_mo_mo":"Construire {tier} {cost} + {mo}/mois", "city_panel.buy_a_port_on_a_fabric":"Achète un port sur un fabric, puis commande des circuits virtuels vers tes autres POP ou vers un IX distant. Rapide et souple, mais tu partages leur fabric.", +"city_panel.cage_extension":"Extension de cage", "city_panel.carrying_g":"transporte {g}", "city_panel.carrying_g_per_site":"transporte {g} par site", "city_panel.cdns_put_free_cache_servers_inside":"Les CDN installent gratuitement des serveurs de cache dans ton POP. L’essentiel de leur trafic est alors servi ici même, sans transit ni port IX.", @@ -655,7 +656,9 @@ "city_panel.switch_to_on_demand_cheaper":"Passer à la demande moins cher", "city_panel.the_model_sets_your_fastest":"Le modèle détermine ton interface la plus rapide et ce que ce POP peut transmettre. Plus de routeurs, c’est plus de capacité et une meilleure résistance aux plantages.", "city_panel.the_nearly_broadband_network_keeps":"Le Nearly Broadband Network en garde {pct} pour le dernier kilomètre.", +"city_panel.the_standard_cage_holds_n_routers":"La cage standard accueille {n} routeurs. Chacun au-delà demande une extension : l'installation coûte 50 % de plus et {mo}/mois en plus pour l'espace et l'énergie.", "city_panel.this_chassis_takes_forever_to_boot":"Ce châssis met une éternité à booter : les plantages durent plus longtemps, et remplacer l’unique routeur d’ici prend 3 jours. Un second routeur masque le problème.", +"city_panel.this_pop_has_the_most_routers":"Ce POP a {n} routeurs, autant que le bâtiment peut alimenter. Passez à un modèle plus gros pour aller plus loin.", "city_panel.this_pop_is_down":"Ce POP est en panne", "city_panel.top_destinations_on_this_port":"Principales destinations sur ce port", "city_panel.transit_sellers_list":"Vendeurs de transit : {list}", diff --git a/site/i18n/it.js b/site/i18n/it.js index 4c0b658..2d0489d 100644 --- a/site/i18n/it.js +++ b/site/i18n/it.js @@ -572,6 +572,7 @@ "city_panel.build_pop_cost_mo_mo":"Costruisci POP {cost} + {mo}/mese", "city_panel.build_tier_cost_mo_mo":"Costruisci {tier} {cost} + {mo}/mese", "city_panel.buy_a_port_on_a_fabric":"Compra una porta su un fabric, poi ordina circuiti virtuali verso gli altri tuoi POP o verso un IX remoto. Veloce e flessibile, ma condividi il loro fabric.", +"city_panel.cage_extension":"Ampliamento della gabbia", "city_panel.carrying_g":"trasporta {g}", "city_panel.carrying_g_per_site":"trasporta {g} per sede", "city_panel.cdns_put_free_cache_servers_inside":"I CDN mettono server cache gratis dentro il tuo POP. Gran parte del loro traffico viene così servita direttamente qui, senza transit e senza porta IX.", @@ -655,7 +656,9 @@ "city_panel.switch_to_on_demand_cheaper":"Passa a on-demand più economico", "city_panel.the_model_sets_your_fastest":"Il modello decide la tua interfaccia più veloce e quanto può inoltrare questo POP. Più router aggiungono capacità e sopravvivono ai crash.", "city_panel.the_nearly_broadband_network_keeps":"La Nearly Broadband Network se ne tiene il {pct} per l’ultimo miglio.", +"city_panel.the_standard_cage_holds_n_routers":"La gabbia standard contiene {n} router. Ognuno in più richiede un ampliamento: l'installazione costa il 50% in più e paghi {mo}/mese in più per spazio ed energia.", "city_panel.this_chassis_takes_forever_to_boot":"Questo chassis ci mette una vita a fare il boot: i crash durano di più, e sostituire l’unico router qui richiede 3 giorni. Un secondo router lo nasconde.", +"city_panel.this_pop_has_the_most_routers":"Questo POP ha {n} router, tutti quelli che l'edificio riesce ad alimentare. Per crescere ancora passa a un modello più grande.", "city_panel.this_pop_is_down":"Questo POP è down", "city_panel.top_destinations_on_this_port":"Destinazioni principali su questa porta", "city_panel.transit_sellers_list":"Venditori di transit: {list}", diff --git a/site/i18n/pt.js b/site/i18n/pt.js index c422345..76cc019 100644 --- a/site/i18n/pt.js +++ b/site/i18n/pt.js @@ -572,6 +572,7 @@ "city_panel.build_pop_cost_mo_mo":"Construir POP {cost} + {mo}/mês", "city_panel.build_tier_cost_mo_mo":"Construir {tier} {cost} + {mo}/mês", "city_panel.buy_a_port_on_a_fabric":"Compre uma porta num fabric e depois peça circuitos virtuais para seus outros POPs ou para um IX remoto. Rápido e flexível, mas você divide o fabric deles.", +"city_panel.cage_extension":"Ampliação da gaiola", "city_panel.carrying_g":"levando {g}", "city_panel.carrying_g_per_site":"levando {g} por site", "city_panel.cdns_put_free_cache_servers_inside":"CDNs colocam servidores de cache grátis dentro do seu POP. A maior parte do tráfego delas é servida aqui mesmo, sem transit e sem porta de IX.", @@ -655,7 +656,9 @@ "city_panel.switch_to_on_demand_cheaper":"Mudar para on-demand mais barato", "city_panel.the_model_sets_your_fastest":"O modelo define sua interface mais rápida e quanto este POP consegue encaminhar. Mais routers somam capacidade e sobrevivem a crashes.", "city_panel.the_nearly_broadband_network_keeps":"A Nearly Broadband Network fica com {pct} disso pela última milha.", +"city_panel.the_standard_cage_holds_n_routers":"A gaiola padrão comporta {n} routers. Cada um a mais precisa de uma ampliação: a instalação custa 50% a mais e paga {mo}/mês extra em espaço e energia.", "city_panel.this_chassis_takes_forever_to_boot":"Este chassi demora uma eternidade pra dar boot: crashes duram mais, e trocar o único router daqui leva 3 dias. Um segundo router disfarça isso.", +"city_panel.this_pop_has_the_most_routers":"Este POP tem {n} routers, todos os que o prédio consegue alimentar. Para crescer mais, troque para um modelo maior.", "city_panel.this_pop_is_down":"Este POP está fora do ar", "city_panel.top_destinations_on_this_port":"Principais destinos nesta porta", "city_panel.transit_sellers_list":"Vendedores de transit: {list}", diff --git a/src/game/10-catalog/30-supply-chain.js b/src/game/10-catalog/30-supply-chain.js index f9cc122..d59b599 100644 --- a/src/game/10-catalog/30-supply-chain.js +++ b/src/game/10-catalog/30-supply-chain.js @@ -20,10 +20,13 @@ function hwCard(){if(!S||(S.day<=HW_FREE&&!hwShock()&&!hwLock()))return '';const ${s?`
${tr('city_panel.this_chassis_takes_forever_to_boot')}
`:''}${tr('city_panel.maxed_out_traffic_here_is_being')}
`:''} -${tr('city_panel.this_pop_has_the_most_routers',{n:RMAX})}
`:''}${rt>RCAGE?`${(p.rgen||0)>0?tr('city_panel.prices_include_p_back_for_the',{p:fmt$(tradeIn(p.rgen||0,rt))})+' ':''}${p.rupDay===S.day?tr('city_panel.new_routers_went_in_today_the')+' ':''}${rt>1?tr('city_panel.rolling_upgrade_one_router_at_a'):tr('city_panel.with_one_router_the_upgrade_needs')}
`:''}${rt>=2?tr('city_panel.a_crash_here_only_costs_one'):tr('city_panel.one_router_is_a_single_point')}
diff --git a/src/i18n/en.js b/src/i18n/en.js index bcc07fe..4dabfa8 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -573,6 +573,7 @@ "city_panel.build_pop_cost_mo_mo":"Build POP {cost} + {mo}/mo", "city_panel.build_tier_cost_mo_mo":"Build {tier} {cost} + {mo}/mo", "city_panel.buy_a_port_on_a_fabric":"Buy a port on a fabric, then order virtual circuits to your other POPs or to a remote IX. Fast and flexible, but you share their fabric.", +"city_panel.cage_extension":"Cage extension", "city_panel.carrying_g":"carrying {g}", "city_panel.carrying_g_per_site":"carrying {g} per site", "city_panel.cdns_put_free_cache_servers_inside":"CDNs put free cache servers inside your POP. Most of their traffic is then served right here, with no transit and no IX port.", @@ -656,7 +657,9 @@ "city_panel.switch_to_on_demand_cheaper":"Switch to on-demand cheaper", "city_panel.the_model_sets_your_fastest":"The model sets your fastest interface and how much this POP can forward. More routers add capacity and survive crashes.", "city_panel.the_nearly_broadband_network_keeps":"The Nearly Broadband Network keeps {pct} of it for the last mile.", +"city_panel.the_standard_cage_holds_n_routers":"The standard cage holds {n} routers. Each one past that needs a cage extension: it costs half again to install and {mo}/mo in extra space and power.", "city_panel.this_chassis_takes_forever_to_boot":"This chassis takes forever to boot: crashes last longer, and swapping the only router here takes 3 days. A second router hides it.", +"city_panel.this_pop_has_the_most_routers":"This POP has {n} routers, as many as the building will power. Swap to a bigger model to grow further.", "city_panel.this_pop_is_down":"This POP is down", "city_panel.top_destinations_on_this_port":"Top destinations on this port", "city_panel.transit_sellers_list":"Transit sellers: {list}", diff --git a/tests/routers-per-pop.test.js b/tests/routers-per-pop.test.js new file mode 100644 index 0000000..b0fe9d3 --- /dev/null +++ b/tests/routers-per-pop.test.js @@ -0,0 +1,41 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const { load } = require('./harness'); + +const start = "ACT.start({});S.cash=1e9;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'})"; + +test('#157 a POP can grow past six routers, with a cage extension', () => { + const { ev, dom, errors } = load(); + ev(start); + for (let i = 0; i < 5; i++) ev("ACT.addRouter({city:'fra'})"); + assert.equal(ev('S.pops.fra.routers'), 6); + const inCage = ev('routerCost(S.pops.fra.rgen||0,5)'), pastCage = ev('routerCost(S.pops.fra.rgen||0,6)'); + assert.ok(pastCage > inCage, 'the seventh router costs more to install'); + const cash = ev('S.cash'); + ev("ACT.addRouter({city:'fra'})"); + assert.equal(ev('S.pops.fra.routers'), 7, 'a seventh router goes in'); + assert.equal(cash - ev('S.cash'), pastCage); + ev('compute()'); + const withCage = ev('R.cost.pops'); + ev("S.pops.fra.routers=6;compute()"); + const without = ev('R.cost.pops'); + assert.equal(withCage - without, ev('ROUTER_MO+RG[S.pops.fra.rgen||0].mo+CAGE_MO'), 'the cage extension is billed monthly'); + ev("S.pops.fra.routers=7;compute()"); + assert.ok(ev('nodeCap("fra")') === ev('RG[S.pops.fra.rgen||0].cap*7'), 'every router adds forwarding'); + ev("UI.sel={k:'city',id:'fra'};renderAll()"); + assert.match(dom.window.document.body.innerHTML, /Cage extension/); + assert.deepEqual(errors, []); +}); + +test('#157 the cap stops at RMAX and saves keep their routers', () => { + const { ev, errors } = load(); + ev(start); + for (let i = 0; i < 30; i++) ev("ACT.addRouter({city:'fra'})"); + assert.equal(ev('S.pops.fra.routers'), ev('RMAX')); + assert.ok(ev('RMAX') > 6); + ev("const s=JSON.parse(JSON.stringify(S));s.pops.fra.routers=12;window.__t=migrate(s)"); + assert.equal(ev('__t.pops.fra.routers'), 12, 'a big POP survives a save round trip'); + ev("const s=JSON.parse(JSON.stringify(S));s.pops.fra.routers=999;window.__t=migrate(s)"); + assert.equal(ev('__t.pops.fra.routers'), ev('RMAX'), 'nonsense is clamped'); + assert.deepEqual(errors, []); +});