Game Development Reference
In-Depth Information
Building Advanced AI
The AI we have right now can kick some ass, but it is too dumb for any seasoned gamer to
compete with. This is the list of current flaws:
1.
It does not navigate well, gets stuck among trees or somewhere near water.
2.
It is not aware of powerups.
3.
It could do better job at shooting.
4.
It's field of vision is too small, compared to player's, who is equipped with radar.
We will tackle these issues in current chapter.
Improving Tank Navigation
Tanks shouldn't behave like Roombas, randomly driving around and bumping into things.
They could be navigating like this:
1.
Consult with current AI state and find or update destination point.
2.
If destination has changed, calculate shortest path to destination.
3.
Move along the calculated path.
4.
Repeat.
If this looks easy, let me assure you, it would probably require rewriting the majority
of AI and Map code we have at this point, and it is pretty tricky to implement with
procedurally generated maps, because normally you would use a map editor to set up
waypoints, navigation mesh or other hints for AI so it doesn't get stuck. Sometimes it is
better to have something working imperfectly over a perfect solution that never happens,
thus we will use simple things that will make as much impact as possible without rewriting
half of the code.
Generating Friendlier Maps
One of main reasons why tanks get stuck is bad placement of spawn points. They don't
take trees and boxes into account, so enemy tank can spawn in the middle of a forest, with
no chance of getting out without blowing things up. A simple fix would be to consult with
Search WWH ::




Custom Search