MCPcopy Index your code
hub / github.com/dskart/rustcraft

github.com/dskart/rustcraft @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
139 symbols 227 edges 19 files 6 documented · 4%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Github Link MSRV license

Rustcraft

A simple Minecraft engine <i>in Rust</i>






  <img src="https://github.com/dskart/rustcraft/raw/main/photos/world_example1.png" alt="Logo" >

About The Project

Welcome to RUSTCRAFT! Rustcraft is a simple Minecraft engine written in rust using wgpu.

But Why?

I wanted to work on a project to learn more about wgpu as well as practice my Rust skills. I then randomly saw this youtube video and got inspired to try to make a simple Minecraft engine in Rust!

Inspiration

As I explained I was inspired by this video and the corresponding codebase. This is why you will probably see a lot of design similarities between my project and this one. Jdah, your video was awesome. (I also copied his blocks atlas because I liked it a lot).

Current State

I am pretty happy with the current state of the engine. There are a few problems with it but they are outside of my MVP scope. I am aware that the game is not as efficient and smooth as it should be. I initially set as a goal to not use any threading or unsafe rust. Turns out it is hard to generate the world efficiently without any of that so I did end up eventually using rayon (but I should really be using Tokio). This would require some not trivial redesign and maybe I will update this in the future 🤷.

The noise library I am using is also a bit slow. There are some issues with integrating it nicely into a bigger project but I don't really want to write my own noise library right now so this works.

Potential Updates

  • [ ] Transparent water
  • [ ] Lighting (real sun or "hacked" lighting)
  • [ ] Block memory map (saves location of broken/placed blocks)
  • [ ] Game physics
  • [ ] additional sprites: (tree, flowers)
  • [ ] Block selection during placement
  • [ ] Biomes
  • [ ] "Real" concurrency for chunk generation (Tokio).

Prerequisites

Running

cargo run --release

Arguments

Running in wireframe mode:

cargo run --release -- -w

Running with coordinate system at [0,0,0] (for debugging):

cargo run --release -- -c

Running a flat world:

cargo run --release -- -f

Running on Windows

On windows-msvc, make sure that you have a version of ninja.exe (download here) available in your PATH varaible.

Controls

  • awsd to move around
  • space move upwards
  • shift move down
  • left click break block
  • right click place block

Authors

License

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

Extension points exported contracts — how you extend this code

Draw (Interface)
(no doc) [4 implementers]
src/renderer.rs
Vertex (Interface)
(no doc) [4 implementers]
src/renderer.rs

Core symbols most depended-on inside this repo

block_vertex
called by 24
src/block.rs
init_parameter
called by 11
src/bitmap_font.rs
atlas_pos_to_coordinates
called by 10
src/atlas.rs
to_vec
called by 9
src/block.rs
crosshair_vertex
called by 6
src/crosshair.rs
update
called by 6
src/world.rs
coordinate_vertex
called by 6
src/coordinate.rs
overlay_info_vertex
called by 6
src/overlay_info.rs

Shape

Method 80
Class 31
Function 22
Enum 4
Interface 2

Languages

Rust100%

Modules by API surface

src/world.rs20 symbols
src/camera.rs15 symbols
src/block.rs12 symbols
src/bitmap_font.rs11 symbols
src/overlay_info.rs9 symbols
src/crosshair.rs8 symbols
src/renderer.rs7 symbols
src/engine.rs7 symbols
src/coordinate.rs7 symbols
src/chunk.rs7 symbols
src/player.rs6 symbols
src/main.rs6 symbols

For agents

$ claude mcp add rustcraft \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact