Pie in the Sky, the early game: a pace forecast on the Launch tab, patchy-sky customers before 40%, a hint to wait on dishes

- Launch tab: each crust being filled says when it is full at today's pace (piePace: the pads that reach it, one launch per
  leadDays(gap) each with the rocket last queued or the fastest available, capped by the factory with the shelf and the
  queue as a buffer). Past two years and pad-bound, one nudge for another pad at the coastal POP nearest the equator,
  with a build button (piePadTip).
- Patchy-sky customers (60-features/99-pie-patchy.js): a revenue line in pieMoney, no flows, so routing is unchanged and
  games without a rocket company never see it. Up to $30M/mo for Shortcrust (scaled by crust size), ramping from 10% to
  40% coverage with one working dish under the crust, then times (1 - pieCarry) so it hands over to regular orbit
  customers by 60%. Shown on the Traffic tab; booked in S.pie.book like all orbit income.
- Dishes tab: under 30% coverage, a gentle note that dishes earn nothing yet and cost money every month.
- Payback on the O7 run is unchanged at one decimal (seed 7: 7.2 years, seed 11: 8.2).
This commit is contained in:
Frederic Jung 2026-11-05 16:27:13 +01:00
parent 267f9efc72
commit 7001174d79
No known key found for this signature in database
15 changed files with 272 additions and 5 deletions

View file

@ -73,6 +73,19 @@ function pieQuote(rk,cr,o={}){const P=S.pie;if(!P||!own(ROCKETS,rk)||!own(CRUSTS
// The cheapest a crust can be filled from nothing (one-off costs only): rule O7.
function pieFullCost(cr){const C=CRUSTS[cr],base=PIE_CO+PIE_FAC+PIE_PAD,pies=C.full*PIE_PIE;
return base+pies+Math.min(...Object.keys(ROCKETS).map(rk=>{const R0=ROCKETS[rk],n=Math.ceil(C.full/R0.pies);return (R0.rd?PIE_RD[R0.rd].cost:0)+(n+(rk==='heavy'?PIE_HEAVY_TESTS:0))*R0.cost;}));}
/* The Launch tab's forecast: how long until crust cr is full at today's pace, or null (no factory, no pad that reaches it,
no rocket). The rocket is the one last queued for it, else the one that lifts most a day. Each pad flies one every
leadDays(gap) (pieLaunch sets pad.next), so the pads lift pies/gap a day each; the factory adds PIE_FAC_MONTH a month,
and pies on the shelf and in the queue let the pads outrun it until they are gone. Wear and failures are left out:
it says "about". pad: true when the pads, not the factory, set the pace (another pad would help). */
function piePace(cr){const P=S.pie;if(!P||!P.fac||!own(CRUSTS,cr))return null;const need=Math.max(0,CRUSTS[cr].full-pieLive(cr)),pads=P.pads.filter(p=>piePadOk(p.city,cr)).length;if(!pads)return null;
const use=rk=>pieRkOk(rk)&&!(rk==='heavy'&&pieTests()<PIE_HEAVY_TESTS),rate=rk=>ROCKETS[rk].pies/leadDays(ROCKETS[rk].gap);
const L=P.q.filter(x=>x.cr===cr&&!x.test).sort((a,b)=>b.day-a.day)[0],rk=L&&use(L.rk)?L.rk:Object.keys(ROCKETS).filter(use).sort((a,b)=>rate(b)-rate(a))[0];if(!rk)return null;
const rp=pads*rate(rk),rf=PIE_FAC_MONTH/30,st=P.stock+P.crusts[cr].queued;let days;
if(rp<=rf)days=need/rp;else{const t=st/(rp-rf);days=need<=rp*t?need/rp:t+(need-rp*t)/rf;}
return {days:Math.ceil(days),rk,mo:Math.round(Math.min(rp,rf)*30),pad:rp<=rf};}
// Where another pad would help crust cr most: the coastal POP nearest the equator that has none and reaches it.
function piePadTip(cr){const P=S.pie;return Object.keys(S.pops).filter(c=>!P.pads.some(p=>p.city===c)&&piePadOk(c,cr)).sort((a,b)=>Math.abs(CITY[a].lat)-Math.abs(CITY[b].lat)).find(pieCoast)||null;}
function pieCohort(cr,n,las){const c=S.pie.crusts[cr],m=Math.floor(S.day/30),k=c.cohorts.find(x=>x.las===las&&Math.floor(x.day/30)===m);if(k)k.n+=n;else c.cohorts.push({n,day:S.day,las});
if(c.cohorts.length>PIE_COHORTS)c.cohorts.splice(0,c.cohorts.length-PIE_COHORTS);}
// A launch: every one costs a party; a test always ends in a fireball; the rest fail by the rocket's odds and the chaos rule,

View file

@ -0,0 +1,21 @@
/* ---------- Pie in the Sky: patchy-sky customers (docs/plans/pie-in-the-sky.md) ----------
Before a crust carries anything (under PIE_RAW, rule O2), a few customers already pay for a sky with gaps: buoys, ships'
mail, cattle tags and weather stations that store their data and send it when a pie passes. They need no routed capacity,
so they are a revenue line in pieMoney(), never a flow: routing is unchanged, and so is every game without pies.
A crust earns PIE_PATCHY_MO (scaled by its size, Shortcrust's g as 1) x a share that grows from PIE_PATCHY_LO to PIE_RAW
coverage, with at least one working pie dish under it. From PIE_RAW they hand over to the real orbit customers: the
line shrinks as pieCarry() grows and is gone at PIE_BAKED, so the two are never paid for the same sky in full. */
const PIE_PATCHY_MO=30e6,PIE_PATCHY_LO=0.1;
// The Dishes tab's hint shows while every crust is under PIE_DISH_WAIT; the Launch tab nudges for a pad past PIE_PACE_SLOW days.
const PIE_DISH_WAIT=0.3,PIE_PACE_SLOW=720;
// Names for the Traffic tab, shown as more of the sky fills (puns, never real companies).
const PIE_PATCHY_NAMES=['Store and Forward Thinking','Buoy Meets Girl Telemetry','Ship Happens Mail','Moo-ving Target Cattle Tags','Whale Hello There Research','Weather or Not Stations','Better Late Than Never Post','Tide Me Over Buoys'];
// The share of PIE_PATCHY_MO crust id earns today (0..1): a ramp up to PIE_RAW, then handed over to pieCarry().
function piePatchyShare(id){return clamp((pieCov(id)-PIE_PATCHY_LO)/(PIE_RAW-PIE_PATCHY_LO),0,1)*(1-pieCarry(id));}
// $/mo from patchy-sky customers, per crust and in total: {mo, cr:{id:$}}. ds: pieDishes() of this compute.
function piePatchy(ds){const P=S.pie,o={mo:0,cr:{}};if(!P||P.safe||!ds.length)return o;
for(const id in CRUSTS){if(P.crusts[id].down>S.day)continue;const f=piePatchyShare(id);if(!(f>0)||!ds.some(d=>pieCovers(id,d.city)))continue;
const v=Math.round(PIE_PATCHY_MO*CRUSTS[id].g/CRUSTS.short.g*f);o.cr[id]=v;o.mo+=v;}
return o;}
// How many of the names to show for mo $/mo: one per few $M, at least one.
const piePatchyN=mo=>clamp(Math.ceil(mo/4e6),1,PIE_PATCHY_NAMES.length);