Do I use line of sight or pathfinding, or both?

0 favourites
  • 2 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • I'm struggling with ai behaviour. The situation is as following: npc's are walking down the streets of the city, another npc is coming towards them. At this moment in time, I'm trying to figure out how to make them move around each other and continue on their merry way.

    I experimented a bit with pathfinding, but I don't really want the npc's to have set goals, other then to walk around and I haven't figured out how to do that yet.

    The npc family has these behaviors:

    Bullet: When they spawn they go in the direction of the spawner.

    Pathfinding: Nothing in here yet

    Line of sight:Nothing in here yet

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use line of sight to detect when they are approaching each other and based on their angle have them start adjusting their angle slightly away in either direction. You could also do an overlap at offset check and if they collide then have them start angling away in either direction, or you can use vector Y to move them up or down the screen to avoid each other if that doesn't look too weird. I wouldn't use pathfinding for this.

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