I was recently asked to help design the Artificial Intelligence (AI) algorithm for an iOS app based on a boardgame with which I am familiar.
[I admit to a pet peeve regarding the use of the term "AI" to represent algorithm-driven characters and players in computer games. I consider Artificial Intelligence to be much more sophisticated than simple state-driven rule sets. Few if any computer and video games are truly artificially intelligent. But that's okay. I accept the terminology for what it is - adulteration of the English language. There. I've said it. Now I can let it go.]
Composing an algorithm for a computer-based opponent poses a special challenge. Clearly I should base the rule set on my idea of a reasonably good strategy for playing the game, so an early outline is more or less a straightforward prioritization of competing considerations. But trying to translate principles of strategy and tactics for a given game into instructions that a programmer can interpret and code exposes the fact that playing games is truly a very human activity. Intuition plays an integral part of decision-making. Even the seemingly straightforward clause, "move toward the closest objective," leaves ambiguity at the computer level as to the definitions of "closest" and "toward" and the optimal movement path. Having to write down explicitly the algorithm really forces paring of one's thinking to the fundamentals of choices, priorities, and decision-making.
In Trains, Planes, and Automobiles, for example, if I'm in Vicksburg and I want to go to San Francisco, it's pretty obvious (to a human) that I want to get to a train to get to an airport to fly to San Francisco. And if that's the only case I have to handle, I can pretty much tell a computer how to figure out which railroad track to go to, which train ticket to play, which airport to stop on, and what kind of airline ticket will get me to San Francisco from there. But how do I generalize that thought process so that the computer can follow the same algorithm and take the "right" path for all combinations of start and end locations? My algorithm should also take into account cards available in the hand. If I have a ton of railroad tickets and no airline tickets, should I skip flying altogether and take a train all the way across the country? Maybe. How do I instruct the computer to make that decision?
I'm loving this problem, because it really makes me think about how decisions are made. Even more, it makes me appreciate just how subtly intuitive the human brain is and can often make the "right" decision immediately upon observation based on no more than other experience in similar situations.
Perhaps a later challenge would be to design a boardgame whose winning methods are counter-intuitive. That would be tough nut. (It might also be a game that people would hate.)