Files
Neutron/docs/architecture.md
T

56 lines
3.6 KiB
Markdown

# Architecture
Use a single .NET 10 C# executable, Silk.NET.Vulkan for Vulkan 1.3 rendering,
SDL3 for platform windowing, input and audio. Linux x64 and Windows x64 are
equally required. Source is `src/GamePort/`; root executable csproj allows
`dotnet build` and `dotnet run` from GamePort. No runtime network dependencies.
Original assets stay in `../Original`. Python tools parse undocumented original
formats into generated scene resources under `artifacts/`. The modern application
loads these original-derived resources and big endian GAM entity data. Portable
asset resolution must handle Windows-authored case differences. Extraction must
retain material references, world coordinates, per-corner UVs and animation data;
triangulation/render-state approximations require explicit documentation.
`Assets/GamLevel.cs` independently decodes original gameplay records and exposes
player/startpoint/camera and other typed properties. Exact record bytes/unknown
types remain accessible; do not normalize unknown flags into invented semantics.
`tools/levels/gam.py` provides a lossless forensic reference and JSON export.
Renderer design follows original fixed-function needs, without PBR or invented
visual effects. A headless offscreen rendering path makes actual Vulkan image
verification possible without a desktop; this is distinct from SDL presentation.
Simulation implementation must follow recovered algorithms and timing. A generic
fly camera or rendered model alone does not satisfy the playable-scene requirement.
The completed foundation includes a single synchronous Vulkan renderer supporting
offscreen and SDL surface presentation, an independent SDL WAV stream, bounded
GAM/PNG/scene readers, and a retained-topology morph sampler. Prepared scene JSON
avoids a Python runtime dependency in native packages. Mesh draw ranges omit null
materials following the original renderer, while retaining their geometry. Default
normal atlas and morph transforms are supported by binary/duplicate-asset evidence.
`Game/LabSimulation` supplies the no-gadget walking/jump checkpoint, using recovered
speed/yaw/impulse/airborne/camera formulas. `FixedStepClock` supplies a deliberate
60Hz port policy independent of rendering; original invocation cadence remains
unverified. SDL events feed held keyboard/mouse state; focus/minimize clear input
and pause simulation, while C pauses for inspection and R resets the start area.
`SceneCollision` sweeps/slides a vertical capsule against retained original scene
triangles, including invisible proxies, and clips the chase camera with a sphere
sweep. Solver/masks/radius/pivot are explicit approximations. The physical position
is feet; a separate original-root height feeds camera math and standing mesh minimum
Y feeds visual placement. GAM/ASE data is preserved. There is no task/trigger engine.
Application/PreviewCharacterPlacement and PreviewAnimationLibrary keep inspection
policies available alongside the walking checkpoint. Inspector ground contact is a model-only offset
derived once from visible surfaces and the standing bind pose, with raw source
placement preserved. Clip selection displays actual still/moving state and does
not simulate walking/jumping actions. In walking mode, original idle/run/backpedal/
jump/fall clips follow simulation state. Looping, timing, transitions and the visual
floor-derived pivot still require original comparison and further recovery.
Subsystem implementation and validated ownership are documented in
`infrastructure.md`, `analysis/graphics.md` and `rendering.md` as they become
available. Persistent docs distinguish planned architecture from verified behavior.