openOMSI GitHub Discord
Architecture

Docs / The project / Architecture

From content files to the screen

1 min readEdit this pagedocs/ARCHITECTURE.md

  1. Files. Every loader reads through omsi_cfg::vfs. Content roots and mounted .zip archives look the same, and file names resolve as Windows resolves them.
  2. Parsing. The format crates turn files into plain data: the map (omsi-map), its objects and splines (omsi-scenery), models (omsi-model, omsi-o3d), vehicles (omsi-vehicle), timetables, scripts (compiled by omsi-script).
  3. The map index. omsi-world indexes the whole map's splines and objects.
  4. Tiles. The streamer loads tiles around the camera and the player's bus. On the rayon pool each tile is parsed, its terrain and splines tessellated (omsi-geometry) and its object types loaded. Textures decode and compress on workers.
  5. The world the simulation reads. Tile ground, stop lists, obstacles and map facts are published as an immutable snapshot (omsi_sim::world_data::WorldData). Lanes and light programs go to the traffic through omsi_sim::handover::Inbox.
  6. Simulation. Each tick, omsi-sim advances vehicles, scripts, traffic, people and the timetable.
  7. View sync. omsi-app/src/view_sync/ turns simulation state into renderer instances (positions, animation matrices, materials, script textures, lights).
  8. Scene and render. omsi-scene holds the renderer-side world. omsi-render culls, records and draws, then the interface (omsi-ui) is drawn over it and the frame is presented.

Something wrong or missing? Fix it on GitHub or open an issue.

↑↓ to move↵ to open