Minecraft-like voxel game in Rust
  • Rust 85.4%
  • Python 13.9%
  • WGSL 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Swat c86476d26b
Some checks failed
Godot Minecraft Clone CI / Export Game (push) Has been cancelled
Godot Minecraft Clone CI / Validate Project (push) Has been cancelled
Add CI/CD pipeline and export presets
- GitHub Actions workflow for headless export on push to main
- Export presets for Windows Desktop, Linux/X11, macOS
- Automated build validation and artifact upload
2026-08-18 22:22:29 -04:00
.github/workflows Add CI/CD pipeline and export presets 2026-08-18 22:22:29 -04:00
docs docs(adr): mark lighting filter+plumbing done; flag cross-column shadow still open 2026-08-18 12:11:52 -04:00
src chore: prune dead code (15 -> 0 warnings) 2026-08-18 13:24:46 -04:00
.gitignore docs: add ADR-001, architecture overview, progress log, and updated README 2026-08-17 12:10:31 -04:00
build.py Initial commit: Godot Minecraft Clone project structure 2026-08-18 22:22:29 -04:00
Cargo.lock chore: prune dead code (15 -> 0 warnings) 2026-08-18 13:24:46 -04:00
Cargo.toml chore: prune dead code (15 -> 0 warnings) 2026-08-18 13:24:46 -04:00
export_presets.cfg Add CI/CD pipeline and export presets 2026-08-18 22:22:29 -04:00
project.godot Initial commit: Godot Minecraft Clone project structure 2026-08-18 22:22:29 -04:00
project_config.json Initial commit: Godot Minecraft Clone project structure 2026-08-18 22:22:29 -04:00
README.md fix: crash on vertical bounds, noclip, spawn height 2026-08-18 03:08:36 -04:00
setup.py Initial commit: Godot Minecraft Clone project structure 2026-08-18 22:22:29 -04:00
setup_simple.py Initial commit: Godot Minecraft Clone project structure 2026-08-18 22:22:29 -04:00
shader.wgsl feat: water/leaves transparency (Phase 2 #8) — separate alpha-blended pass 2026-08-18 06:40:09 -04:00
voxel_system.gde Initial commit: Godot Minecraft Clone project structure 2026-08-18 22:22:29 -04:00

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

  1. Rust + wgpu — Memory safety, modern GPU API, runs everywhere
  2. Structure-of-Arrays voxel storage — Cache-friendly meshing
  3. bumpalo arena allocators — O(1) chunk reset, no GC pauses
  4. 32×32×32 chunks — Good balance of mesh granularity and memory
  5. Greedy meshing — Same-block faces merged into larger quads
  6. DDA raycasting — Fast block picking via Amanatides & Woo algorithm
  7. Multi-chunk streaming — HashMap + radius-based load/unload, world-space get_block() crosses chunk boundaries
  8. Player physics — Gravity + AABB collision against chunks, space to jump. Physics runs before rendering each frame.
  9. HUD — Separate 2D orthographic wgpu pipeline for screen-space UI. Minimal, dark-translucent aesthetic (see docs/hud-design.md).
  10. Smoke tests#[cfg(test)] inline modules in src/. cargo test runs 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 NeighborLookup trait 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

  1. Finish HUD: fix NDC bug, add block textures in hotbar slots, block name + count above selected slot
  2. Neighbor-aware meshing (kill those inter-chunk faces — the trait is in place)
  3. Day/night cycle with dynamic lighting
  4. Save/load (serialize chunks)
  5. Async chunk generation so you don't stall while walking
  6. 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