I Remade my Voxel Engine from Scratch…



well… I had to… I didn’t start with the right tools so I had to remake it. But thanks to the knowledge and skills I got from making it the first time, I remade almost all of it and most parts even better than before in a third of the time.

I first made my voxel engine in c++ and OpenGL because I was doing it for fun and to learn graphics API, but now that the project got bigger I had to switch to better tools. I chose rust and bevy.

I recoded most of the features into this new engine such a random infinite world generation by loading and unloading chunks, world destruction with particles, skybox, fog and also added textures and better digging. I left out a few things like the villages because they aren’t really engine-related.

Thankfully I used this opportunity to re-work how I approach voxels rendering and destruction, allowing huge optimisations that would have required me to remake it anyway 🙂

Next I’d like to make a game out of this like I talked about before and never did lmao
I’m thinking of a game where you use superpowers to destroy enemy bases or something like that. I wanna play a lot with the particle systems and the destruction to create cool satisfying effects.

TanTan ( inspiration to use rust and bevy ): @Tantandev
His video about using unity, rust and bevy: https://youtu.be/G-IuH6R-yD8

Bevy: https://bevyengine.org/
I also used Bevy Hanabi for particles: https://github.com/djeedai/bevy_hanabi

———————————

Subscribe for game making tutorials, other game-making related content and to follow my projects with the devlogs !

0:00 Intro
0:27 Textures
0:40 Better Digging
0:55 Broken
1:20 Rust & Vulkan
2:01 Recoding
2:27 Learning
3:36 Research
4:19 Bevy
4:50 Remake Part 1
7:24 Remake Part 2
9:06 Remake Part 3
10:06 Final touches

source

Related posts

8 easy steps to turn your WebGame into a Steam game using Electron JS

The 20 WORST PlayStation Games of The Century

【2025年2月1週目】今週の新作タイトル12本プレイレビュー!

29 comments

@AdamCodes2 December 27, 2024 - 6:10 am
To optimize the engine you can use ocular exclusion
@AdamCodes2 December 27, 2024 - 6:10 am
Make this open source or make a tutorial with source code
@ImGelling December 27, 2024 - 6:10 am
If mineceaft Java exists, YOU DONT NEED OTHER Languages. If they cab do it, so can you.
@RicardoRocky0 December 27, 2024 - 6:10 am
Step 1. Making a voxel engine from scratch
Step 2. Remaking my voxel engine from scratch
Step 3. Recreating a computer from scratch
@ThePC007 December 27, 2024 - 6:10 am
What GPU are you running this on? I’m currently trying to render voxels myself and it’d be kinda nice to put the performance you’re getting into perspective. :)
@the0neskater December 27, 2024 - 6:10 am
I can assure you opengl and c++ were not your issues haha...
@delphicdescant December 27, 2024 - 6:10 am
The Rust hype is greatly overplayed tbh.
You could have done just as well, just as easily, with C++.
Mostly it's just usually not worth switching languages or API's based on popularity contests, and sticking to something that you're familiar with has a greater advantage imo.
But I'm not criticizing you - just hoping you don't get stuck in a loop of "stack switching" like sometimes happens to programmers' hobby projects.
@MaxIzrin December 27, 2024 - 6:10 am
"Max is stupid"
Extremely relatable.
I also remake my whole [insert project here] from scratch on occasion.
@PotionScape December 27, 2024 - 6:10 am
In the unity game im making, I somehow got it up to 1 billion voxels rendered, but that is like, totally out of the use cases that i would need
@AndrewBrownK December 27, 2024 - 6:10 am
Thinking about TNT in minecraft, the performance on your engine is looking really promising so far
@talis1063 December 27, 2024 - 6:10 am
OpenGL would've been fine if you understand the limitations. In OpenGL you can mapBuffer on main thread, fill it on a different thread and pass an event to main thread that unmaps it again. The highest performance approach is probably allocating a large buffer, and using something like glMultiDrawElementsIndirect to render stuff. Can basically implement a custom allocator that way, and render opaque chunks with a single draw call.
The thing not clear about OpenGL is that you're writing commands to memory not executing them on the GPU directly. Important to know to avoid freezing.
@kpopalitfonzelitaclide2147 December 27, 2024 - 6:10 am
You could just use vulkan and c++
@Vilebreken December 27, 2024 - 6:10 am
Do you speak french?
@agoatchannnel December 27, 2024 - 6:10 am
Why did you say “my videos suck” on discord, there really good
@Skeffles December 27, 2024 - 6:10 am
Brilliant! How do you like working with bevy and rust?
@Blarggnugget December 27, 2024 - 6:10 am
Mutithreading in rust is going to be painful. More so than c++ since rust is very anal about ownership. I HIGHLY recommend using a library called rayon. Rayon provides parallel iterators that make multithreading easy. There is also a scope/spawn functionality that might be more useful than just iterators
@tadeohepperle7514 December 27, 2024 - 6:10 am
From your experience, would you say that creating inividual triangulated meshes from voxel data first, is much better than sending the voxels to the GPU as simple primitives (quads) using instancing?
@orangomango December 27, 2024 - 6:10 am
Really nice videos, I'm making a voxel engine too (just that it's taking me like a few months lol) and I randomly discovered your videos. Great work!
@toao_rainys December 27, 2024 - 6:10 am
not as impressive since you used an engine 😤anyways, the shadows finally look good though.
@HAAAAAAAAHHHHHH December 27, 2024 - 6:10 am
Not really related to the video, but are you from Quebec ? xd
@naterthan5569 December 27, 2024 - 6:10 am
If you only turned on release mode at 8:00, does that mean that the performance tests in the middle of the video were also in debug mode?
@oglothenerd December 27, 2024 - 6:10 am
Do you have a Discord server?
@Lemonzy December 27, 2024 - 6:10 am
Very cool! I love Rust and Bevy, it's easy to get started but it can sometimes be difficult.
@AllExistence December 27, 2024 - 6:10 am
NOT from scratch.
@IsaacCode95 December 27, 2024 - 6:10 am
So theres no way to achieve the same with c++ and vulkan instead of opengl ?
@oglothenerd December 27, 2024 - 6:10 am
Do you use Git for version control? It allows you to rollback if you make mistakes.
@AIAdev December 27, 2024 - 6:10 am
pigboss x max collab? sus.
@finalforeach December 27, 2024 - 6:10 am
The nice thing about the prototype stage is that you don't need to be scared of tech debt... Rewrites galore!
@stiliok December 27, 2024 - 6:10 am
What AI did you use? 2:53

Comments are closed.

Add Comment