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

PhaseTriggerEffect
AccumulateplayerInput.isThrusting true, game.phase === 'playing', not stalled, not under Star PowerHeat 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
Asymptoteship.heat > 95Gain 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
Burnoutship.heat >= 100ship.stalled = true; shield zeroed; hull takes CFG.HEAT_STALL_DMG × ship.burnoutSeverity damage; ship begins exponential spin (stallSpin 12–18 rad/s)
Cooldown lockoutship.stalled === trueAll 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
Recoveryship.heat <= 0 during stallstalled 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; burnoutSeverity is 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()×6 rad/s, decays at 0.18^dt per 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 heatShakeIntensity applies 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 activeship.heat is force-set to 0 and coolingAccel is 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

ConstantValueWhere
HEAT_LOG_A12engine/physics/movement.ts
HEAT_ASYMPTOTE_MIN0.3 %/sengine/physics/movement.ts
CFG.HEAT_DANGER0.85engine/core/config/_gameplay.ts — UI/effects danger threshold
CFG.HEAT_STALL_DMG16engine/core/config/_gameplay.ts — base hull damage on burnout
CFG.HEAT_COOL_RAMP2.5engine/core/config/_gameplay.tscoolingAccel ramp rate
CFG.HEAT_COOL_MAX4engine/core/config/_gameplay.tscoolingAccel ceiling
Heat boost coefficient0.35 (linear)engine/physics/movement.ts
Burnout HP floor1Hull damage cannot kill outright

Per-ship knobs

Tuned in data/ships.ts (baseline shown):

FieldBaselineRole
heatBuildup12Multiplier for log-curve gain (→ ship.heatBurnRate)
heatCooldown40Heat lost per second when not thrusting (→ ship.heatCoolRate)
heatCurve'linear'Boost-curve shape (legacy; live engine uses linear for all hulls)
burnoutSeverity0.35Multiplier on HEAT_STALL_DMG
heatShakeIntensity0Continuous camera shake above threshold
heatShakeThreshold0.85Heat fraction above which shake kicks in

Source files

  • engine/physics/movement.ts — accumulation, cooling, boost math, burnout trigger, stall spin-down.
  • engine/core/state.tsship.heat, heatBurnRate, heatCoolRate, heatSpeedTarget, heatBoostMult, coolingAccel, stalled, stallSpin field defaults.
  • engine/core/config/_gameplay.tsCFG.HEAT_* constants.
  • engine/bridge.ts — copies ShipDef.heatBuildup/heatCooldown/burnoutSeverity onto the live ship; suppresses weapon fire while ship.stalled; pushes the OVERHEATING/STALLED HUD warnings.
  • data/ships.ts — per-hull heatBuildup, heatCooldown, heatCurve, burnoutSeverity.