Advertisement

Groups of creatures attacking and following one creature

Started by July 05, 2001 06:33 AM
3 comments, last by Davaris 23 years, 4 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
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
Advertisement
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