Log inGet started
Package

voxelEngine.package

Newest version

This package holds more than this page lists. See all of its files in its world.

readme.md

Voxel Engine Demos

Runnable scenes that exercise every feature of the voxelEngine. Each demo is a .scene/ with scene.json + entrypoint.luau. Load from a running engine:

layers.load("@builtin::~voxelEngine.demo.<name>")

Demos

SceneFeatures demonstrated
showcaseHillside village — chunked VoxelWorld terrain with stone/dirt/grass layers + lake + sand beach + two grassy hills. Hero props (windmill, 3 houses, trees, rocks) loaded from pre-baked voxbins. Windmill blades rotate each frame around the hub via pivot="center".
sedanHigh-resolution 16-piece car composite with articulated doors, steering wheel, spoiler. Door opens via runtime child-transform override + :commit(). Demonstrates pivot presets for hinge rotation.
officeOffice workspace (15 prop templates). Demonstrates large-scene authoring, template live-link, and the linked_workstation composite manifest.
world_terrain64×20×64 chunked VoxelWorld with multi-octave procedural heightmap, water level, sand/grass/snow biomes, and a runtime setBlock path carved across the middle. Exercises chunked rebuild and :flush().
destructionPhysics-enabled voxel blocks stacked into a tower, plus an exploded car with dynamic children. A heavy projectile is launched at the tower on load. Exercises Compound colliders on VoxelShape children + impulse forces.

Templates ship with the demos

  • templates/showcase/ — hillside village hero props: windmill_base.voxbin, blade.voxbin, house.voxbin, tree.voxbin, rock.voxbin. Authored interactively via V.createShape + saveAsTemplate in a running engine.
  • templates/vehicles/ — sedan body + wheels + accessories (cabin, chassis, door, spoiler, steering_wheel, windshield, etc.)
  • templates/office/ — desk, chair, monitor, keyboard, mug, plant, bookshelf, printer, whiteboard, cabinet, lamp, clock, trash, bot_seated, bot_standing
  • templates/office/linked_workstation.voxcomp — composite manifest referencing desk + monitor + keyboard + mug

How the demos find the templates

Each demo's entrypoint.luau re-points paths.templates to the demo's own template folder during onLoad(), and restores the default during onUnload():

local V = require("@builtin::~voxelEngine.voxelEngine")

local PREV_PATH = nil

function onLoad()
    PREV_PATH = V.configGet("paths.templates")
    V.configSet("paths.templates", "/source/libs/@builtin/systems/voxelEngine.package/demo/templates/vehicles")
    -- ... spawn entities that reference templates by name
end

function onUnload()
    if PREV_PATH then V.configSet("paths.templates", PREV_PATH) end
end

What each demo proves

FeatureCovered by
V.createShape + paintshowcase
V.createWorld + chunks + setBlockshowcase
V.fromTemplatesedan, office, showcase
V.stamp mode="instance" + rotationshowcase
V.stamp mode="merge" + 90° rotationshowcase
V.composite.new + :explodesedan
Articulated child override + :commit()sedan (door opens, survives scene round-trip)
Pivot presets ("bottom", "left", "center")sedan (wheel/door hinges)
Live-link template edit propagationoffice (edit a prop voxbin, all instances update)
Saved .voxcomp manifest (linked)office (linked_workstation)
Saved .voxbin from composite (baked)office (linked_workstation_baked)
Large chunked VoxelWorld (64×20×64)world_terrain
Procedural heightmap + biomesworld_terrain
Runtime setBlock + :flush()world_terrain
Dynamic physics on VoxelShapedestruction (tower + exploded car)
Compound collider children under impulsedestruction (projectile knocks tower)
Physics-enabled composite childrendestruction (car doors / wheels pop off)

Features not yet in these demos

  • Custom per-voxel attributes — the voxbin format currently stores only palette indices per cell. User-level attributes (HP, material tag, damage state) would need a parallel attribute stream; tracked in the roadmap, not yet implemented.