Sign in to follow this  
Taymo

Simple search/avoid algorithms

Recommended Posts

I am working on a 2D topdown shooter like Galaga and currently working on the AI of the enemies. I'v tryed a couple little algorithms of my own but none really worked that well. What I want is simple AI of the enemies that will com in close and try to shoot the main charactor. If they miss and stay alive they should circle around (not a perfect circle) and come at me again. Anyone know af any algorithms for this or techniques for achiving what I want? Anything will be very helpful.

Share this post


Link to post
Share on other sites
It seems fairly self explanatory.

If enemys can see the player, try and move closer ( maybe strafe a bit ) and fire at him. If they lose sight of him maybe they should move to his last known position.
[edit]

maybe i rushed that a bit. I think galaga is the game with the space ships from the start of tekken?

well maybe assign enemys a state of mind. Such as move in to attack or fall back a bit.

Share this post


Link to post
Share on other sites
If there little to no pathfinding involved, just plain 3D movement, I suggest doing a simple attraction/repulsion. For additional functionality you can store unit' position for last 10 seconds every second. This will give you his approximate last location.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this