Oxygen Not Included Under the Hood: Native Sim DLL, Chore Priorities & Nav Costs

Oxygen Not Included Under the Hood: Native Sim DLL, Chore Priorities & Nav Costs

Engine & Tech Stack

  • Engine / language: Unity with C#; a separate native C++ simulation library ("Sim") handles element, gas, liquid and heat physics.
  • Map representation: a 2D cell grid where every cell stores an element, mass and temperature.

Core AI & Decision Making

  • Architecture: Duplicants run a priority-driven chore system: a global ChoreProvider / ChoreConsumer pairing.
  • Dispatch: each open chore is scored by chore-type priority × the colonist's personal priority × proximity, and the best-scoring reachable chore wins.

State Management & Data Architecture

  • Model: game logic lives in C# component behaviours; the heavy physics runs in the native Sim and is marshalled back to managed code each step.
  • Grid state: element/temperature/mass per cell is owned by the Sim, keeping thermodynamics consistent across the whole map.

Tick Scheduling & Performance Tricks

  • Fixed-step Sim: the native simulation advances on a fixed timestep (and off the main thread), decoupled from frame rate.
  • Staggering: chore evaluation and pathfinding are spread out so hundreds of buildings and duplicants don't recompute in one frame.

Pathfinding & Spatial Systems

  • Algorithm: grid A* through a Navigator that understands per-navtype costs: walking, ladders, poles, tubes and suits.
  • Spatial updates: the navigation grid is rebuilt locally as the colony builds, so reachability tracks construction in real time.

Follow us on social media for updates