Skip to content

Core Concepts

Data-Driven Setup

Block World uses ScriptableObjects for most reusable gameplay data:

Data Asset Script Purpose
World Settings WorldSettings Chunk sizes, world dimensions, terrain noise, biomes, block registry
Block Data BlockData Block ID, prefab, drop, break time, tool multiplier, ore settings
Biome Data BiomeData Surface blocks, ores, height offsets, trees, entity spawns
Craft Recipe CraftRecipeData Recipe grid, shapeless/shaped mode, output
Item Data ItemData Items, tools, weapons, armor-like metadata, in-hand prefab
Tool Data ToolData Legacy/simple tool asset support

Runtime Flow

  1. WorldGenerator reads WorldSettings.
  2. Chunks are created and filled with block IDs.
  3. Biome rules choose surface, subsurface, deep blocks, ores, trees, and entities.
  4. Chunk.BuildMesh() converts visible blocks into combined meshes.
  5. BlockInteractor lets the player break, place, attack, and interact.
  6. Inventory, crafting, drops, and save data react to gameplay changes.

Block IDs

Block IDs are bytes. 0 is reserved for air.

All placeable and generated blocks should be registered in:

WorldSettings.blocks

If a block ID is not registered, chunks cannot resolve its world prefab or gameplay data.

Generated Versus Source Assets

Generated block/item folders are normal Unity assets. They can be edited manually after creation, but keep IDs and registry references consistent.

Generated blocks usually contain:

  • BlockData-Name.asset
  • Block_Name.prefab
  • Drop_Name.prefab
  • optional Recipe-Name.asset
  • material assets