Overlapping doubt!

0 favourites
  • 7 posts
  • i created a flying enemy, that chases player when it has Line of sight. I had given tween behavior to chase the player. Everything is fine, but when 3 enemy at same time created..it causes overlapping, how to get rid of it.

  • That is a tough one even for teams of professionals. It may be easier to design the game around this and avoid or at least minimize the chance of enemies overlapping each other.

    If you decide to tackle the problem be prepared to spend a lot of time on it. There are faster solutions, but they will not work 1/2 the time

  • ya thanks a lot for your reply...the below link seems to be a good solution...

    Solution : youtube.com/watch

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's one of those kinda works a little better solutions I mantioned, but not really a solution.

    I would personally design the game so you don't have a situation where you have to worry about it, but that may require using something other than line of sight behavior to go after your character.

  • ya it's not perfect...but a temporary one...anyway thanks for your response my friend.

  • You will need to use a different behaviour rather than tween, pathfinding or moveto will work, however proper collision avoidance is indeed a classic problem. I have previously used states such as IsChasing, IsBlocked. IsChasing would be when the enemy has line of sight and is not about to collide with another enemy, and it should move towards the player. IsBlocked is triggered by using raycasting to determine if a collision is about to happen and at what angle etc. Knowing that you can move the nearly colliding objects by math at an appropriate angle to avoid the collision and continue moving towards the player.

    I would avoid using solid collisions as it causes the exact issue you see in that video.

    Check out this video on Boids, it's not construct related but is good understanding: youtube.com/watch

  • ya i look for it...thank you for your response...

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