Conclusion


With the completion of this chapter, you should have a solid understanding of how to begin developing a turn-based game. Other turn -based games are similar, with the additions coming in the guts of the minimax function.

In Tic Tac Toe , we had move values of infinity, negative infinity, and 0. In more complicated games, a whole range of values is possible. This adds to the complexity, but the general idea is always the same: Iterate through the game tree looking for the best possible move. In more advanced games, you don't have enough time to iterate through the entire tree, so you have to look as far ahead as you can and pick a move based on what you've seen. But again, the general idea is the same.

Other games require totally different AI, though. If this had been a real-time strategy game, for example, we wouldn't have used recursion at all. Each type of game requires its own kind of AI. As you might expect, whole books are written on the subject of game AI. I have included some links in Appendix D to point you toward more information about game AI in general.




Macromedia Flash MX 2004 Game Programming
Macromedia Flash MX 2004 Game Programming (Premier Press Game Development)
ISBN: 1592000363
EAN: 2147483647
Year: 2004
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net