# Reconstruction evidence and remaining work

> Historical pre-implementation inventory. The remaining-work tables below
> describe that investigation checkpoint, not the current playable engine.
> The native C++ reconstruction now connects campaign progression, both cities,
> tunnels, Nightmare, software rendering and FM audio. Current implementation
> coverage and limits are maintained in the separate engine repository's
> [campaign status](https://github.com/Lost-Engines/darker-cpp/blob/master/docs/campaign_status.md)
> and [release readiness](https://github.com/Lost-Engines/darker-cpp/blob/master/docs/release_readiness.md).


This is a working index for the two separately planned engine stages, not a claim of full decompilation. Extracted assets and native differential fixtures should remain distinct from runtime approximations in the viewers.

| Area | Recovered evidence / useful entry points | Remaining integration |
|---|---|---|
| Resource loading and assets | [Resource/city layout](resources-and-city.md), [models](model-bytecode.md), [geometry variants](model-animation-and-states.md), [gameplay definitions](gameplay-definitions.md) | Complete consumer coverage; original ownership/lifetimes and loader reset contracts |
| Audio | [Hardware variants](music-hardware-variants.md), [effects](sound-effects.md), [combined recipes](combined-effect-audio.md) | Live voice allocation, music/effect competition, Doppler/spatial mixing and pause clocks |
| Interface and text | [HUD](dynamic-hud.md), [procedural graphics](procedural-hud.md), [formatted text](hud-and-formatted-text.md) | Full radar traversal/visibility, stereo rendering and integration with real game state |
| Mission setup | [Native setup](mission-native-setup.md), [callbacks](mission-callbacks.md), [reserve queues](mission-activation.md) | Runtime mutations after setup and real callback interleaving |
| Mission execution | [Scheduler](mission-scheduler.md), [update ordering](mission-update-order.md), [completion](object-completion.md) | Native exit/commit branching now checked; combat-to-expiry causes and complete progression/save/load in one real scenario remain |
| Supply pads | [Locations](supply-pad-locations.md), [re-entry](supplementary-scripts.md), [combined trace](combined-supply-cycle.md) | Attitude/collision/live controls and other actors; existing native script, weapons and shield effects are checked |
| Lighting/blackouts | [Charge arithmetic](flight-physics-and-charging.md), [blackout replay](blackout-missions.md) | Conditional triggering, prior persisted darkness, Nightmare challenge objective-driven phases and charging-buffer explanation of low meter readings |
| Building state | [State variants](model-animation-and-states.md), [persistent fields](persistent-cell-state.md) | Eligible-type census, full variant regeneration and high-bit templates now checked; repair/reset policy and tunnel-specific persistence remain |
| Flight and impacts | [Player collision/damage](player-collision-and-damage.md), [angular and impact arithmetic](flight-angular-and-impact.md), [linear motion/charging](flight-physics-and-charging.md) | Full craft callbacks, input smoothing and continuous trajectories; isolated native geometry-to-crash and shield/damage paths now checked |
| Ground routes | [Executed routes](vehicle-routes-and-events.md) | [Convoy discrepancy](route-convoy-discrepancy.md): isolated motion vs stable full-game capture remains unresolved |
| Rendering/presentation | [Components](model-components-and-aliases.md), [effects](effect-recipes.md), [presentations](presentations-and-interface.md) | Complete world visibility/sorting, clipping/raster contracts, camera/stereo and complete cutscene sequencing |

## Native fixtures added in this pass

- `trace_blackouts.py`: actual supplementary blackout script, messages and fades against Delphi map; visual replay and JSON.
- `verify_blackout_queues.py`: nine mission queues, 118 coordinate consumptions, native setup binding and exit application.
- `verify_object_completion.py`: six two-object lifecycle/counter-to-player-wait cases.
- `verify_light_source_types.py`: all 256 type bytes through the charging source routine; only type 1 accepted.
- `verify_persistent_cell_state.py`: packed state bits 20h/40h and ordinary restoration, excluding later variant rebuilding.

## Corrections to preserve in future work

- `initial_beacon_sequence` is a historical export name. Setup binds the queue; individual script commands consume it, and the exit path applies the whole list. Do not initialize all queued towers as dark solely from that field.
- Supply context-swap continuations are executable restart jumps. Decoding must include their deferred paths, not stop permanently at the swap.
- A shared blackout leaves (72,126) untouched from a full map. Special selection 4 starts the Nightmare challenge at 04_015/0, with different staged dimming/restoration operations; it is not the final campaign mission.
- A viewer's whole-command coverage is not a runtime state snapshot, and a native fixture with supplied conditions is not a recorded playthrough.

## Recommended next investigation order

1. Run one partial-power mission with explicit, source-justified object completion inputs through messages, partial failures and completion. Extend it into the exit/save path.
2. Persistent-state eligibility and native restore/retry transitions are now checked; extend to outer-menu save/load integration.
3. Expand the Nightmare challenge into objective-separated beacon phases; preserve direction reversals and actor dependencies.
4. Establish full clock/pause contracts and camera/visibility ordering before treating isolated flight/render routines as an engine specification.
5. Revisit the convoy through a stable full-game execution capture. Do not alter its route decoder merely to make the plotted paths look plausible.

The faithful C++ implementation remains a separately planned stage using original assets and arithmetic. The later browser engine with modernized assets remains separate as requested; neither has been started by these analysis changes.

## Save-file viewer/editor

[Offline viewer/editor](../analysis/saves/index.html) and [verified normal save format](save-file-format.md) are now available. Native file read/write and checksum tests pass. The editor preserves unknown fields and exports a separate copy; normal-size files only. Complete menu-driven save/load, record creation/name editing and the alternate executable-loading path remain outside scope.

## Current next steps

- Extend the [combined flight/collision traces](../analysis/flight-physics/index.html) from controlled airborne starts to live input production, craft startup/landing and real mission setup.
- Connect projectile/object damage, expiry, objectives and exit into one complete scenario trace.
- Resolve the remaining Nightmare phases, full renderer visibility/raster contracts, spatial audio/voice allocation, and the parked convoy discrepancy.
- Keep unknown save-record fields explicit; do not infer their meaning from zero-filled examples.

Neither C++ engine stage has been started.
