openOMSI GitHub Discord

Docs / The project / Architecture

Crates

2 min readEdit this pagedocs/ARCHITECTURE.md

The workspace is layered; scripts/arch-guard.sh (rules in scripts/arch-rules.txt, run on every pull request) keeps each crate off the layers above it, and no pull request may grow omsi-app by more than a few hundred lines. Bottom up:

Layer Crates What they hold
base omsi-cfg, omsi-ui text files, the virtual file system, settings, the OMSI_* flag registry, the panic guard; interface drawing and the immediate-mode widget kit (omsi_ui::kit, theme) the pause menu, photo mode and developer tools are drawn with
formats and content omsi-o3d, omsi-texture, omsi-model, omsi-map, omsi-scenery, omsi-vehicle, omsi-timetable, omsi-content, omsi-script, omsi-geometry, omsi-world files in, plain data out; the map-wide index and the placement of attached objects (omsi-world)
simulation omsi-sim vehicles (vehicle/ by subsystem), scripts' host (host/), AI traffic, people, timetable, physics; no renderer, audio, texture decoder or network: pictures and HTML pages come through hooks the game registers (image_decode, htmltex::set_backend)
beside the simulation omsi-htmlengine, omsi-weather, omsi-career the [htmltexture] engine; the weather and season models; the driver's career and real-time mode
presentation omsi-render, omsi-audio, omsi-soundscape, omsi-photo, omsi-scene the renderer (gpu/, resources/, scene/, lighting/, frame_plan, shader parts); the mixer; ambience, scenery sounds and the radio; photo mode's lens and darkroom; the scene: loaded content turned into renderer data
devices and services omsi-input, omsi-xr, omsi-net, omsi-lan, omsi-voice (voice chat: microphone, Opus, jitter buffer, radio shaping; the relay is omsi-net::voice_net, see docs/VOICE.md), omsi-serverlist (the public server list: moderation, registration, the launcher's view), omsi-platform, omsi-plugin, omsi-plugin-ui controllers, force feedback, head tracking, key names; OpenXR; the LAN transport and the game-side session; updater, Discord, the presence count, version stamp; plugin hosting and its UI
launcher omsi-launcher-core, omsi-launcher-api, omsi-launcher-model the launcher's data side; the page's commands (desktop launcher and Android's web view); the window-free model the Swift launcher works on (state, the map as data), asking the game through omsi_launcher_model::host::Host. The launcher's window is launcher/ (Tauri, a workspace of its own)
app omsi-app the glue: App and its field groups, the frame (frame_stages: one declared list of stages for the window and one for the offscreen run, one runner), view sync, the adapters that hold the crates' state in App

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

↑↓ to move↵ to open