Skip to main content
gamedev.net
🔒 Locked

Basic AI reaction

Started by quasty 0 replies 650+ views
Original Post
quasty
quasty
Hi, i''m looking for a way to implement an enemy reaction. If the enemy sees the hero it should come an get him - resp. take an attack position in front of the hero. The problem is - if got it more or less - but the enemy should react on the hero movment. At this moment he does - be every pixel the hero moves the enemy moves with him. This looks a little ''unnatural''. Has anyone an idea how i should implement the persuit? thanks
Kylotan
Kylotan
I''d probably build a degree of uncertainty into the system by calculating the exact desired spot (ie. wherever your enemy is moving to with your current system) and make the chance of moving towards that spot more likely depending on how far the enemy is from it. Or, when the hero moves, the enemy should look at the direction of movement and move in the same direction but for a distance that is slightly different to that of the hero; maybe +/- 25%. It would be hard to give better advice without knowing more about the parameters of your game, such as how far and how often characters move, whether it''s 2d or 3d, etc.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.