🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Groups of creatures attacking and following one creature

Started by
3 comments, last by Davaris 22 years, 11 months ago
Hey guys, I''ve been working on a problem with my game. Basically I want creatures to chase the player and not collide with each other as they chase him. I have The A* algo working fine and some collision resolution but they still bump into each other too much. I''ve noticed Diablo does this well. The enemies can chase the player without collisions. Have any of you dealt with this problem? If so what solutions did you use? My first and only idea is if a creatures has the same target and is traveling in roughly the same direction then they join a group which has a leader. They all follow the same path the leader is following (though at a distance from the path so they don''t collide). However this would cause problems if there are corridors and rooms.
"I am a pitbull on the pantleg of opportunity."George W. Bush
Advertisement
quote: Original post by Davaris
Hey guys,
I''ve been working on a problem with my game. Basically
I want creatures to chase the player and not collide with each other as they chase him. I have The A* algo working fine and
some collision resolution but they still bump into each other
too much. I''ve noticed Diablo does this well. The enemies
can chase the player without collisions. Have any of you dealt
with this problem? If so what solutions did you use?

My first and only idea is if a creatures has the same target
and is traveling in roughly the same direction then they join a group which has a leader. They all follow the same path the leader is following (though at a distance from the path so they don''t collide). However this would cause problems if there are corridors and rooms.



Perhaps you should consider using the "avoidance" and "pursuit" aspects of
Craig Reynold''s Steering Behaviors?

http://www.red3d.com/cwr/steer/

Good luck,

Eric
Can I add that exactly in the same article, Reynolds is also talking about flocking, which is part of the solution you are looking for. To make it a bit clearer, what you want is flocking the whole group around the leader, which includes individual obstacle avoidance by definition (one boid to another). In case a member of the team is lost, it only needs to avoid until it finds a part of the spline the leader is following. Also one last thing: in my opinion sometimes game programming is all about cheating (aka black art)so if a member of the team is lost, just teleport it somewhere near the leader (offcourse as long as it not visible by the player).
Hey thanks for the link. This will keep me busy for a while.
"I am a pitbull on the pantleg of opportunity."George W. Bush
Also, many of the authors participating in Jrobots have implemented such behaviours in Java, so contacting them might help you. It''s also a useful testbed for development.

ld
No Excuses

This topic is closed to new replies.

Advertisement