Simple search/avoid algorithms

Started by
4 comments, last by Taymo 18 years, 5 months ago
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.
Dev Journal - Ride the Spiralhttp://spiralride.blogspot.com/
Advertisement
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.
-www.freewebs.com/tm1rbrt -> check out my gameboy emulator ( worklog updated regularly )
Any algorithms you know of? If not I will just do it myself but I just wanted to know.
Dev Journal - Ride the Spiralhttp://spiralride.blogspot.com/
i dont think so... it shouldent be too hard to write yourself though. Ask for more specific help if you need though :).
-www.freewebs.com/tm1rbrt -> check out my gameboy emulator ( worklog updated regularly )
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.
It's 2D. I think I am gonna start on my own and then like ErUs said I will ask more specific questions when needed. Thanks for your time!
Dev Journal - Ride the Spiralhttp://spiralride.blogspot.com/

This topic is closed to new replies.

Advertisement