Cell-based world streaming for Unity — stream the view, keep the logic resident.
Horizon streams static presentation content (meshes, colliders, terrain) in and out of grid cells around a moving player or vehicle, while your gameplay logic (simulation, networking, persistent state) stays in the always-loaded scene. It ships with a bake-free iteration mode, a non-destructive bake pipeline, a dynamic-object freeze/thaw ledger, and a polished editor toolset.
- Two modes, one workflow — Virtual mode streams unbaked content via
SetActivefor zero-friction daily iteration; Baked mode streams Addressables cell scenes for the real build. Auto-selected, or force either. - Non-destructive bake — your authoring scene stays the source of truth. The bake writes cell scenes, an Addressables group, a manifest and a report; a build processor strips the source at build time.
- Source-driven solver —
desired/keep(hysteresis) /criticalsets from load/unload/critical radii. The same solver runs in the editor preview, at runtime, and in tests. - Predictive corridor requests — feed it a path (e.g. a rail spline) and it preloads cells ahead along travel, not just a radius.
- Dynamic-object ledger — objects freeze to a record when their cell unloads and thaw at the same pose/state when it returns. Networking-agnostic core with an optional multiplayer adapter hook.
- Terrain tiler — splits oversized terrains into grid-aligned tiles (heightmap / alphamap / detail / trees / holes) with neighbor LOD stitching.
- Bake processors — pluggable per-cell steps: GPU-instanced scatter, shader warmup, budget linting, mesh combining.
- Polished editor tooling — a dedicated window, custom inspectors, and a scene-view overlay (grid heat, radius rings, live cell state).
Unity Package Manager → Add package from git URL:
https://github.com/OxygenButBeta/O2.Horizon.git
Window → Package Manager → + → “Add package from git URL…” → paste → Add.
To pin a version, append a tag: ...O2.Horizon.git#v0.1.0
Recommended: install Addressables (
com.unity.addressables) for baked builds. Horizon detects it automatically (O2_ADDRESSABLES); without it, Virtual mode and baking still work, but baked cell scenes must be added to Build Settings manually.
- Create the root —
GameObject → O2 → StreamWorld. Its position is the grid origin;CellSizedefaults to 256 m. - Attach content — parent your static content under it, or drag transforms into the
ContentRootslist without reparenting. Keep only static meshes + stateless local scripts under it;NetworkObject/ non-kinematicRigidbodyare flagged as bake errors. Mark distant always-visible content withStreamableOverride.AlwaysResident. - Add a source — put
StreamSourceon the camera (mark itCritical) and on any tracked vehicle. - Press Play — with content present it streams in Virtual mode automatically. No bake required.
- Ship it — hit Bake World in the inspector (or the window) before building.
| Surface | Where | What |
|---|---|---|
| Streamer window | Tools → O2 → Horizon World Streamer |
Bake, cell table, bake report, live stats, preview toggles |
| StreamWorld inspector | the StreamWorld object | Bake, status, settings, terrain splitting |
| WorldLedger inspector | the WorldLedger object | Catalog status, rebuild, live freeze/thaw counters |
| Scene-view overlay | Scene view ⋮ → “Horizon Streamer” |
Toggle grid / occupancy heat / source simulation / radius rings |
Status is shown as color-coded pills across every surface: VIRTUAL / BAKED, UP TO DATE / STALE / UNBAKED, RUNNING. Bake staleness is tracked automatically from a content hash.
StreamWorld— the scene root; grid origin + cell size, mode, manifest, bake processors.StreamSource— anything that pulls cells in (camera, player, vehicle); optionalCriticalbypasses the load budget.StreamSetSolver— computes desired/keep/critical cell sets from radii with hysteresis.WorldStreamerCore— state machine + per-frame load/unload budget;Pin/Unpinto lock cells (e.g. remote active physics).ICellRequestProvider— feed custom cell requests (predictive corridors, quest areas).WorldLedger— freeze/thaw for dynamic objects; identity = source prefab GUID via a generated catalog.
- Unity 2022.3 LTS or newer (developed on Unity 6). Uses UI Toolkit editor APIs (
MultiColumnListView, column sorting). - Addressables recommended for baked builds (optional; feature-detected).
Ships with an EditMode test suite (O2.Horizon.Tests) covering grid math, the solver (hysteresis / prediction / pins), the core state machine, the cell assigner, and the ledger. Add the package to testables to run them from the Test Runner.
MIT © OxygenButBeta