Hazel

Large Worlds

A big level, like a city or an open map, can hold far more than your computer can keep loaded at once. Renzora handles this by streaming: loading what is near the camera and letting go of what is far away, while you edit and while the game runs.

This page covers the tools for that, from the biggest to the smallest:

ToolUse it for
World partitionSplitting a whole scene into a grid of cells that load around the camera
Streamed prefabsLoading one placed prefab (a district, an interior) only when the camera is near
Terrain streamingKeeping big terrains cheap
Detail by distanceDrawing far objects and textures with less detail

World partition

A world partition cuts your scene into square cells. Each cell's contents are saved in their own file and only loaded when the camera comes near.

Partitioning a scene

  1. In the Hierarchy, select what you want to split up: a group, or the objects themselves.
  2. Right-click the selection and choose Partition into cells.

The Hierarchy's right-click menu, with Partition into cells near the bottom

Every object moves into the cell it stands in. Nothing moves in the world. The scene gets a World Partition entity, with one entry per cell (such as Cell 3_-2) folded underneath it. The cells are saved beside your scene:

scenes/main.bsn
scenes/main.cells/0_0.bsn
scenes/main.cells/3_-2.bsn

Run it again on more objects at any time to add them to the partition. Save the scene afterwards.

A few things to know:

  • Partitioning cannot be undone. It writes the cell files straight away. Keep a copy of the scene if you are experimenting.
  • Models go by their bounds. A model lands in the cell its middle falls in, read from the model file, so a city whose tiles all sit at the origin still lands in the right cells.
  • Groups keep their names. The objects inside a group are spread over the cells, and the group name is recreated in each cell, so Buildings is still easy to find.
  • Leave the World Partition entity at the origin. The grid is measured from the world origin.
  • Set the cell size first. Changing it later does not regroup existing cells.

How cells load

A cell loads when the camera comes within the Load Radius of its centre, and unloads beyond the Unload Radius. Distance is measured along the ground, so flying high over a city keeps the streets below loaded.

Cells load in the background, nearest first, so moving the camera does not freeze the editor or the game. A cell appears all at once, when its models and textures are ready, rather than showing grey or untextured pieces. When a cell unloads, its memory is given back.

Distant stand-ins

Without help, cells beyond the unload radius simply vanish. Build distant LODs gives every cell a stand-in: a single simple model of everything in it, coloured from its textures. A stand-in shows whenever its cell is not loaded, so the skyline stays complete from any distance.

  • Building reads the cell files from disk, so cells do not need to be loaded. A large city takes a minute or two.
  • Build again after editing cells. A stand-in shows the cell as it was when it was built.
  • Stand-ins are plain coloured shapes with no fine detail. Up close you see the real cell anyway.
  • If a cell has no stand-in, the Console says so when it goes out of view.

The World Partition section

Select the World Partition entity to see its section in the Inspector.

SettingWhat it does
Cell SizeHow wide each cell is, in metres. Default 1000
Load RadiusHow close the camera must come for a cell to load. Default 1500 m
Unload RadiusHow far away a cell unloads. Default 2000 m. It always stays a little above Load Radius so cells on the edge do not flicker
Stream in editorTurn off to keep every cell loaded while editing. Cells still stream when the game runs
Load all cellsLoad the whole map in the editor. Needs enough memory for all of it. Has no effect in the game

Below the settings:

  • Readouts: how many cells there are, and how many are loaded, loading, pinned, have a distant LOD, plus which cell the camera is in.
  • The map: every cell from above, showing which are loaded.
  • Pinning: click a cell on the map to keep it loaded wherever the camera goes. Unpin all releases them. Pins are not saved.
  • Build distant LODs: see Distant stand-ins.

Editing inside cells

Edit anything in a loaded cell as usual. Your changes are kept:

  • Saving the scene saves every loaded cell too.
  • A cell unloading while you have unsaved changes saves itself first.
  • Switching scene tabs saves loaded cells before the scene is put away.

Because cells save themselves, closing the scene without saving does not undo what a cell has already written.

Streamed prefabs

For a smaller world, or a few heavy areas, you can stream single placed prefabs instead of partitioning the whole scene.

Select the prefab and, in its Prefab Instance section, turn on Streamed:

SettingWhat it does
Load RadiusIts contents load when the camera is this close. Default 150 m
Unload RadiusIts contents unload beyond this. Default 200 m

The prefab itself (its position in the scene) always stays. Only its contents come and go.

In the editor, streamed prefabs stay loaded so you can work on them. Press Play to see them stream.

Terrain streaming

A terrain streams on its own, in the editor too. Full detail (and collisions) are kept only for chunks within the Streaming radius of the camera, 512 m by default; farther chunks are drawn as light stand-ins. Set this in the terrain's Manage tab. See Terrain.

Detail by distance

Simpler models far away

When you export, Generate LODs in the export window adds simpler versions of your models, which are drawn when they are far from the camera. Each mesh switches between them with a soft fade instead of a sudden pop.

To change when a model switches, add a Mesh LOD component to it:

FieldWhat it does
EnabledTurn off to always draw the full-detail model
LOD1 / LOD2 / LOD3 DistanceWhere each simpler version takes over. Defaults 40, 100 and 220 m
CrossfadeHow wide the fade between versions is. Default 5 m. 0 swaps instantly
Cull DistanceBeyond this the model is not drawn at all. 0 means never

The simpler versions are made at export, so in the editor you see the full model, unless you place your own name_lod1.glb, name_lod2.glb files beside it. See Exporting.

Sharper textures up close

In Play and in your exported game, textures far from the camera are swapped for small low-resolution copies, and the full ones are loaded again as you approach. Close up, a texture may sharpen a moment after you arrive. While you edit, every texture stays at full resolution.

Limits

  • Keep your world near the origin. Positions are stored with limited precision, so objects tens of kilometres out start to jitter.
  • Very large scenes slow the Hierarchy. With tens of thousands of objects, the Hierarchy panel costs frame time while cells arrive.