Remaking my game from scratch in an ECS with Rust and Bevy

Поделиться
HTML-код
  • Опубликовано: 29 окт 2024

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

  • @bipedpotato
    @bipedpotato  2 года назад +15

    let me know if u guys think i should make videos without music or with music im trying out without music at the moment and i want to know ur thoughts about it.

    • @omdangy
      @omdangy 2 года назад +8

      No need for music. Voice quality could be better though!

    • @Temak11233
      @Temak11233 2 года назад +5

      No music please!

    • @perc-ai
      @perc-ai 2 года назад

      Low music

    • @theothercreare
      @theothercreare 2 года назад +2

      I think some quiet background music would be good

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

      No music, for me at least the content speaks for itself 🙏

  • @hakler
    @hakler 2 года назад +81

    I would recomend using a profiler to see what's actually tanking your fps before just giving up on for exaple quadtrees. Though I think spacial hashing would be a better fit for you in this case.

    • @bipedpotato
      @bipedpotato  2 года назад +7

      ye i probably should have used a profiler because quadtrees in theory should be able to make it so much faster lol.

    • @moonshinetheleocat1235
      @moonshinetheleocat1235 Год назад +23

      Doesn't really surprise me too much.
      DICE ran into a similar issue when designing one of the battlefield games. They realized later on that brute forcing the array was actually faster than the quad tree till they reached a certain threshold.
      Instead of implementing a quad tree, which they found out the speed loss was primarily pointer hopping. They did spatial hashing where entity data that could potentially collide were put into buckets that were just arrays
      What they found out was that processors have gotten a lot faster. But memory hasn't. And bouncing on pointers isn't good

    • @ParanoicoBR
      @ParanoicoBR Год назад +7

      @bipedpotato7610 I'm not 100% sure, but it seems the performance of the quadtree might be worse because of cpu cache misses, which occur more often on sparse datastructures.
      When you use arrays instead, the data is packed more tightly together which usually reduces the number os caches misses - one of the main aggressors for perfomance degradation on modern cpus.
      Just food for thought: you could get even better performance with quadtree using memory arenas or another memory allocation strategy to pack the quadtree nodes more tightly together - possibly reducing cache misses. I cant even imagine how painful it would be to implement it tho lol

  • @laundmo
    @laundmo 2 года назад +69

    re: spatial partitioning, I'm the author of bevy_spatial which uses kd-trees or r*-trees for spatial partitioning and lets you do efficient k-nearest-neighbour queries on your entities. I've mostly tested it with single/few queries on large amounts of entities, and in examples i'm able to reach 40K moving entities before dropping below 144hz, with it re-creating the kd-tree every frame.
    there's definitely some work to be done on the crate, for example detaching the calculations from bevy's main loop, but so far I'm happy with what it provides.

    • @bipedpotato
      @bipedpotato  2 года назад +12

      Never actually looked into bevy_spatial maybe i will integrate it into the game in the near future.

  • @ReadingOcelotl
    @ReadingOcelotl Год назад +8

    Nice work, really cool. There are almost no one making rts games in any framework, good luck !

  • @johanhellberg9677
    @johanhellberg9677 11 месяцев назад +1

    Awesome! Cool work on the game

  • @mfyoutube5003
    @mfyoutube5003 Год назад +4

    wow thank you very much for this video!! you motivated me
    cheers from France

  • @gospher6342
    @gospher6342 2 года назад +3

    Keep it going my dude

  • @benx011
    @benx011 2 года назад +9

    very nice, but i think you should lower their hp. music would help but the trick is to make it unnoticeable, most mistake ppl make is having them too loud

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

      thx this was just me testing out if no music is better than my last few videos with music. I will try to make it unoticable but can u check them out and tell me if the audio is right?

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

      @@bipedpotato btw im an editor (u can check my yt) so im kind of experienced with that kind of stuff if u want some help lmk

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

    "As I was concerned for their health"
    Now I'm worried for _my_ health with how hard this made me laugh... xD
    Earned a well deserved sub that joke did.

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

    Very nice information Sir

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

    Hey, great vid! How are you doing the target selection in this game? I'm trying to make some kind of RTS prototype in bevy myself but I'm already having trouble with translating the screen position of a click into a world position on the ground. I know I need to do raycasting, I've been looking into bevy_mod_picking and bevy_mod_raycast but the examples don't really show anything like this and the docs are not very helpful either.

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

      Ive been using bevy_mod_raycast for this if i remember correctly one of the examples mouse_intersection? I think shows how you can enable the mouse to raycast onto objects. I used a plane to raycast giving me two points which i form into a square area which the objects that are inside will be selected/

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

      @@bipedpotato thanks, I'll take a look at that, if I remember I'll give an update what worked so others can learn from it too

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

    How many entities can you have max? I got custom ECS I made for unreal and it can handle 1 million entities with basic logic. Unity ECS not as optimized as it could be so I’m afraid bevy could be the same

    • @bipedpotato
      @bipedpotato  2 года назад +2

      Well i can only handle like 100000 at like 5 fps given i need to test for collision,attacks,flocking, and graphics take up lots of performance. Im sure you can run a benchmark on bevy without any graphics with only entities and just spawn like a shitton of them and test for fps. Bevy is really performant and can probably handle slightly more if you haven’t taken lots of time into optimizing your custom ecs.

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

      bevy maintains 40fps WHILE generating a map with 6.5 millions tiles, where every single tile is an Entity with Components, on 5 years old i5. I think it is pretty impressive for 0.11 version
      Also I saw the guy that is making Rimworld clone, but with thousands of NPCs, on bevy. He said that the same implementation gave him 100fps with Godot and 900 fps with Bevy (and that's the reason behind going with it)

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

      @@alexandrbromles8658 thanks for sharing. That’s impressive. I’m keeping my eye on Bevy for sure.

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

    What is your editor theme and is it available for Neovim?
    Also awesome video, I've tinkered with Rust off and on but never really got too into it. I kinda wanna try this out for my next project though,

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

      Its called the synthwave theme for vscode. I dont know if it is available for neo vim but if u use it for vscode it might corrupt rust analyzer.

  • @Milk-yi9hg
    @Milk-yi9hg 2 года назад +1

    Hey this would be a really cool video try rewriting your c++ game engine in rust with Bevy or OpenGL.

    • @skidodleman6669
      @skidodleman6669 2 года назад +3

      Bevy is a game engine

    • @Milk-yi9hg
      @Milk-yi9hg 2 года назад

      @@skidodleman6669 yes but his has a visual editor and bevy could still be used for making a game engine anyway.

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

      @@Milk-yi9hg but why would you use a game engine to create another game engine??? That makes zero sense

    • @Milk-yi9hg
      @Milk-yi9hg 2 года назад

      @@skidodleman6669 What is the difference between an engine and a framework?

    • @Milk-yi9hg
      @Milk-yi9hg 2 года назад

      @@skidodleman6669 ok

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

    U colorblind? That's not red.
    Anyway good tutorial

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

      Lol i forgot i changed the color theme

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

    Oh man, those things look like evil furbies. What is the boids stuff doing now? It feels like you started out with that but apart from avoiding eachother they seem to all just beeline to the target.
    I know you asked about music: I feel like with your current microphone the sound quality of your voice isn't good enougd for a distraction like music.
    Another bit of feedback: when showing us what happens in the game: put it fullscreen, the outline of your editor isn't usefull, it's taking up space and the terminal scrolling is distracting.

    • @bipedpotato
      @bipedpotato  2 года назад +2

      So i’ve pretty much tuned down the boids system so much that the only really noticeable component of it is seperation. I might add it in again if i feel like it is worth it. Also im getting a new mic soon so the sound quality will be much better. I might go into fullscreen when i show things next time but i feel like seeing the code a bit is slightly interesting for programmers who can see how some things are done in fragments.

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

    I tried Bevy ECS but I just couldn't get it, Rust overall has a rather strange syntax honestly, My biggest issue was being unable to directly pass parameters into functions like usual, Resources were also really weird to access. (Example: res_mut)

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

      yeah ecs did seem a bit alien to me when i first tried it, although bevy wasn't the first ecs i used it felt a lot better than the other ones that i used previously which was a big part of why i use Bevy so much.

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

      @@bipedpotato It wasn't so much ECS for me as much as it was actually trying to access values in the world itself.

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

      i would argue that this within the bounds of ECS but i can totally understand the difficulties that you encountered.

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

    Awesome

  • @TheGreatProphecy
    @TheGreatProphecy Год назад +4

    this man said they are red and blue... I see red and Grey.. Are you colorblind, or am I?

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

    Out of topic sorry but what is that Windows theme?

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

    dude you're fucking smart

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

    Did you finish the remake?

  • @ProPlayer-fm4hb
    @ProPlayer-fm4hb 2 года назад +1

    Noice m8

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

    danke mi man

  • @hpw-dev
    @hpw-dev Год назад +1

    хороший видос

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

    In the setup, appreciate the videos! Maybe a dumb question but is there a way to export content in mono in soft20?

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

    How long does it take to learn soft?

  • @tomtravis858
    @tomtravis858 11 месяцев назад

    Projects that change technologies tend to fail, stick with something, implementation is way more important than programming language.