How do I prevent a lot of enemies with pathfinding from overlapping?

0 favourites
  • 7 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hello everyone, is it possible to do a "non-overlap" of enemies/sprites like in the vampire survivors game? I've seen several examples, I tried to use the boids plugin, but with too many sprites on the screen the game performance drops. Any suggestion.

  • Boids/flocking/steering style mechanics are probably the "best" way to do it. I don't know if the plugin implements it well or not though. It may have utilize calculations you may or may not need.

    Game performance drops in vampire survivors too, towards the end of a round. Also note that there aren't actually that many enemies on screen at any given time in vampire survivors. How many are you reaching before you have performance issues?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Not so long this kinda performance hit was discussed & related to Vampire Survivor case:

    construct.net/en/forum/construct-3/general-discussion-7/c3-good-engine-bullet-hell-170100

  • Not so long this kinda performance hit was discussed & related to Vampire Survivor case:

    https://www.construct.net/en/forum/construct-3/general-discussion-7/c3-good-engine-bullet-hell-170100#forumPost1070610

    I saw this post. It's very interesting. And I tested 800 sprites using pathfinding and the prototype didn't lose performance. My problem is avoiding the overlap.

    First I tried the behavior "custom movement", but the sprites are "jumping"

    Then I tried using the addon "boids", which is very good, but with many sprites, it showed slowness (I don't know if I did something wrong).

    Finally, I used your example: dropbox.com/s/4ahybqe3t0k758f/biters.c3p

    But enemies would collide and get stuck in each other and "fly" off the screen.

    My problem is not performance, I don't know how to prevent sprites from overlapping =(

  • Boids/flocking/steering style mechanics are probably the "best" way to do it. I don't know if the plugin implements it well or not though. It may have utilize calculations you may or may not need.

    Game performance drops in vampire survivors too, towards the end of a round. Also note that there aren't actually that many enemies on screen at any given time in vampire survivors. How many are you reaching before you have performance issues?

    I had performance loss with the "boids" addon used with 200 sprites. I may have used it wrongly... but I still gave up using the addon. Vampire survivor uses some tricks that I'm also adopting, like destroying sprites/enemies that are out of the screen for some time, for example...

    My problem is not performance, my problem is to avoid overlapping sprites =/

  • If you need a fast pathfinding, you can try EasyStarJS:

    howtoconstructdemos.com/prevent-multiple-enemies-with-pathfinding-from-overlapping-easystarjs

  • My problem is not performance, my problem is to avoid overlapping sprites =/

    Perhaps look into Pushout Solid ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)