Docs / The project / Architecture
Target layering
Where the code is going (new code follows it, refactors move old code towards it):
- Parsers (
omsi-cfg,omsi-script,omsi-o3d,omsi-model,omsi-scenery,omsi-map,omsi-vehicle,omsi-timetable,omsi-content): files in, plain data out. No GPU, no clock, no global state; each one testable on byte buffers. - Simulation (
omsi-sim: vehicles,ai_traffic(TrafficSim),people(PeopleSim),timetable_run(ScheduleSim), physics, scripts): advances the world by a time step. Knows nothing of the GPU or the window: it can run headless, in tests and on a server, and two runs with the same seed and inputs give the same states. - View sync: the one place that turns simulation state into renderer instances (positions, animation matrices, materials, script textures, lights) and tells the renderer what changed. Simulation code does not call the renderer, and the renderer does not read simulation types.
- Render (
omsi-render,omsi-texture,omsi-geometryfor the meshes): draws what it is given. It owns the GPU and nothing of the game.
omsi-app is the frame pipeline that runs these as phases in a fixed order - input,
simulation step, view sync, render, present - for both the window and the offscreen run,
so --offscreen exercises the same code as the game. A phase is a function with explicit
inputs and outputs rather than a stretch of a long event handler.
Debug flags (OMSI_DEBUG_*, OMSI_NO_*, the checks behind environment variables) are
read once, through one registry that names each flag, its meaning and its type, instead of
env::var calls scattered through the code, so the list in docs/USER_GUIDE.md can be
checked against it.
Something wrong or missing? Fix it on GitHub or open an issue.