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
  • ИгрыИгры

Комментарии • 35

  • @zanzlanz
    @zanzlanz 2 года назад +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 2 года назад +65

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

    • @felix8307
      @felix8307 Год назад

      lmao

    • @w花b
      @w花b Год назад +7

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

    • @Conlexio
      @Conlexio Год назад

      i just went to type this lol

  • @LoganDark4357
    @LoganDark4357 2 года назад +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 Год назад +2

      💀

    • @LoganDark4357
      @LoganDark4357 Год назад +2

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

  • @wrldfrice
    @wrldfrice 2 года назад +4

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

  • @netcore10
    @netcore10 2 года назад +1

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

  • @tomchapman128
    @tomchapman128 2 года назад +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

  • @Dannnneh
    @Dannnneh Год назад +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  Год назад +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 Год назад

      @@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  Год назад +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 Год назад

      @@DouglasDwyer Thank you for the clarification :)

  • @diadetediotedio6918
    @diadetediotedio6918 Год назад +1

    Your work is really good!

  • @user-jy5yh9on4l
    @user-jy5yh9on4l Год назад +2

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

  • @clemdemort9613
    @clemdemort9613 2 года назад +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  2 года назад +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 2 года назад

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

  • @zooi.
    @zooi. 2 года назад +16

    your microphone is phenomenal

  • @gaborkrisko
    @gaborkrisko Год назад +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  Год назад +3

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

  • @Caellyan
    @Caellyan Год назад

    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  Год назад +2

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

  • @stephenkamenar
    @stephenkamenar Год назад

    C++ IS GONE crab rave lmao!

  • @eirik6502
    @eirik6502 10 месяцев назад +1

    Do you use the ash crate?

    • @DouglasDwyer
      @DouglasDwyer  10 месяцев назад

      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
    @jordanserres-gonzalez9634 2 года назад +6

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

  • @MasterZeroFX
    @MasterZeroFX 2 года назад

    Oh, the meme language

  • @Nanagos
    @Nanagos 2 года назад +11

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