Chapter 13. AI Programming and World Domination
In the previous chapter, we left off with a working 2-player Tic Tac Toe game. We could easily hang up our hats and call it a day. The sad truth is that for many, playing video games is a solitary activity, and we, as game programmers, need to devise computer-controlled "friends" to challenge our human players. As game budgets and networking capabilities improve, games are increasingly returning to their social, multiplayer roots. Despite this, there will always be a call for "smart" computer opponents in case—God forbid—the Internet goes down.
Artificial Intelligence is so-called because it's an attempt at making a computer seem like it's thinking, when in reality, it's just robotically following instructions like it always has. Through careful design, we can create the illusion that the computer is strategizing, and even making mistakes, just like a human being would. By the end of this chapter, you will have written your own AI routine...