Imagine a computer playing pacman. It knows where the ghosts are and (if so programmed) it can likely calculate a perfect plan of escape every time. What if, however, we want the computer to emulate a real person? Most people probably won't know for sure which direction to go to retain victory every time; they will occasionally make mistakes leading Pacman to his ghostly doom. The human mind doesn't always work that quickly or that accurately.
Of course, we can't just tell the computer to seek out a ghost so it will lose. For the best results, the game has to get the computer to look like it was actually trying, but just screwed up. Therefore, to combat the "perfect computer", we must provide it some way to be realistically overpowered. "Intentional mistakes" must be introduced to the A.I.
A programmer can achieve this, albeit somewhat roughly, using a call to random(). One can also do something more general to the game's design, such as removing certain abilities from the computer's character so the player has the overall upper hand (i.e. giving the computer slower movement, letting the player shoot but not the computer, etc.). In addition, a third method might consist of "forgetting" to add parts to the A.I. - leave out checking for floor spikes in a platform enemy, for example.
Disappointingly, I haven't seen very many examples of realistically flawed A.I. programming, if any at all.
(For those interested in more concepts of A.I., view the wikipedia article here.)
Here's a basic example of what I'm talking about. Imagine I have a platform game enemy, who follows the player around and can jump over gaps. But I want this enemy to be flawed, so I introduce a call to random() just before he jumps:
if (place_meeting(x,y+1,objBlockParent)) //Make sure we're on the ground
{
if (!place_meeting(x+hspeed,y+1,objBlockParent)) //If we're going to fall next step
{
if (objPlayer.y<=y) //only if player is above or on same level as enemy
{
//Jump on random chance.
if (floor(random(2))) vspeed=-jumpspeed;
}
}
}So I've got a 50% chance of jumping, and 50% chance of falling.
Unfortunately, that's still pretty unrealistic; human's aren't so flawed that they would walk off a cliff for no reason. I need something different.
This time I'm going to tell the enemy to always jump when he reaches a cliff, but also give him a random chance of making it to the other side by sometimes reducing the jump height.
if (place_meeting(x,y+1,objBlockParent)) //Make sure enemy is on the ground
{
if (!place_meeting(x+hspeed,y+1,objBlockParent)) //If we're going to fall next step
{
if (objPlayer.y<=y) //only if player is above or on same level as enemy
{
//Jump
vspeed=-jumpspeed;
//Random chance to have lesser jump strength
if (floor(random(2))) vsp+=floor(random(floor(jumpspeed/3))));
}
}
}Now the enemy may or may not make it to the other side. He'll always jump, but sometimes not far enough.
Another area where this kind of A.I. imperfection might be necessary is inside fighting and strategy games where you can challenge the computer. The computer could be programmed to scan all possible moves and weigh every variable to choose the perfect action every time. Unless, of course, one were to introduce a way for the computer to make an "honest" mistake. Again, not an obvious blunder like moving, in a game of chess, to leave the King wide open (maybe unless the game were on an "easy mode" setting), but an imperfect choice of which the player can take advantage should he or she be skilled enough to do so.
On the contrary to all this, some may argue that even if a computer is programmed "perfectly", the A.I. is only as smart as its designers. Were this assumed true, then as designers are "flawed" humans, it would follow that this is all a non-issue because then a computer could not ever be completely perfect in the first place.
Speaking of chess above, this subject comes into play with chess during man vs. computer competitions. The computers are programmed by top-rate computer scientists, but have still been beaten by "mere humans". You can find articles about science's efforts to determine, using chess, whether man is ultimately smarter than computers, by following these two links:
http://query.nytimes...751C0A960958260
http://www.wired.com...s/2002/10/55839
I feel I've been pretty thorough on this subject. I hope I haven't introduced too much information.
Anyways, the platform enemy example I gave above isn't necessarily completely realistic; however it illustrates the concept of imperfect A.I. fairly well. I'd like to know who has written/thought up examples of this and who knows of other examples. What ways do you introduce flaws to make the computer mind more like that of an average human's? Or is strategy from the human mind already better than A.I. could ever be?












