Skip to content

OxygenButBeta/O2.Horizon

Repository files navigation

O2 Horizon World Streamer

O2 Horizon — World Streamer

Cell-based world streaming for Unity — stream the view, keep the logic resident.

Unity License Package


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.

Features

  • Two modes, one workflowVirtual mode streams unbaked content via SetActive for 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 solverdesired / keep (hysteresis) / critical sets 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).

Installation

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.

Quick start

  1. Create the rootGameObject → O2 → StreamWorld. Its position is the grid origin; CellSize defaults to 256 m.
  2. Attach content — parent your static content under it, or drag transforms into the ContentRoots list without reparenting. Keep only static meshes + stateless local scripts under it; NetworkObject / non-kinematic Rigidbody are flagged as bake errors. Mark distant always-visible content with StreamableOverride.AlwaysResident.
  3. Add a source — put StreamSource on the camera (mark it Critical) and on any tracked vehicle.
  4. Press Play — with content present it streams in Virtual mode automatically. No bake required.
  5. Ship it — hit Bake World in the inspector (or the window) before building.

Editor tooling

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.

Core concepts

  • StreamWorld — the scene root; grid origin + cell size, mode, manifest, bake processors.
  • StreamSource — anything that pulls cells in (camera, player, vehicle); optional Critical bypasses the load budget.
  • StreamSetSolver — computes desired/keep/critical cell sets from radii with hysteresis.
  • WorldStreamerCore — state machine + per-frame load/unload budget; Pin/Unpin to 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.

Requirements

  • 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).

Testing

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.

License

MIT © OxygenButBeta

About

Cell-based world streaming for Unity — stream the view, keep the logic resident. UPM package.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages