Skip to content
ShieldowskyyPublic

About

A cross-platform voxel sandbox built in Rust, featuring procedural worlds, multiplayer, modding, and software/WGPU rendering.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

451 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RustCraft — Cross-Platform Voxel Sandbox Engine

Rust License: MIT Platform Play in Browser Deploy to GitHub Pages

Try it in your browser (Chrome & Firefox): https://shieldowskyy.github.io/rustcraft/ Powered by WebAssembly + WebGL2 (OpenGL ES 3.0) GPU rendering (with automatic CPU Canvas 2D fallback), Pointer Lock, fullscreen, Web Audio, and Gamepad support. Embed just the game on any website via embed.html (<iframe>).

A voxel sandbox game and engine written in Rust, with build scripts and ports for: Desktop (Linux x86_64 / x86 32-bit / ARM64 / RISC-V 64, Windows x86_64 / 32-bit / ARM64, macOS, FreeBSD), Mobile (Android ARM64 / ARMv7 / x86_64 APK with multi-touch virtual controls), Consoles (Sony PlayStation Vita GXM GPU, legacy Microsoft Xbox 360 Homebrew XEX2), Embedded Linux (Raspberry Pi Zero W / ARMv6, Raspberry Pi 2/3 / ARMv7), and Web browsers (WebAssembly / WebGL2 GPU + HTML5 Canvas fallback).

Runtime support and testing vary by platform; a build script or CI compile does not imply validation on every device. RustCraft includes a multithreaded CPU software rasterizer, a WGPU hardware renderer (Vulkan / OpenGL / DX12 / Metal with render distances up to 128 chunks), a native WebGL2 (OpenGL ES 3.0) browser renderer, and a bare-metal PlayStation Vita GXM renderer.

See the modding guide, porting guide, architecture overview, and agent architecture rules for details.


Codebase Statistics

Component Files Lines of Code Notes
src/features/ 261 56,534 Platform-agnostic gameplay domains (world, meshing, rendering, UI, entities, audio, net, modding)
src/platform/ 69 15,042 PAL backends (wgpu, vita/gxm, desktop, android, web, macos, audio, clipboard)
src/app/ 37 11,603 Top-level game loop, state machine, gameplay ticks, containers, menus, text input
src/core/ 27 4,709 Math, noise, coords, controls, settings, i18n, profiler, HTTP profiler server, crash reporter
Root, bin, src/engine/, facades 75 1,357 lib.rs, main.rs, cli.rs, rustcraft-server.rs, compatibility facades (src/{world,gameplay,graphics,ui,audio,net}/)
build.rs 1 384 Cross-platform build setup & PS Vita psp2cgc Cg→GXP shader compilation
Total Rust (src/ + build.rs) 470 89,629 src/ alone: 469 files, 89,245 LOC; includes 277 unit tests (cargo test --lib)
Shaders (vita/shaders/*.cg) 12 352 PlayStation Vita GXM vertex/fragment Cg shaders (WGPU WGSL embedded in src/platform/wgpu/shaders.rs)
Build & tooling scripts (scripts/*.sh, *.py) 24 2,807 Cross-compilation, Pioza release packagers, headless servers, locale sync

1. Supported Platforms & Renderers

Platform / Architecture Target Triple Primary Renderer Build Script / Command
Linux (x86_64) x86_64-unknown-linux-gnu Software CPU (Rayon) / WGPU ./scripts/compile_linux.sh / ./scripts/compile_linux_pioza.sh
Linux (32-bit x86 / i686) i686-unknown-linux-gnu Software CPU (Rayon) / WGPU ./scripts/build_linux_x86_32.sh
Linux (ARM64 / AArch64) aarch64-unknown-linux-gnu Software CPU (Rayon) / WGPU ./scripts/build_linux_arm64.sh
Linux (ARMv7 32-bit HF) armv7-unknown-linux-gnueabihf Software CPU (Rayon) / WGPU ./scripts/build_linux_armv7.sh
Linux (RISC-V 64-bit) riscv64gc-unknown-linux-gnu Software CPU (Rayon) ./scripts/build_linux_riscv64.sh
Raspberry Pi Zero W (ARMv6) arm-unknown-linux-gnueabihf Software CPU (Tuned for ARM11) ./scripts/build_rpi_armv6.sh
FreeBSD (x86_64) x86_64-unknown-freebsd Software CPU / X11 ./scripts/build_freebsd.sh
Windows (x86_64) x86_64-pc-windows-gnu Software CPU / WGPU (DX12 / Vulkan) ./scripts/compile-windows.sh / ./scripts/compile_windows_pioza.sh
Windows (32-bit x86 / i686) i686-pc-windows-gnu Software CPU / WGPU ./scripts/build_windows_32.sh
Windows (ARM64 / AArch64) aarch64-pc-windows-msvc Software CPU / WGPU ./scripts/build_windows_arm64.sh
Android (ARM64 / ARMv7 / x86_64) aarch64-linux-android ANativeWindow (Software / Rayon / WGPU) ./scripts/build_android.sh / ./scripts/ota_android.sh
PlayStation Vita armv7-sony-vita-newlibeabihf Bare-Metal GXM GPU (SGX543MP4) ./scripts/build_vita.sh / ./scripts/ota_vita.sh
macOS (Apple Silicon & Intel) aarch64 / x86_64-apple-darwin Software CPU / Metal (WGPU) ./scripts/build_macos.sh
WebAssembly wasm32-unknown-unknown WebGL2 GPU (OpenGL ES 3.0) / Software CPU fallback ./scripts/build_web.sh [--serve]
Xbox 360 (Legacy Homebrew XEX2) powerpc-unknown-linux-gnu Direct VRAM Framebuffer (720p HD) ./scripts/build_xbox360.sh (unmaintained legacy)

2. Engine Architecture & Subsystems

RustCraft strictly isolates all platform/OS/GPU #[cfg] code inside src/platform/, keeping src/core/, src/features/, and src/app/ platform-independent (with compatibility facades under src/{world,gameplay,graphics,ui,audio,net,engine}/):

  • Platform Abstraction Layer (src/platform/): Unified traits in src/platform/traits.rs (capabilities()) delegating windowing (desktop, macos, android, vita, web), hardware WGPU rendering (src/platform/wgpu/), Vita GXM rendering (src/platform/vita/gxm/), threading, storage, clipboard, folder launching, mouse capture, gamepad, and audio backends.
  • Application Lifecycle (src/app/): Top-level game state machine (frame.rs, init.rs, progress.rs), per-frame gameplay simulation (src/app/gameplay/), containers (src/app/containers/), menus (src/app/menus/), multiplayer sync (src/app/multiplayer/), and standardized text editing (src/app/text_input.rs).
  • Dimensions & Seamless Portals (src/features/world/dimension.rs, src/features/world/portals.rs): Supports the Overworld and Rether dimensions (DimensionId) linked by obsidian portals, rendered seamlessly in both WGPU stencil passes and the software rasterizer (src/features/rendering/software/portal.rs).
  • Data-Driven Modding Subsystem (src/features/modding/): Zero-dependency JSON mod loader (mods/) supporting custom blocks, items, food nutrition, crafting/smelting recipes, loot tables, and chat commands, with procedural custom textures mapped into reserved WGPU array layers 229..=255 and automatic client synchronization over multiplayer.
  • Dynamic Weather Subsystem (src/features/world/weather.rs): Atmospheric weather simulation (Clear, Rain, Thunderstorms, Snow) with biome-dependent precipitation, sky/cloud darkening, procedural rain/thunder audio, lightning strikes, and /weather commands.
  • Villages, Villagers & Trading Economy (src/features/world/gen/village.rs, src/features/entities/): Procedural villages across biomes with houses, stone-aligned hinged doors, crops, wells, lamps, Villagers across 8 professions with an emerald trading UI, and Iron Golem guardians.
  • Quests, Achievements & Status Effects (src/features/player/): In-game Questbook, achievement unlocks with toast notifications, Field Notes, and status effects (including Jump Boost via /effect <give|clear>).
  • Rendering, Lighting & Mesh Cache (src/features/rendering/, src/features/meshing/): Pure CPU chunk/subchunk mesh builder with AO diagonal flipping, exposed-lava/torch/ruststone block lighting, brightness gamma curve across software & WGPU shaders, animated hinged 3D chest models (chest_model.rs), and configurable desktop render distance up to 128 chunks.
  • UI, Chat & Diagnostics (src/features/ui/): HUD (toggleable with F1), F2 BMP screenshot capture to screenshots/ with clickable folder links in chat, F3 debug overlay (FPS, memory breakdown, mesh & chunk cache statistics), creative tabbed + Search/All inventory picker, world map, minimap, and standardized Ctrl+A/C/X/V input editing across all fields.
  • Audio & Music Subsystem (src/features/audio/): 64-voice lock-free SPSC mixer with procedural SFX synthesis, 3D spatial attenuation/occlusion, and bundled Ogg/Opus music playback.
  • Crash Reporter & Sentry Telemetry (src/core/crash_reporter/): Panic handler capturing thread state, stack backtraces, telemetry, logger breadcrumbs, and optional Sentry upload (--sentry-dsn <DSN> or SENTRY_DSN).
  • Multiplayer Networking (src/features/net/, src/bin/rustcraft-server.rs): TCP client-server synchronization, entity interpolation, UDP LAN discovery, and encrypted CG-NAT relay hosting.
  • Wi-Fi / HTTP OTA Auto-Updater (src/platform/ota/, src/platform/vita/updater.rs, RustCraftUpdater.java): Zero-config startup self-patcher for PlayStation Vita and Android with UDP LAN auto-discovery (port 26657), HTTP streaming (port 26658), SHA-256 + binary header verification (SCE\0 / \x7FELF), .bak rollback protection, and voxel-styled 3D progress UI.
  • CLI Argument Parser (src/cli.rs): Parses --renderer software|vulkan, --seed <NUMBER>, --profiler, --autotest, -log, --server, --relay-server, --relay-port <PORT>, --port <PORT>, --connect <ADDR>, --sentry-dsn <DSN>, --no-sentry, --crash-test, and --help.

Multiplayer over CG-NAT

The in-game Host Session action starts a server for the current save and creates an outbound connection to a RustCraft relay, letting invited players join without port forwarding. Guests enter the generated relay://host:port/code invite in the multiplayer address field.

The relay is a lightweight TCP forwarder and stores no world data. Build and run it on a public VPS:

cargo build --release --bin rustcraft-server
cp target/release/rustcraft-server .
sudo ./install_relay_service.sh

Pass a custom port optionally, e.g. sudo ./install_relay_service.sh 26658, and allow inbound TCP (26657 default). The game defaults to relay.rustcraft.dsh.yt:26657; override on desktop via relay.properties (relay-address) or RUSTCRAFT_RELAY_ADDR env var.

Once hosted, the invite is copied to clipboard where supported and posted in chat. Guests paste invites with Ctrl+V in Multiplayer → Server Address or Invite. Hosts can stop the active hosted session from the Pause menu via Stop Hosting.

Security: Relay traffic is end-to-end encrypted with ChaCha20-Poly1305 using a secret contained only in the invite link; direct TCP connections without relay:// remain unencrypted.

Browser (WebAssembly) Guests via WebSocket: rustcraft-server --relay-server automatically accepts RFC 6455 WebSocket connections on the same port (26657) alongside raw TCP, enabling browser players to join native PC/Android/PS Vita hosts using relay://... or wss://... invites with identical ChaCha20-Poly1305 E2E encryption. On HTTPS pages (such as GitHub Pages), place a TLS reverse proxy (e.g. Caddy or Nginx) in front of the relay port so wss://relay.rustcraft.dsh.yt forwards WebSocket upgrades to 127.0.0.1:26657.


3. Requirements

Desktop & Embedded Linux (x86_64, ARM64, ARMv7, ARMv6, FreeBSD)

  • Rust: toolchain 1.75+ (rustup recommended: https://rustup.rs).
  • Linux / FreeBSD: X11 development headers (libx11-dev on Debian/Ubuntu, xorgproto & libudev-devd on FreeBSD).
  • Windows Cross-Build: MinGW-w64 (x86_64-w64-mingw32-gcc) or cross / zig.
  • Vulkan (Optional): Vulkan loader and GPU with graphics/compute queue support (falls back to OpenGL / CPU software).

PlayStation Vita

  • VitaSDK installed at /usr/local/vitasdk or $HOME/vitasdk + nightly rust-src (-Z build-std=std,panic_abort).
  • Target: armv7-sony-vita-newlibeabihf, Cg compiler psp2cgc (invoked by build.rs), and VitaSDK packaging tools (vita-elf-create, vita-make-fself, vita-mksfoex, vita-pack-vpk).

WebAssembly

  • wasm-pack or wasm-bindgen-cli, target wasm32-unknown-unknown, and a static HTTP server.

4. Building and Running

All Pioza Client Archives & Linux Servers (compile_all_pioza.sh)

Builds and versions the Linux client, Windows client, and both headless Linux dedicated servers (x86_64 and arm64):

./scripts/compile_all_pioza.sh
# Outputs:
#   target/pioza/linux/Linux.zip       (+ version.txt, build.txt)
#   target/pioza/windows/Windows.zip   (+ version.txt, build.txt)
#   dist/rustcraft-server-x86_64-unknown-linux-gnu.tar.gz
#   dist/rustcraft-server-linux-arm64.tar.gz

Or run the individual Pioza packagers directly:

./scripts/compile_linux_pioza.sh     # target/pioza/linux/Linux.zip
./scripts/compile_windows_pioza.sh   # target/pioza/windows/Windows.zip

Linux (x86_64)

# Distro-agnostic release build (uses `cross` / `cargo-zigbuild` targeting glibc 2.31+ for older Debian/Ubuntu)
./scripts/compile_linux.sh

# Opt into fast host-only compilation against local glibc:
RUSTCRAFT_NATIVE_BUILD=1 ./scripts/compile_linux.sh

# Or run directly via Cargo:
cargo run --release

Both ./scripts/compile_linux.sh and ./scripts/build_server.sh prefer cross (Podman/Docker, glibc 2.31 — Debian 11+ / Ubuntu 20.04+) or cargo-zigbuild when installed, falling back to host cargo if unavailable.

To run with the WGPU hardware renderer (--renderer vulkan / --vulkan) or HTTP profiler (--profiler):

cargo run --release -- --renderer vulkan
cargo run --release -- --profiler

Other Linux, FreeBSD & Windows Builds

./scripts/build_linux_x86_32.sh      # target/i686-unknown-linux-gnu/release/rustcraft
./scripts/build_linux_arm64.sh       # target/aarch64-unknown-linux-gnu/release/rustcraft
./scripts/build_linux_armv7.sh       # target/armv7-unknown-linux-gnueabihf/release/rustcraft
./scripts/build_linux_riscv64.sh     # target/riscv64gc-unknown-linux-gnu/release/rustcraft
./scripts/build_rpi_armv6.sh         # target/arm-unknown-linux-gnueabihf/release/rustcraft
./scripts/build_freebsd.sh           # target/x86_64-unknown-freebsd/release/rustcraft
./scripts/compile-windows.sh         # target/x86_64-pc-windows-gnu/release/rustcraft.exe
./scripts/build_windows_32.sh        # target/i686-pc-windows-gnu/release/rustcraft.exe
./scripts/build_windows_arm64.sh     # target/aarch64-pc-windows-msvc/release/rustcraft.exe

Headless Server & Relay Packaging (dist/)

./scripts/build_server.sh x86_64-unknown-linux-gnu   # dist/rustcraft-server-x86_64-unknown-linux-gnu.tar.gz
./scripts/build_linux_arm64_server.sh                # dist/rustcraft-server-linux-arm64.tar.gz

Each archive packages rustcraft-server, server.properties, and install_relay_service.sh:

tar -xzf rustcraft-server-x86_64-unknown-linux-gnu.tar.gz
./rustcraft-server --relay-server --relay-port 26657
# Or dedicated world server:
./rustcraft-server --server --port 26656 --seed 133742

PlayStation Vita, Android, macOS & WebAssembly

./scripts/build_vita.sh              # RustCraft.vpk (or ./scripts/build_vita_debug.sh)
./scripts/build_android.sh           # RustCraft.apk
./scripts/build_macos.sh [universal] # dist/RustCraft.app & tarball
./scripts/build_web.sh --serve       # Build & serve web/ locally at http://127.0.0.1:8080
./scripts/build_xbox360.sh           # Legacy Xbox 360 XEX2 / ZIP

Play in Browser & Embed via iframe

Embed just the game on any website:

<iframe
  src="https://shieldowskyy.github.io/rustcraft/embed.html"
  width="960"
  height="540"
  style="border:0;border-radius:12px;background:#000;max-width:100%;"
  allow="fullscreen; pointer-lock; gamepad; autoplay; clipboard-read; clipboard-write"
  allowfullscreen
  loading="lazy"
  title="RustCraft"
></iframe>

Optional query parameters: ?autofullscreen=1, ?controls=0, ?muted=1, ?seed=<number>.

Wi-Fi / HTTP Over-The-Air (OTA) Auto-Updater (PS Vita & Android)

Once a base RustCraft.vpk or RustCraft.apk is installed on a device, RustCraft can automatically patch its own executable and mods/ over Wi-Fi on startup — eliminating manual USB transfers, VitaShell installs, and Android Package Installer prompts:

  • How it works:

    1. On launch, the client sends a fast UDP broadcast ping (port 26657, ~450 ms timeout when offline) to discover scripts/dev_update_server.py on your PC, with fallback to a custom HTTP URL in updater.txt or the last known server IP.
    2. Fetches /manifest.txt (port 26658) and compares the remote SHA-256 against the installed binary (app0:eboot.bin on PS Vita; codeCacheDir/ota/librustcraft_<sha>.so or base APK librustcraft.so on Android).
    3. PS Vita: Renders a voxel progress screen via VitaDisplay, streams the new eboot.bin to ux0:data/rustcraft/update/eboot.bin.new, verifies size + SHA-256 + SCE\0 FSELF magic, and hands execution to app0:updater.bin (vita/updater/main.c), which unmounts app0:, performs a .bak rollback-safe swap of ux0:app/RUSTCRAFT/eboot.bin, and relaunches the game. Hold [L] or [O] at boot to skip.
    4. Android: Runs asynchronously before System.load(), downloads and verifies \x7FELF + SHA-256 into codeCacheDir/ota/, marks the .so read-only (Android 14+ / API 34 W^X compliant), and loads the new native engine directly in the same launch (automatically clearing stale OTA patches whenever a newer base .apk is installed via adb install -r).
  • Daily iteration workflow:

    # 1. One-command build + OTA server (builds full .vpk/.apk on first run, then fast binary-only patches):
    ./scripts/ota_vita.sh          # flags: --vpk, --debug, --profiler
    ./scripts/ota_android.sh       # flags: --apk
    
    # Or keep the OTA server running in one terminal while running fast binary-only builds in another:
    ./scripts/serve_updates.sh     # add --with-soundtracks to also sync 43 MB soundtracks/
    ./scripts/build_vita.sh --fast
    ./scripts/build_android.sh --fast
  • Custom remote HTTP URL / static hosting (outside LAN):

    # Export a static OTA directory (manifest.txt, vita/eboot.bin, android/librustcraft.so, assets.zip):
    python3 scripts/dev_update_server.py --export-dir dist/ota

    To point a device to a fixed HTTP server (or disable OTA with enabled=false), create updater.txt:

    • PS Vita: ux0:data/rustcraft/updater.txt (e.g. url=http://192.168.1.50:26658)
    • Android: /sdcard/Android/data/com.rustcraft.game/files/updater.txt (an updater.txt.example template is created automatically on first launch)

5. Controls

Desktop & Embedded Linux (Keyboard & Mouse)

Key / Input Action
Left Click on Window Capture / Lock mouse cursor
ESC / P Release cursor / Pause Game Menu
W, A, S, D Horizontal movement
SPACE Jump (Ascend in fly mode)
LEFT SHIFT / C Sneak (Descend in fly mode)
LEFT CTRL (Hold) Sprint
F Swap Main Hand & Offhand item (in-world or hovering inventory slot)
G Toggle Flight Mode
F4 Toggle Survival / Creative Mode
Mouse Motion Look / Aim camera
LMB Mine / Break block / Attack
RMB Place block / Interact / Consume food / Use tool
Middle Click (MMB) Pick Block into hotbar (Creative Mode)
1 – 0 / Mouse Scroll Select Hotbar Slot (10 slots)
E Open Inventory & Crafting UI
Q Drop selected item
F1 Toggle HUD Overlay
F2 Save screenshot to screenshots/ (posts clickable chat link)
F3 Toggle Debug Diagnostics Overlay (F3+A reloads chunks)
F5 Quick-save world
Ctrl+A / C / X / V Select all, copy, cut, paste across chat and all text inputs

PlayStation Vita / Gamepad

Gamepad Button Action
Left / Right Stick Movement / Camera Look
Cross [X] / A Jump / Ascend
Circle [O] / B Sneak / Descend
Square [ ] / X Mine / Break (secondary)
Triangle [^] / Y Open Inventory / Crafting
R2 / L2 (RT / LT) Mine & Attack / Place & Interact
L1 / R1 (LB / RB) Cycle Hotbar Slots
L3 / R3 Sprint / Toggle Flight Mode
SELECT / START Toggle Gamemode / Pause Menu
D-Pad UP / LEFT Toggle Debug Overlay / Drop item
Front Touchscreen Camera look & slot selection

6. Procedural Biomes

The world generator synthesizes 37 distinct Overworld biomes (Biome in src/features/world/biome.rs) across temperature, humidity, continentalness, height, and erosion axes, plus the Rether dimension:

  • Temperate & Forests: Plains, Sunflower Plains, Forest, Flower Forest, Autumn Forest (AutumnLeaves), Birch Forest, Dark Forest, Cherry Grove (CherryLeaves), Meadow
  • Cold & Alpine: Taiga, Mega Taiga, Snowy Taiga, Snowy Tundra, Ice Spikes, Mountains, Jagged Peaks, Frozen Peaks, Snowy Slopes
  • Arid & Warm: Desert, Savanna, Savanna Plateau, Badlands, Mesa, Mesa Plateau, Mesa Plateau Forest, Mesa Bryce, Jungle, Jungle Edge
  • Wetlands, Shores & Oceans: Swamp, River, Frozen River, Beach, Cold Beach, Stone Beach, Ocean, Deep Ocean, Mushroom Island

Generated structures include desert wells, stone ruins, forest log cabins (with loot chests), coral ruins in oceans, and procedural villages (houses with aligned hinged doors, furnaces, crafting tables, crop farms, wells, and lamps).


7. Block, Item & Entity System

RustCraft defines 193 built-in blocks and items (IDs 0..=192), with 229 built-in texture layers + 27 custom mod layers (256 WGPU array layers). Mod IDs start at 193+:

  • Building Blocks: Grass, Dirt, Stone, Cobblestone, MossyCobblestone, Sand, Planks, Wood, Glass, Ice, Snow, Mud, Bedrock, Sandstone, SmoothStone, Bricks, Obsidian, Bookshelf, Slabs/Stairs (Wood, Stone, Cobblestone, Sandstone, Brick), Ladder
  • Rether Dimension: Retherrack, RetherBricks, Glowstone, SoulSand, RetherQuartzOre (requires pickaxe), RetherQuartz, FlintAndSteel
  • Fluids & Flora: Water, Lava (light-emitting), Leaves, SnowLeaves, CherryLeaves, AutumnLeaves, Cactus, Kelp, Seagrass, Sapling
  • Agriculture & Crops: Farmland, FarmlandWet, WheatSeeds, WheatCrop, Wheat, Bread, Carrot, CarrotCrop, Potato, PotatoCrop, BakedPotato, BoneMeal
  • 16 Wool Colors: WhiteWool through BlackWool
  • RustStone (Redstone Mechanisms): RustStoneOre, RustStone, RustStoneWireLit, RustStoneBlock, RustStoneLamp / RustStoneLampLit, Lever / LeverOn, Button / ButtonPressed, PressurePlate / PressurePlatePressed (depresses visually under entity feet)
  • Ores, Tools & Combat Gear: Coal/Iron/Gold/Diamond/Emerald/RustStone ores and blocks, Iron/Gold ingots & ounces, Pickaxes/Axes/Shovels/Swords/Hoes across 5 tiers, Shears, FishingRod, Leather / Iron / Gold / Diamond Armor sets, Bow, Arrow, Shield, StringItem, SpiderEye
  • Food & Utility: Apple, Raw/Cooked Porkchop, Beef, Chicken, Cod, Salmon, Pufferfish, TropicalFish, DriedKelp, Torch, Bed, CraftingTable, Chest, Furnace / FurnaceLit, Door / DoorOpen, TNT, plus 9 Spawn Eggs (Pig, Cow, Chicken, Sheep, Dolphin, Fish, Villager, Iron Golem, Spider)
  • Status Effects: Jump Boost (increases jump velocity and safe fall height; configurable via /effect <give|clear> [@s] jump_boost [seconds|infinite] [amplifier])

Living Entities & Mobs (15 Mob Types)

  • Passive & Village: Pig, Cow, Chicken, Sheep (wool grazing/regrowth & shearing), Villager (8 professions, emerald trading UI, panics on attack), Iron Golem (100 HP village protector)
  • Hostile: Zombie, Skeleton (ranged, burns in sunlight), Reaper (creeper-style stealth explosion), Spider (climbs obstacles, neutral during daytime unless provoked)
  • Aquatic: Dolphin (grants swimming speed boost), Cod, Salmon, Pufferfish (puffs up & poisons), Tropical Fish

8. Tile Entities & Animated Models

  • Chest (src/features/world/tile_entity.rs, src/features/rendering/chest_model.rs): 27-slot persistent world container with procedural cabin/village loot and Minecraft-style 3D opening/closing animation (inset 14/16 body, rotating hinged lid with cubic ease-out, and protruding 3D iron latch rendered in Software, WGPU, and PS Vita GXM).
  • Furnace (src/features/world/tile_entity.rs): Input/fuel/output smelting state ticking across frames with Furnace ↔ FurnaceLit lighting transitions.

9. Embedded Performance Profiler

Run with --profiler to start the zero-dependency HTTP JSON + live HTML telemetry dashboard (src/core/profiler.rs, src/core/profiler_server/), reporting memory breakdowns, sub-pass micro-timings, draw calls, subchunks rendered/culled, and mesh/chunk cache stats.


10. Localization Pipeline (i18n)

Zero-dependency in-memory translation dictionaries (locales/en.json, locales/pl.json) managed by src/core/i18n.rs and scripts/sync_locales.py:

python3 scripts/sync_locales.py          # Sync existing locale files with en.json
python3 scripts/sync_locales.py --new de # Create a new locale dictionary
python3 scripts/sync_locales.py --check  # Verify translation completeness in CI

11. Codebase Structure

rustcraft/
├── Cargo.toml                         # Workspace crate, targets, and profiles (dev / release / dist)
├── build.rs                           # Cross-target link setup & PS Vita Cg→GXP shader compilation
├── ARCHITECTURE.md / MODDING_GUIDE.md / PORTING_GUIDE.md / LLM_GUIDE.md / AGENTS.md
├── locales/                           # Embedded i18n JSON dictionaries (en.json, pl.json)
├── scripts/                           # Cross-builds, ota_vita.sh, ota_android.sh, dev_update_server.py
├── vita/                              # PS Vita Cg shaders (12 files), updater/main.c & LiveArea assets
└── src/
    ├── lib.rs, main.rs, cli.rs        # Crate root, native entrypoint, CLI parser
    ├── bin/rustcraft-server.rs        # Headless dedicated server & CG-NAT relay binary
    ├── core/                          # Zero-platform-#[cfg] core modules (27 files, 4,709 LOC)
    │   ├── math.rs, noise.rs, coords.rs, events.rs, i18n.rs, logger.rs, build_info.rs
    │   ├── controls/, settings/, crash_reporter/, profiler.rs, profiler_server/
    ├── platform/                      # All OS/console/GPU #[cfg] implementations
    │   ├── traits.rs, threading.rs, storage.rs, clipboard.rs, system.rs, gpu_bridge.rs, ota/
    │   ├── desktop/, macos.rs, web.rs, android/, audio/, xbox360.rs
    │   ├── wgpu/                      # WGPU Vulkan/GL/DX12/Metal backend & WGSL shaders
    │   └── vita/                      # PS Vita SceDisplay/SceCtrl/IME, OTA updater & libgxm (`gxm/`)
    ├── features/                      # Platform-agnostic game domains (261 files, 56,534 LOC)
    │   ├── blocks/                    # BlockId (0..=192), specs, colors, tools, texture tables
    │   ├── meshing/                   # CPU chunk/subchunk mesher, AO flip, non-cube shapes
    │   ├── world/                     # Chunks, 37 biomes, Rether, portals, villages, weather, lighting, storage
    │   ├── physics/                   # Player/mob AABB collision, fluid/ladder physics, raycasting, acoustics
    │   ├── entities/                  # 15 mobs (AI, models, combat), dropped items, arrows, particles
    │   ├── player/                    # Player state, Jump Boost effects, inventory, recipes, quests, achievements
    │   ├── rendering/                 # Procedural atlas (229+27), camera, chest_model, clouds, font, software rasterizer
    │   ├── ui/                        # HUD, menus, inventory, containers, minimap, worldmap, chat + commands
    │   ├── audio/                     # 64-voice SPSC mixer, synth SFX, spatial audio, Ogg/Opus soundtrack
    │   ├── net/                       # TCP protocol, client, server, ChaCha20 relay, LAN discovery
    │   ├── modding/                   # JSON mod loader & runtime texture synthesis
    │   └── autotest/                  # Automated gameplay smoke-test runner
    ├── app/                           # Game loop & state orchestration (37 files, 11,603 LOC)
    │   ├── mod.rs, init.rs, frame.rs, progress.rs, types.rs, profiler.rs, text_input.rs
    │   └── gameplay/, containers/, menus/, multiplayer/
    ├── engine/                        # Modular EngineApp / EngineModule / fonts subsystems
    └── {world,gameplay,graphics,ui,audio,net}/  # Thin pub use compatibility facades

12. License & Legal Disclaimer

This project is licensed under the MIT License — see the LICENSE file for details.

The MIT license does not grant rights to third-party media. Before redistributing a release, verify the provenance and license/attribution requirements for bundled music, images, fonts, and other non-code assets.

Third-party assets

  • Music: The bundled soundtrack was generated with Suno AI. Its use and redistribution remain subject to the applicable Suno terms and the rights associated with the account and plan used to generate it.
  • graphics/dev_logo.png: This is the Dasho logo, owned by EkipaDSH. It may not be used in another project without EkipaDSH's express permission. The RustCraft MIT license does not grant rights to this logo.

Disclaimer

RustCraft is an independent, non-commercial open-source voxel game engine and sandbox recreation developed in Rust. RustCraft is not an official Minecraft product and is not approved by, affiliated with, endorsed by, or associated with Mojang Studios or Microsoft. All trademarks, service marks, and trade names (including "Minecraft") belong to their respective owners (Mojang Synergies AB / Microsoft Corporation).

About

A cross-platform voxel sandbox built in Rust, featuring procedural worlds, multiplayer, modding, and software/WGPU rendering.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages