Add planet environment-extra materials to capex calcs; buildcost.py tool

Every building needs a planet-hazard material bundle on top of its normal
BuildingCosts (SEA for low pressure, HSE for high pressure, MGC for low
gravity, BL for high gravity, INS for cold, TSH for heat - area-scaled
where applicable), confirmed against live in-game build panels on Nike.
FIO's own BuildRequirements field is an unreliable superset across hazard
types, not a direct per-building list - don't use it directly.

- puga/planet.py::environment_extras(): the real threshold table.
- tools/buildcost.py: full construction material list for one building,
  optionally on a given planet.
- Wired into whatif.py/buy.py (via simulate(planet=...)) and scan.py's
  own bcost(), so their capex numbers stop silently omitting this.
- docs/mechanics.md: the rule, plus a separate forum-sourced note on the
  CX order-cancellation penalty.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 19:03:51 +02:00
co-authored by Claude Sonnet 5
parent 6bd5d6cc69
commit bf15c709ea
9 changed files with 153 additions and 12 deletions
+30
View File
@@ -75,6 +75,36 @@ storage fee - this only confirms placing the order doesn't require a prerequisit
that storage itself is free. Also still unconfirmed: FX conversion fee size (a forum thread titled
"remove FX transaction fee entirely" implies one exists, but no amount confirmed).
## Planet environment-extra materials (per community handbook, confirmed live against Nike)
FIO's `/planet/full/{id}` -> `BuildRequirements` lists a superset across hazard types and is NOT
a direct per-building material list - compute it instead from the planet's own Pressure/Gravity/
Temperature/Surface fields against these threshold rules (source: Prosperous Universe Handbook,
building-costs page):
| condition | extra material | quantity |
|---|---|---|
| rocky | MCG | area x 4 |
| gaseous | AEF | area / 3 |
| pressure < 0.25 atm | SEA | area x 1 |
| pressure > 2.0 atm | HSE | 1/building |
| gravity < 0.25g | MGC | 1/building |
| gravity > 2.5g | BL | 1/building |
| temp < -25C | INS | area x 10 |
| temp > 75C | TSH | 1/building |
Applies per building (construction AND repair), area-scaled rows use the building's own `AreaCost`.
Implemented in `puga/planet.py::environment_extras()`, used by `tools/buildcost.py` and wired into
`whatif.py`/`buy.py`/`scan.py`'s own capex numbers.
## CX order cancellation penalty (UNCONFIRMED numbers, forum-sourced)
Deleting too many unfilled/partially-filled CX orders on the same ticker within a day triggers a
fee (added per dev patch notes to deter bot-style requoting); a warning appears around the 4th
attempt. No confirmed threshold or fee formula - forum reports range from 3 to 5-6 cancels/ticker/
day, fee said to scale with order size. Effect: rate-limits requoting, so effective spreads widen
and top-of-book gets sticky/stale - chasing the top spot is still possible within the free
cancel budget (~3-5/ticker/day per forum reports), just be aware each reprice spends one of those
before the fee kicks in.
## HQ in game vs PRUNplanner's "HQ" flag (observed 2026-09-21)
- The HQ screen (level 1, base permits 1 / 2) shows "Efficiency gains: Electronics 20.0%", and 23.3% for the next level (permits 1 / 3). That is exactly the faction bonus formula (Antares electronics 5% x 2 x (3 - 2 x used/total)), so the HQ display is the faction bonus.
- PRUNplanner's plan flag "HQ" (x1.1 on every building) is NOT visible in live efficiencies (smelters 1.3361, HWP 1.0696 both match the model without it). Keep it off. The HQ upgrade adds a base permit and raises the faction bonus.