Hi,
I'm new to AI so sorry for my incompetence.
I'm doing a 2D top view, fixed screen game. Top view is self explanatory, by "fixed screen game" I mean there is no scrolling, one can see the whole map.
The goal of the game for the player:
1. Defeat all PC enemies (there are constant amount of enemies at map).
2. Defend the base.
The goal of PC enemies either
1. Kill the player
or
2. Destroy the base.
At a given time, the map can contain no more then 3 enemies.
Map contains a passable areas (places to where you can move), un-passable and destroyable areas (areas to where you can not move [walls] but can be destroyed by shoot) and un-passable and un-destroyable areas.
Each entity (either controller by player or pc) can move on the map and rotate it self 360 degrees.
I want to code the AI in LUA. I want to have different types of AI's for example:
1. The dumb one - simply moves around and shoots if he see the player or the base
2. The goal achiever - his goal is to destroy the base, and if he notices the player he shoots at him.
3. The killer - his goal to kill the player.
Since I have to experience at all in AI, I would like to get some advices or tutorial on how to do it.
Thank you very much for any kind of help!
skwee
Suggestions for AI technique
If the map is relatively clear then "steering behaviors" are the way to go, otherwise you'll need actual path finding. "A*" is the generally accepted best path-finding algorithm when you want the shortest path from A to B. Though there are faster things you can do if you have redundancy in your path-finding (like lots of guys going to the same place as discussed recently here: http://www.gamedev.net/community/forums/topic.asp?topic_id=579076)
The behavior besides path-finding can be written exactly as you describe it. You just have to work out exactly what notices the player means. If you want sight to be blocked by objects then you'll want to look into "line of sight" checks, otherwise a simple distance check would be sufficient. If you want more complex behaviors like continuing to chase to last known position before giving up, then you'll want to look into "finite state machines". A lot of intelligent seeming behaviors can be written into an FSM pretty easily.
That should be enough search terms to get your research started. My best advice for game AI is to not over-complicate things, but I'd be lying if I said I ever followed that advice.
The behavior besides path-finding can be written exactly as you describe it. You just have to work out exactly what notices the player means. If you want sight to be blocked by objects then you'll want to look into "line of sight" checks, otherwise a simple distance check would be sufficient. If you want more complex behaviors like continuing to chase to last known position before giving up, then you'll want to look into "finite state machines". A lot of intelligent seeming behaviors can be written into an FSM pretty easily.
That should be enough search terms to get your research started. My best advice for game AI is to not over-complicate things, but I'd be lying if I said I ever followed that advice.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement