Making a large Battle Simulator game with Bevy and Rust

Поділитися
Вставка
  • Опубліковано 25 січ 2025

КОМЕНТАРІ • 25

  • @bipedpotato
    @bipedpotato  10 місяців тому +7

    Subscribe for a "consistent" upload schedule, also I'm aware that this video doesn't have the most elegant explanations, and I guess youtube compression really dislikes this video as well I just wanted to get it out as soon as possible so we don't reach 4 months without uploading.

  • @vitasartemiev
    @vitasartemiev 9 місяців тому +16

    There is a crate called bevy-spatial. It provides kd-trees that track marked entities as a resource. It supports fast lookups within a radius, nearest neighbor lookups and axis-aligned rectangle lookups (see pull request). It may help you outright or inspire you for your own version.

  • @darknetworld
    @darknetworld 10 місяців тому +4

    That so cool. I bet it not easy to run smooth for many units in game.

    • @bipedpotato
      @bipedpotato  10 місяців тому +1

      yeah it was pretty complicated and I’ve only reached the surface of full potential battle simulators like UEBS that can simulate millions of units ON TERRAIN AND WITH ANIMATION without that much lag.

  • @itzhakeretzkdosha6875
    @itzhakeretzkdosha6875 10 місяців тому +4

    Great video! It would be nice if you explained the last part where you add shooting with some code and drawings

    • @bipedpotato
      @bipedpotato  10 місяців тому

      Yeah you are right but the video was getting a bit long, perhaps in another video further down the line?

  • @NOFAC394
    @NOFAC394 2 місяці тому +1

    You could also create a low poly tank and LOD the instances based on distance from the camera.

  • @morkallearns781
    @morkallearns781 10 місяців тому +2

    I've been making grass and am hitting a hard performance bottleneck, so I was thinking about trying a custom render pipeline to implement instancing as well. Fixed update might also be useful. Really cool stuff! Definitely relate to the "messy and inefficient" part, probably will have to rewrite it once I get all the pieces of my game working (gameplay tbd, but building a huge procedurally generated open world).

  • @bones-dev
    @bones-dev 10 місяців тому +2

    This is really awesome

  • @peterhayman
    @peterhayman 9 місяців тому

    thanks for sharing! traversing quad trees sounds super interesting

  • @Kram1032
    @Kram1032 4 місяці тому

    I wonder if you could further improve on the quad tree idea using adaptive volumetric fluid simulation methods: Do you really need to calculate the precise movement of every single unit stuck in the center of a large crowd? Maybe it's possible to approximate via clusters.
    That way, the quad tree would have the opposite behavior: Large chunks of crowd would count as a single multiunit that can only move more or less in lockstep. No need to calculate every single collision there. The closer to "the surface" (the frontline, the backline, the flanks) you get, the finer the grid as motion is less restricted.
    One tricky bit there is how to calculate individual positions from the summarized one without generating more work than was saved in the first place, but I suspect it might be possible.
    You'd also have to be able to quickly recalculate based on selection but I think that's already a problem now so you probably already solved that

  • @nihil75
    @nihil75 10 місяців тому +2

    umm.. I think Bevy 0.12 already does batching & instancing for you without a custom shader?
    I can render 6.5 million blades of grass with:
    var model = mesh_functions::get_model_matrix(vertex.instance_index);
    (I did not define instance_index myself. it's built in to the vertex input)

    • @bipedpotato
      @bipedpotato  10 місяців тому +3

      this way i have more control and can remove features that I deem to be useless to my project, also I did not know that instancing was already built into bevy and didn’t want to test it out.

  • @andydataguy
    @andydataguy 5 місяців тому +1

    Awesome video!

  • @GonziHere
    @GonziHere 10 місяців тому +1

    Nice, btw is it fully deterministic?

    • @bipedpotato
      @bipedpotato  10 місяців тому

      So i would like it to be but as you can probably tell from the last segment of the video, one side should not win by so much with equal units. The combat system is a really hacky system that I whipped up last minute so I didn’t really expect much either. Other than that the rest of the game should be completely deterministic as Its run on a fixed update.

  • @ArnaldurBjarnason
    @ArnaldurBjarnason Місяць тому +1

    2:15 O(n²) is quadratic, not exponential ;)

    • @bipedpotato
      @bipedpotato  Місяць тому

      Yeah you are right my bad

    • @aboliguu1168
      @aboliguu1168 4 дні тому

      Not nearly as big a deal as the use of the word ”shader instancing” which doesn’t mean anything. It’s ”gpu instancing” or just ”instancing” since shaders don’t really have anything to do with the main idea of instancing

  • @thedevblog5916
    @thedevblog5916 8 місяців тому

    Super cool! Sorry if I missed it, but are you using a custom physics engine? Or are you using a crate?

    • @bipedpotato
      @bipedpotato  8 місяців тому +2

      its just a simple separation check which is made more performant through a spatial partitioning system through a quadtree. I didn’t use any crates.

  • @JoMaFjErynMaLaZOr
    @JoMaFjErynMaLaZOr 10 місяців тому +2

    I like

  • @spindlywebs
    @spindlywebs 9 місяців тому

    always happy to see non ai gamedev vids :D

  • @LivanariLivanari
    @LivanariLivanari 7 місяців тому

    video is too hard to understand