Rust voxel sandbox (wgpu + wasm + axum multiplayer)
Find a file
Maximus Gorog b2e50b62b5 Cubic chunks + no Y limit (foundation for LOD)
Chunks are now isotropic 16×16×16 cubes stacked in all three axes,
keyed by IVec3(cx, cy, cz). The world has no Y ceiling and no Y
floor — set_block lazily creates a chunk if one doesn't exist, so
building 1000 blocks straight up just creates 60-ish empty chunks
above the surface on demand.

world.rs:
  - CHUNK_HEIGHT removed. Single CHUNK_SIZE (=16) for all three axes.
  - Chunk allocates 16³ = 4096 blocks.
  - Chunk::get/set bound-check 0..CHUNK_SIZE on every axis.
  - block_to_chunk returns full 3D (cx, cy, cz) + (lx, ly, lz).
  - get_block has no Y bound — outside any chunk = Air (sky).
  - set_block: chunks.entry(c).or_insert_with(...) creates on demand.
  - HeightMap is keyed by IVec2(cx, cz) column. from_world_column scans
    every existing cubic chunk in that column top-down for the topmost
    solid block. Heightmap invalidation in set_block drops the column,
    not just the single chunk.
  - column_top_y, World::heightmap signature both take (cx, cz) directly.
  - World::new pre-generates chunks at cy in -1..=2 (4 vertical levels
    of pre-gen, ~1.1k chunks total, ~4.6 MB) covering the natural
    surface band. Above/below grows lazily.
  - generate_chunk takes the full 3D chunk coord; computes oy, fills
    blocks for this slice of the column. Trees that straddle a chunk
    boundary deterministically fill in their portion (each chunk uses
    the same hash, writes only its slice).
  - natural_surface_y returns the topmost-solid Y (preserved old
    semantic so all collision / spawn tests still hold).
  - 2 new tests pin the lazy-chunk-creation invariant (above and
    below pre-gen ranges).

mesh.rs:
  - dims is [CHUNK_SIZE; 3]; iteration loops are cubic.
  - base_y added so neighbor lookups + corner positions account for
    the chunk's vertical offset.
  - warm_heightmaps_around takes (cx, cz) column coords now.

sim/spawn.rs:
  - find_safe_spawn no longer caps at CHUNK_HEIGHT-2. Safety bound
    is surface_y + 200 (pathological tower depth before giving up).

sim/lighting.rs:
  - SUN_RAY_TOP_Y bumped from 128 to 4096 (was matching the old
    fixed world height). Ray DDA still terminates at the cap.

sim/visibility.rs:
  - Chunk AABB is CHUNK_SIZE on all three axes; the chunk's cy now
    contributes to the AABB min Y (was hardcoded 0).

render/mod.rs:
  - Heightmap warming + comment updates for column-keyed semantics.

Tests: 65/65 pass (was 63, +2 new). Native + wasm release clean.
Smoke-tested live: 88 fps, alive, spawn at y=8. All four UI
scenarios pass.

This is the foundation for the LOD pyramid you directed earlier —
isotropic chunks downsample cleanly (a LOD-N chunk represents a
(2^N)³ region with 16³ entries), and unbounded Y lets the LOD
tree extend in any direction without special cases.
2026-05-24 18:07:32 -06:00
server pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
src Cubic chunks + no Y limit (foundation for LOD) 2026-05-24 18:07:32 -06:00
test ui-settings-sliders: fix step-alignment test 2026-05-24 17:47:34 -06:00
web Quiet the debug-noise that was lagging the browser 2026-05-24 17:22:30 -06:00
.dockerignore Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
.gitignore pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
ARCHITECTURE.md Add ARCHITECTURE.md mapping the functional-core/imperative-shell split 2026-05-23 23:33:02 -06:00
build-web.sh pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
Caddyfile Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
Cargo.lock pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
Cargo.toml pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
DEPLOY.md DEPLOY.md: add active-deployment runbook for voxel.mxvs.art 2026-05-23 22:52:43 -06:00
docker-compose.prod.yml Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
docker-compose.yml Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
Dockerfile Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
run.sh Tick/toc instrumentation across build + test + mesh phases 2026-05-24 11:49:08 -06:00