Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


question on tracking/following character

This topic is 5362 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey y''all, I''m currently planning the AI for a sophmore game at the digipen institute of technology. One of my tasks is to create a "cop" character that will chase the player if he is alerted of a robbery (you play a theif). However, the cop has to chase the player through a semi-complex town and so he has to worry about following the player and colliding with walls and other townspeople. I really haven''t been able to generate any solid ideas on how to do this. I guess I could always continually generate a fast path with a best first pathfinding algorithm, but there must be a better way..... Any ideas? I simply need a way for this cop to move towards and continue to follow the player through this town. Thanks! Ben

Share this post

Link to post
Share on other sites
What you could do, for optimization reasons, is the following:

- limit the "create new path" algorithm to let's say every 10th logical frame

- use "waypoints", that means the following:
1.) get the player's position and calculate path
2.) go there (path doesn't need to be actualized until then, just has to be followed)
3.) if there, goto step 1 again (if the player hasn't been caught, of course *g*)

Maybe that helped a little...


--si tacuisses, philosophus mansisses--

edit: minor changes

[edited by - Indeterminatus on April 13, 2004 2:18:09 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!