- Rust 85.4%
- Python 13.9%
- WGSL 0.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- GitHub Actions workflow for headless export on push to main - Export presets for Windows Desktop, Linux/X11, macOS - Automated build validation and artifact upload |
||
| .github/workflows | ||
| docs | ||
| src | ||
| .gitignore | ||
| build.py | ||
| Cargo.lock | ||
| Cargo.toml | ||
| export_presets.cfg | ||
| project.godot | ||
| project_config.json | ||
| README.md | ||
| setup.py | ||
| setup_simple.py | ||
| shader.wgsl | ||
| voxel_system.gde | ||
Voxel Game - Minecraft Clone
A Minecraft-like voxel game built from scratch with Rust and wgpu. Terrain generates, you walk around with WASD + mouse, gravity pulls you down, you can jump, break and place blocks, and the world streams infinitely as you move. Textures now render correctly per-block — grass on grass, stone on stone — from the PureBDcraft 256x pack.
Live repo: https://git.aexoradao.com/swatmanjohn/voxel_game
What's Built
| Feature | Status | Notes |
|---|---|---|
| Window + input | ✅ | 1280×720, keyboard + mouse |
| GPU rendering | ✅ | wgpu — Vulkan/Metal/DX12 |
| First-person camera | ✅ | Perspective, mouse look |
| Procedural terrain | ✅ | Multi-octave noise heightmap |
| Caves | ✅ | 3D noise carved out |
| Trees, water, sand | ✅ | Placed by biome logic |
| Greedy meshing | ✅ | Merges coplanar faces — big triangle reduction |
| Ambient occlusion | ✅ | Vertex AO + directional light |
| Texture atlas | ✅ | PureBDcraft blocks with per-block UVs — world-mesher fix landed (fdbb01f) |
| Live profiling | ✅ | Frame/mesh/gen time printed every second |
| Block break/place | ✅ | Left/right click, DDA raycaster |
| Multi-chunk streaming | ✅ | 49 chunks around player, infinite world |
| Player physics | ✅ | Gravity, AABB collision, space to jump |
| Smoke tests | ✅ | 7 tests: chunk arena, mesher, world gen, UV validation (cargo test) |
| Day/night | ❌ | Not yet |
Running It
git clone https://git.aexoradao.com/swatmanjohn/voxel_game.git
cd voxel_game
cargo run --release
Need Rust 1.70+ and a Vulkan/Metal/DX12 GPU.
Controls: WASD move, left click break, right click place, 1-7 pick block, mouse look, space jump, ESC quit. Grab the mouse with the first click.
Want live perf numbers? RUST_LOG=info cargo run — prints frame time, mesh time, gen time, and FPS every second.
Want to run the test suite? cargo test — 7 smoke tests covering chunk arena, mesher geometry, world gen, and UV range validation.
Architecture
voxel_game/
├── Cargo.toml
├── README.md
├── shader.wgsl
├── docs/
│ ├── adr/ # Architecture decisions
│ ├── architecture.md # System design
│ ├── progress.md # What's done, what's next
│ ├── hud-mockup.html # HUD visual mockup
│ └── hud-design.md # HUD design doc
└── src/
├── main.rs # Loop, input, render glue, HUD wiring (779 lines)
├── world.rs # Terrain gen, biomes (166 lines)
├── chunk_arena.rs # SoA storage + bumpalo (81 lines)
├── chunk_manager.rs # Multi-chunk load/unload, radius-based (114 lines)
├── mesher.rs # Greedy meshing + NeighborLookup trait (308 lines)
├── camera.rs # First-person camera (87 lines)
├── metrics.rs # Profiler + live output (149 lines)
├── raycaster.rs # DDA voxel traversal (201 lines)
├── lighting.rs # Ambient occlusion + directional (106 lines)
├── physics.rs # Gravity, AABB collision, jump (108 lines)
├── atlas.rs # Texture atlas + UV rects (110 lines)
└── smoke_test.rs # 7 smoke tests: chunk, mesh, world, UV (114 lines)
Total: ~2,549 lines of Rust + WGSL shaders.
Key Decisions
- Rust + wgpu — Memory safety, modern GPU API, runs everywhere
- Structure-of-Arrays voxel storage — Cache-friendly meshing
- bumpalo arena allocators — O(1) chunk reset, no GC pauses
- 32×32×32 chunks — Good balance of mesh granularity and memory
- Greedy meshing — Same-block faces merged into larger quads
- DDA raycasting — Fast block picking via Amanatides & Woo algorithm
- Multi-chunk streaming — HashMap + radius-based load/unload, world-space
get_block()crosses chunk boundaries - Player physics — Gravity + AABB collision against chunks, space to jump. Physics runs before rendering each frame.
- HUD — Separate 2D orthographic wgpu pipeline for screen-space UI. Minimal, dark-translucent aesthetic (see docs/hud-design.md).
- Smoke tests —
#[cfg(test)]inline modules insrc/.cargo testruns 7 tests covering chunk arena, mesher geometry, world gen, and UV range validation.
Texture Pack
PureBDcraft 256x MC1.12.1 — /home/Swat/Downloads/PureBDcraft 256x MC121. Packed into a single atlas with per-block UV rects. World-mesher UV fix (fdbb01f) makes emit_quad sample the correct tile: stone=[0,1/7], dirt=[1/7,2/7], grass=[2/7,3/7], sand=[3/7,4/7], wood=[4/7,5/7], leaves=[5/7,6/7], water=[6/7,1].
Known Limits
- Noisy meshing at chunk boundaries — neighbor-aware culling not done yet (the
NeighborLookuptrait is there, ready to hook in) - HUD still in progress — crosshair + hotbar render, but block textures not yet wired into hotbar slots
- No day/night cycle (AO is baked, not dynamic)
- No save/load
What's Next
- Finish HUD: fix NDC bug, add block textures in hotbar slots, block name + count above selected slot
- Neighbor-aware meshing (kill those inter-chunk faces — the trait is in place)
- Day/night cycle with dynamic lighting
- Save/load (serialize chunks)
- Async chunk generation so you don't stall while walking
- Inventory, crafting, mobs — the usual Minecraft stuff
Team
- Rosemyne — coordination + progress tracking
- Sage — research + what's-the-best-approach calls
- Forge — lead implementation
- Quill — docs, README, keeping the paper trail clean + design
- Cipher — performance, data structures, profiling
- Aegis — build, dependencies, security