Designing a FLEXIBLE game engine with Rust [Voxel Devlog #6]
HTML-код
- Опубликовано: 16 июл 2024
- In this episode, I discuss the design patterns that I employed to rebuild my voxel engine in Rust. I talk about the hybrid entity-component-event-system utilized for updating world state, point out some key Rust features that keep my code performant, and touch upon browser-based multithreading.
If you're interested in learning more about the Rust programming language, there are many great RUclips videos and articles on the topic! That said, note that this video is NOT meant to be a comparative analysis of Rust and other languages. Just because I talk about Rust's benefits in this video doesn't make it objectively better, or worse, than other languages.
Music used in the video:
David Cutter Music - Over There
Punch Deck - Dreamweaver
AdhesiveWombat - 8 Bit Adventure Игры
There's normal everyday programming, and then there's low level octree abstraction with a custom ECS in Rust.
You're doing amazing work in such short spans of time. Keep at it; this is a fun project to watch unfold!
ZANZLANZ?!!?!!?
I think your mic gets worse every video. Cool stuff tho.
lmao
I immediately went to check the very first video and bursted out laughing
i just went to type this lol
Your echo box is getting better, but I can still understand what you're saying - maybe you could try something like glass, which should reflect the sound better. That way your mic should sound a lot worse, which should help a lot with the video quality. Hope this helps!
💀
@@gazehound I swear it gets harder to understand their voice every video so I'm sure it's intentional
i love seeing this progress as it comes along! keep up the good work man
This is turning out great! keep up the good work!
This series is great! Keep up the good work and I can't wait for the next episode! I've just watched all 7 episodes in the past hour lol
me too :D
I personally would prefer no background music, or toned down music that does not risk overriding your voice.
I am trying to learn more about ECS so this episode was particularly relevant.
For your octree implementation, I wonder if you could somehow still get the same level of performance in C++.
Thanks for the feedback. I am trying to strike a balance between the background music (which I personally like; it mirrors the style of some other devlog channels I watch) and the narration.
As for octrees, yes, I observe performance on par with C++. Rust uses LLVM, the same backend as Clang, to generate its assembly. The abstractions are zero-cost, so the performance is the same. I will say that I use SIMD and unsafe Rust for the octrees, though, because it is so performance critical. As such, the implementation is perhaps very similar to the C++ version.
@@DouglasDwyer I interpreted your explanation in the video as Rust being superior to C++ for that scenario, but I take it that is not necessarily the case.
I would have to do a precise benchmark - but I found them to be similar times. My comment was meant to say that, from a *design* perspective, I found Rust to be superior to C++. Using Rust generics, a feature which allows you to essentially substitute/compose functions at compile time, I was able to simplify the octree code in a way that C++ templates (the equivalent of generics) wouldn't easily allow. The C++ version was more verbose and "crufty."
Indeed, I did find Rust's performance to be superior to that of C#, an object-oriented language, because the C# runtime adds overhead (this I mention in the video). C++ however is a lower-level language which doesn't have such runtime costs. However, the language is harder to deal with than Rust (in my opinion).
@@DouglasDwyer Thank you for the clarification :)
Your work is really good!
It’s looks like you can implement world generation with fractals to memory save
That's pretty cool! I'm trying to get into Rust myself, but I'm experiencing difficulties ;p
Also, what did you use as a graphics API for rust?
I am using the glow crate, which provides cross-platform OpenGL bindings for both web and native. If you're looking for something more modern, WGPU is awesome, but it was too much a moving target for me! I also hear that, for higher-level game programming, Bevy is very useful.
@@DouglasDwyer thanks I'll give it a try then!
That's one thing I love about rust, crates are awesome!
your microphone is phenomenal
its unbelievable
It would be cool if mods in the game used webassembly, then creators could write their mods in any programming language (that targets wasm)
This is actually exactly what I am planning! It would be a completely cross-platform, performant, extensible and secure way to do modding :)
Have you considered using a WASM runtime in your engine so that others can write plugins in WASM, or are you going to stick with something more standard like Lua?
I think WASM plugins could be a cool idea.
WASM is actually exactly what I am planning! It would be a completely language-agnostic, performant, extensible and secure way to do modding :)
C++ IS GONE crab rave lmao!
Do you use the ash crate?
I currently use OpenGL so that I can target both web and native platforms, but I'm hoping to switch to WGPU very soon!
please keep the bad mic it adds so much character to the videos and it always makes me feel good when i hear it!
Oh, the meme language
Your videos are very interesting. But please, change your microphone. Are you using a hair dryer to record this?