Simple search/avoid algorithms
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.
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.
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.
i dont think so... it shouldent be too hard to write yourself though. Ask for more specific help if you need though :).
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement