> ## Content Index
> Fetch the complete content index at: https://simstructures.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Oxygen Not Included Under the Hood: Native Sim DLL, Chore Priorities & Nav Costs
- URL: https://simstructures.com/oxygen-not-included-under-the-hood/
- Published: 2026-08-31T17:11:33.000Z
- Updated: 2026-09-01T13:41:50.000Z
- Description: How ONI runs cell-accurate thermodynamics for a whole asteroid: a native C++ simulation DLL under Unity/C#, a priority-scored chore system, and per-navtype A*.
- Author: ENGN GAME STUDIO LLC
- Tags: Oxygen Not Included, Articles

### 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.