Designing a FLEXIBLE game engine with Rust [Voxel Devlog #6]

Sdílet
Vložit
  • čas přidán 25. 07. 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 CZcams 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
  • Hry

Komentáře • 35

  • @zanzlanz
    @zanzlanz Před 2 lety +29

    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!

  • @Bruiserjoe
    @Bruiserjoe Před 2 lety +65

    I think your mic gets worse every video. Cool stuff tho.

    • @felix8307
      @felix8307 Před rokem

      lmao

    • @w花b
      @w花b Před rokem +7

      I immediately went to check the very first video and bursted out laughing

    • @Conlexio
      @Conlexio Před rokem

      i just went to type this lol

  • @LoganDark4357
    @LoganDark4357 Před 2 lety +28

    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
      @gazehound Před rokem +2

      💀

    • @LoganDark4357
      @LoganDark4357 Před rokem +2

      @@gazehound I swear it gets harder to understand their voice every video so I'm sure it's intentional

  • @wrldfrice
    @wrldfrice Před 2 lety +4

    i love seeing this progress as it comes along! keep up the good work man

  • @netcore10
    @netcore10 Před 2 lety +1

    This is turning out great! keep up the good work!

  • @tomchapman128
    @tomchapman128 Před 2 lety +1

    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

  • @diadetediotedio6918
    @diadetediotedio6918 Před rokem +1

    Your work is really good!

  • @Dannnneh
    @Dannnneh Před 2 lety +4

    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++.

    • @DouglasDwyer
      @DouglasDwyer  Před 2 lety +3

      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.

    • @Dannnneh
      @Dannnneh Před 2 lety

      @@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.

    • @DouglasDwyer
      @DouglasDwyer  Před 2 lety +3

      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).

    • @Dannnneh
      @Dannnneh Před 2 lety

      @@DouglasDwyer Thank you for the clarification :)

  • @user-jy5yh9on4l
    @user-jy5yh9on4l Před 2 lety +2

    It’s looks like you can implement world generation with fractals to memory save

  • @zooi.
    @zooi. Před 2 lety +16

    your microphone is phenomenal

  • @gaborkrisko
    @gaborkrisko Před rokem +1

    It would be cool if mods in the game used webassembly, then creators could write their mods in any programming language (that targets wasm)

    • @DouglasDwyer
      @DouglasDwyer  Před rokem +3

      This is actually exactly what I am planning! It would be a completely cross-platform, performant, extensible and secure way to do modding :)

  • @clemdemort9613
    @clemdemort9613 Před 2 lety +2

    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?

    • @DouglasDwyer
      @DouglasDwyer  Před 2 lety +6

      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.

    • @clemdemort9613
      @clemdemort9613 Před 2 lety

      @@DouglasDwyer thanks I'll give it a try then!
      That's one thing I love about rust, crates are awesome!

  • @Caellyan
    @Caellyan Před rokem

    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.

    • @DouglasDwyer
      @DouglasDwyer  Před rokem +2

      WASM is actually exactly what I am planning! It would be a completely language-agnostic, performant, extensible and secure way to do modding :)

  • @eirik6502
    @eirik6502 Před 11 měsíci +1

    Do you use the ash crate?

    • @DouglasDwyer
      @DouglasDwyer  Před 11 měsíci

      I currently use OpenGL so that I can target both web and native platforms, but I'm hoping to switch to WGPU very soon!

  • @jordanserres-gonzalez9634

    please keep the bad mic it adds so much character to the videos and it always makes me feel good when i hear it!

  • @stephenkamenar
    @stephenkamenar Před rokem

    C++ IS GONE crab rave lmao!

  • @MasterZeroFX
    @MasterZeroFX Před 2 lety

    Oh, the meme language

  • @Nanagos
    @Nanagos Před 2 lety +11

    Your videos are very interesting. But please, change your microphone. Are you using a hair dryer to record this?