Heat Management
Heat is the throttle on sustained ship thrust. Pushing the engine builds heat; releasing thrust bleeds it off. Past the cap, the ship overheats and stalls — weapons go silent and the hull takes damage. The system trades short bursts of overdrive (faster top speed near max heat) against the risk of a forced cooldown lockout.
Heat lives on ship.heat and is a 0–100 scalar (a percentage of an implicit heatMax = 100, not a per-ship cap). It is updated every physics tick in engine/physics/movement.ts.
Lifecycle
| Phase | Trigger | Effect |
|---|---|---|
| Accumulate | playerInput.isThrusting true, game.phase === 'playing', not stalled, not under Star Power | Heat rises along a log curve scaled by ship.heatBurnRate |
| Decay (thermal rest) | Thrust released (or any non-thrust frame) | Heat falls at ship.heatCoolRate × ship.coolingAccel × dt; coolingAccel ramps from 1 toward CFG.HEAT_COOL_MAX (4) at CFG.HEAT_COOL_RAMP (2.5/sec) so cooling speeds up the longer you coast |
| Asymptote | ship.heat > 95 | Gain is crushed by (1 - (heat-95)/5)² so the last 5 % feels like molasses, with a HEAT_ASYMPTOTE_MIN = 0.3 %/s floor so the bar still creeps to 100 |
| Burnout | ship.heat >= 100 | ship.stalled = true; shield zeroed; hull takes CFG.HEAT_STALL_DMG × ship.burnoutSeverity damage; ship begins exponential spin (stallSpin 12–18 rad/s) |
| Cooldown lockout | ship.stalled === true | All weapon firing suppressed; weapon cooldowns still tick. Heat decays at 90 % of heatCoolRate. Velocity decays via hard-coded 0.88 per step. Smoke clouds spawn at (heat/100) × 40 clouds/sec |
| Recovery | ship.heat <= 0 during stall | stalled clears, stallSpin resets, control returns |
Accumulation curve
The gain rate is logarithmic, so the bar fills quickly off the line and slows as it climbs:
hP = heat / 100
hRate = (0.10 + 0.55 × (1 - ln(1 + hP × 12) / ln(13))) × 1.5
delta = ship.heatBurnRate × hRate × dt
Baseline heatBurnRate is 25 on the live ship object, fed from each ShipDef.heatBuildup (baseline 12) via bridge.ts (ship.heatBurnRate = cs.overheatBurn). Designers tune the per-hull number; the engine applies the log curve.
Heat boost (above-target speed)
Heat does not just punish — it rewards. Thrust output and the speed cap scale linearly with heat fraction:
heatMult = 1.0 + 0.35 × (heat / 100) // applied to thrust + maxSpeed
effectiveMax = ship.maxSpeed × heatMult × trailBoost × starBoost × phoenixBoost
At 0 % heat the ship runs at its rated maxSpeed; at 99 % it is +35 % faster and accelerates +35 % harder. This is the “above-target heat = speed bonus” loop — running hot is the fastest way to travel, and the design tension is whether the destination is closer than the stall point.
ship.heatSpeedTarget (default 80) and ship.heatBoostMult (default 2.0) are still set by bridge.ts from each ship’s ShipDef, but the current Physics.update uses the flat 1.0 + 0.35 × hP formula across all hulls — the per-hull boost curve was replaced with this linear shape (see the comment block “HEAT BOOST” in engine/physics/movement.ts).
Burnout consequences
When ship.heat >= 100:
Sig.fire('stall_start', …)emits for the effects system.ship.shield = 0(shield is wiped, not just disabled).- Hull damage:
max(1, hp - HEAT_STALL_DMG × burnoutSeverity).HEAT_STALL_DMG = 16;burnoutSeverityis per-ship (baseline 0.35–1.0). - Particle stack: 40 orange sparks, 30 black smoke, 15 brown smoke, plus
Juice.fire('shield_broken'). - Spin:
stallSpin = 12 + random()×6rad/s, decays at0.18^dtper frame. - Velocity is hard-clamped to 88 % per step (much more aggressive than normal drag) — the ship stops hard rather than coasting.
During the stall, weapons receive no fire commands (for (let wi = 0; wi < ship.weapons.length && !ship.stalled; wi++) in bridge.ts), but their internal cooldowns continue to tick so they are ready the instant the ship recovers. Smoke clouds emit at up to 40 per second while smoldering.
Gating: weapons vs movement
Heat affects the two subsystems differently.
- Movement — Continuous. Heat scales thrust and max speed up to +35 % at 99 % heat. Above 85 % heat, optional per-hull
heatShakeIntensityapplies continuous camera shake scaled by(hP - 0.85) / 0.15. - Weapons — Binary. Weapons fire normally at any heat level below 100 %. The moment the ship stalls, the weapon loop is fully skipped — no autofire, manual triggers are cleared, and the user sees nothing happen until heat reaches 0. Cooldowns still advance so weapons are ready on recovery.
This means there is no “weapons-only” heat cost. Heat is purely a function of thrust, and the lockout is an all-or-nothing consequence of letting it cap out.
Special states
- Star Power active —
ship.heatis force-set to 0 andcoolingAccelis reset to 1 every frame. No heat accumulation, no cooling concern — the heat bar is hidden behind the Star Power bar in the HUD. - Stalled — Heat cools at 90 % of
heatCoolRate(not full rate). Recovery is a deliberate forced rest, not a fast bail-out.
Key constants
| Constant | Value | Where |
|---|---|---|
HEAT_LOG_A | 12 | engine/physics/movement.ts |
HEAT_ASYMPTOTE_MIN | 0.3 %/s | engine/physics/movement.ts |
CFG.HEAT_DANGER | 0.85 | engine/core/config/_gameplay.ts — UI/effects danger threshold |
CFG.HEAT_STALL_DMG | 16 | engine/core/config/_gameplay.ts — base hull damage on burnout |
CFG.HEAT_COOL_RAMP | 2.5 | engine/core/config/_gameplay.ts — coolingAccel ramp rate |
CFG.HEAT_COOL_MAX | 4 | engine/core/config/_gameplay.ts — coolingAccel ceiling |
| Heat boost coefficient | 0.35 (linear) | engine/physics/movement.ts |
| Burnout HP floor | 1 | Hull damage cannot kill outright |
Per-ship knobs
Tuned in data/ships.ts (baseline shown):
| Field | Baseline | Role |
|---|---|---|
heatBuildup | 12 | Multiplier for log-curve gain (→ ship.heatBurnRate) |
heatCooldown | 40 | Heat lost per second when not thrusting (→ ship.heatCoolRate) |
heatCurve | 'linear' | Boost-curve shape (legacy; live engine uses linear for all hulls) |
burnoutSeverity | 0.35 | Multiplier on HEAT_STALL_DMG |
heatShakeIntensity | 0 | Continuous camera shake above threshold |
heatShakeThreshold | 0.85 | Heat fraction above which shake kicks in |
Source files
engine/physics/movement.ts— accumulation, cooling, boost math, burnout trigger, stall spin-down.engine/core/state.ts—ship.heat,heatBurnRate,heatCoolRate,heatSpeedTarget,heatBoostMult,coolingAccel,stalled,stallSpinfield defaults.engine/core/config/_gameplay.ts—CFG.HEAT_*constants.engine/bridge.ts— copiesShipDef.heatBuildup/heatCooldown/burnoutSeverityonto the live ship; suppresses weapon fire whileship.stalled; pushes theOVERHEATING/STALLEDHUD warnings.data/ships.ts— per-hullheatBuildup,heatCooldown,heatCurve,burnoutSeverity.