auracraft
v0.1.6
Published
Voxel sandbox built with AuraJS 3D rendering and the native character3d controller.
Maintainers
Readme
Auracraft
Voxel sandbox built with AuraJS 3D rendering and the native character3d
controller. The scene is tuned to read like a classic block-world survival
spawn: flatter stepped terrain, blockier trees, darker water, flatter clouds,
and a voxel-style fallback HUD/title flow even when the optional custom UI art
is not present.
The demo now supports an optional block texture atlas. If the atlas file is not present, it falls back to colored materials automatically.
The world renderer batches blocks into chunk-scoped meshes instead of keeping
one retained scene node per block. Breaking or placing a block rebuilds only
the affected chunk render group.
The same top/side/bottom atlas convention is used for both chunk meshes and
standalone voxel cube meshes, so readable face shading does not depend on
splitting blocks into multiple render nodes.
Leaves now render as chunk-batched masked foliage cards, so trees and shrubs do
not have to fall back to opaque cubes just to stay on the public runtime path.
Chunk face culling now checks full-world neighbors across chunk seams, and the
player collision world uses merged solid-column obstacles instead of one AABB
per solid voxel.
The committed render-quality path now uses material-level
faceShadingStrength, nearest-filtered atlas sampling, and a truthful
ssao -> fxaa stack instead of relying mainly on fog plus
decorative contact-shadow strips.
Chunk ambient occlusion now rides the public vertex-color path directly:
chunk meshes call aura.mesh.createFromVertices(vertices, indices, normals,
uvs, colors) and bake the corner shade into per-vertex RGBA data instead of
trying to recover the same readability with extra global lighting hacks.
Daytime readability now also uses the engine-owned
aura.light.hemisphere(...) skylight contract plus a directional sun, so the
scene depends less on example-only ambient compensation.
AS125 adds chunk-baked local light transport on top of that daylight base:
covered blocks now lose skylight, and crafted emissive voxel blocks can add
warm nearby block-light without falling back to hidden point lights.
AS126 adds a quantized day-night loop on top of that local-light path:
scene-global daylight now changes over time, voxel skylight is re-baked on a
bounded cadence, and emissive blocks stay useful after sunset.
Play:
auramaxx play auracraft
# or run the published game wrapper directly
npx auracraft playRun from packages/aurascript:
npm run build:rust
npm run example:rust -- auracraftPublish/package flow from examples/auracraft:
npm pack --dry-run
node ../../src/cli/src/cli.mjs publish --dry-runThe npm package is configured as auracraft, so the published package entrypoint
is npx auracraft.
Project shape:
src/main.jsis a thin bootstrap, matching scaffolded AuraScript projects.src/runtime/holds the authored runtime shell (app.js, project registry, scene registry, inspector helpers).scenes/gameplay.scene.jscontains the main world loop and current gameplay implementation.config/gameplay/andcontent/gameplay/hold extracted authored data for player/rendering tuning and world layout.ui/andprefabs/are present so the example mirrors the same public project structure generated byaura create.
Controls:
Space,Enter, orClickon the title screen to enter the worldWASDmoveClick left/right mouselock the cursor for FPS mouse-lookMouselook while lockedEscunlock the cursorSpacejumpQor left mouse button break blockEor right mouse button place block1-9or mouse wheel change held blockFopen or close the two-element crafting mixerRreset the demo worldGtrigger a random absurd sky-livestock event- Collect the floating coins around the valley for a simple pickup loop
- Craft
torch,lantern, andcampfireto unlock them as placeable hotbar blocks
FPS mouse-look behavior:
- This example requires
aura.window.setCursorLocked()plusaura.input.getMouseDelta()and uses that public JS path as its only camera-look route. - The click that locks the cursor is consumed, so the player does not accidentally break or place a block on the same frame.
aura.onBlur()unlocks the cursor, andEscunlocks before the example will allow quit/close.
Proof checklist:
- Press
F3and confirm theLook:line readsclick to lock mousebefore lock andmouse lockedafter you click into the window. - While unlocked, camera look should pause instead of moving until the cursor is locked.
- After the first lock click, break/place actions should only happen on later clicks while the cursor remains locked.
- Press
F3and confirm theNodes:line stays far below total block count while theChunks:line reports chunk-group rebuilds instead of one-node-per-block churn. - With the texture atlas present, trees and shrubs should read as cutout foliage instead of solid leaf cubes.
- With the render-quality stack active, the world should keep its chunked block counts while dropping most decorative ground-shadow nodes that used to fake depth in the fog-only path.
- Press
Fand confirm crafting only allows two input elements at a time before producing a combined result. - Craft
torch,lantern, orcampfire, place the unlocked block, and verify nearby covered terrain brightens from baked local block-light instead of a hidden point light actor. - For deterministic native AO evidence, run
node scripts/capture-voxel-ao-proof.mjs. The committed AO path should emit a non-zerocolorEntryCountplus multipledistinctShadeBuckets, while the generated no-colors baseline should collapse those color metrics back to zero. - For deterministic local light evidence, run
node scripts/capture-voxel-light-transport-proof.mjs. The committed proof scene should report:open skylight=15 blockLight=0 bakedTopBrightness=0.6247,covered skylight=0 blockLight=0 bakedTopBrightness=0.1232,emissive skylight=0 blockLight=13 bakedTopBrightness=0.4078, plusdistinctColorBucketCount=129across the rebuilt chunk meshes. - For deterministic day-night daylight evidence, run
node scripts/capture-voxel-daylight-proof.mjs. The committed proof scene should report day/dusk/night open-skylight buckets of15 -> 7 -> 3, open-face brightness of0.6247 -> 0.3572 -> 0.2235, and a night emissive bucket that stays atblockLight=13withbakedTopBrightness=0.4078while covered night terrain remains darker at0.1232.
Current frontier:
- The world renderer is now doing the depth/readability work; mobs now use simple authored silhouettes and materials, and the next high-impact step is a real rigged animation/avatar path rather than more renderer churn.
- The AO proof is tied to the current chunk-mesh integration in
scenes/gameplay.scene.js. It shows that authored vertex colors survive the native mesh path, not that Aura now matches a full commercial voxel sandbox's lighting, block-light propagation, or content pipeline. - The local light transport is now paired with a quantized day-night daylight loop and bounded skylight re-bakes. It still does not claim weather, moon phases, dynamic GI, or exact flood-fill parity.
- This demo still does not claim full lighting or art-direction parity with shipped voxel sandboxes.
Texture atlas:
- Place a PNG at
assets/block.png - The demo now auto-prefers a cleaned atlas at
assets/block-clean.pngwhen present - The renderer also uses derived side/bottom atlases (
block-side-shaded.png/block-bottom-shaded.png) when present so block faces read with stronger voxel depth - The example root includes matching top-level atlas copies (
block.png/block-clean.png/block-side-shaded.png/block-bottom-shaded.png) so the native 3D material path resolves correctly - Use a
4 x 3grid of square tiles - The runtime also accepts the older fallback name
minecraft-blocks-atlas.png - See
assets/README.mdfor the exact layout
