Files
TeslaRel410/restoration/source410/BT/SENSOR.NOTES.md
T
CydandClaude Fable 5 3610ff1ecd BT410: entity simulation goes LIVE -- mission reaches RunningMission, mech + roster tick per-frame
The world now executes. Entity::Execute only PerformAndWatch's entities in
application state RunningMission, reached by two RunMissionMessages
(WaitingForLaunch->LaunchingMission->RunningMission). The 2nd is dispatched by
Player::ManageApplicationStatus when the launch fade expires -- but that only
runs inside PlayerSimulation, not the launch-phase HuntForDropZone. So the
player must switch Performance onto PlayerSimulation after it spawns.

- BTPLAYER.CPP DropZoneReplyMessageHandler: after CreatePlayerVehicle +
  InitializePlayerLink, choose the per-vehicle Performance by class -- Mech ->
  SetPerformance(PlayerSimulation)+SetScoringPlayerFlag; else CameraShipSimulation.
- BTPLAYER.CPP PlayerSimulation: chains the authentic base Player::PlayerSimulation
  (CalcRanking + ManageApplicationStatus + vehicle-pos copy + status service);
  console SCORE-delta flush deferred to the scoring wave.
- SENSOR.CPP SensorSimulation: minimal-safe partial (radarPercent = 1 -
  GetSubsystemDamageLevel, sensor healthy) so the roster tick path can't Fail
  once RunningMission engages. The heat/electrical gating awaits the power/heat
  sim wave (PoweredSubsystem/Generator/HeatSink/HeatWatcher *Simulation staged).

Verified: BT_MECH_LOG run reaches "[tick] roster live (first Sensor frame)",
two RunMissionHandler transitions, zero Fail/Exception. The mech is executed
each frame; its BODY Performance is still DoNothingOnce (real Mech::Simulate =
Phase 5.3, now the frontier).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 12:20:23 -05:00

40 lines
2.0 KiB
Markdown

# SENSOR.CPP — reconstruction notes
Built against the surviving 4.10 CODE header `CODE/BT/BT/SENSOR.HPP` (Sensor :
PoweredSubsystem). Attributes RadarPercent / SelfTest / BadVoltage chain
`PoweredSubsystem::NextAttributeID`.
## Reconstructed
- Ctor: primes radarPercent=1, selfTest=False, badVoltage=False and installs
`Sensor::SensorSimulation` as the per-frame Performance (unless the owner is a
replicant copy, which is console-driven).
- `TestClass` / `TestInstance` / `ResetToInitialState` / the shared-data statics.
## PARTIAL: Sensor::SensorSimulation (per-frame)
The authentic `SensorSimulation` (BT411 @004b1c4c) does, each frame:
1. `PoweredSubsystem::PoweredSubsystemSimulation(time_slice)` (power/voltage tick),
2. `radarPercent = RadarBaseline - GetSubsystemDamageLevel()`,
3. gate on the electrical Ready state (`badVoltage`, zeroes radar if not Ready),
4. gate on the heat state — Normal / Degradation (`radar *= 0.5`) / Failure
(radar 0, selfTest off).
Steps 1/3/4 depend on the **power/heat per-frame simulation chain that is not
yet reconstructed** — `PoweredSubsystem::PoweredSubsystemSimulation`,
`Generator::GeneratorSimulation`, `HeatSink::HeatSinkSimulation`,
`HeatWatcher::WatchSimulation`, `PowerWatcher::Simulation` are all staged
`Fail`. None of those are installed as Performances yet (only Sensor installs
one), so the roster otherwise ticks `DoNothingOnce`.
Until the power/heat wave, `SensorSimulation` runs the one reconstructed input
(step 2, using `MechSubsystem::GetSubsystemDamageLevel`, clamped ≥ 0) and
reports the sensor healthy (selfTest=True, badVoltage=False). This is a
**deliberately safe partial**: it keeps the engine's `Entity::PerformAndWatch`
roster-tick path alive (it must not `Fail`, or the whole per-frame simulation
aborts the frame the mission reaches RunningMission) while producing a real
radar-capability value. Deepen it with the power/heat simulation wave.
A gated one-shot (`BT_MECH_LOG`) logs the first Sensor frame — the marker that
the entity/roster simulation has engaged (RunningMission).