Artificial brain learns to play 20 questions

Posted by ljmacphee on July 27, 2007 under artificial intelligence in the news, game ai | Be the First to Comment

. . . He went on to explain, “It was all because of the cool toy that my 17-year-old son took along with him.”

He then showed me this round-shaped blue gizmo (it also comes in a variety of other colours) the size of a tennis ball that looks like a yo-yo and explained to me how it functions.

Called the Radica 20Q, the hand-held, battery-operated toy is based on the old classic game of 20 Questions. All you have to do is think of an object like an animal, vegetable, mineral, and answer a series of 20 questions. You answer the questions by pressing one of four buttons that read “yes,” “no,” “maybe” and “unknown.” The game, which contains an advanced electronic brain, works in mysterious ways, using logic and reasoning to get the right answer. It might come up with questions like, “Is it bigger than a breadbox? Is it used mostly indoors? Is it found in warm climates?”

The odd time that it doesn’t come up with the right answer, it will ask you to indulge it and allow it five more questions before admitting defeat. My neighbour revealed, “We played with it throughout the whole trip and (no pun intended) it didn’t trip up even once. It correctly identified everything including the kitchen sink, wedding cake, criminal lawyer, microwave oven, ostrich, broccoli, air conditioner and hair conditioner. Grandma thought she had it stumped with kettle, but it came up with that answer also.” . . .

More information:
Write Where I Belong - Toy helps pass the time during trip
20Q ( has the toy for sale and an online version you can try )

Simple Predator Prey Chase Algorithms

Posted by ljmacphee on July 4, 2007 under game ai, topics in artificial intelligence | Be the First to Comment

Whether you are writing a game with artificial intelligence or a life form to evolve you have to decide how and when predators catch their prey. Should the predator try to catch the prey? If so what’s the best way? And the predator must watch out for obstacles during the chase, we don’t want any Wiley Coyote type accidents with our predators.

About the simplest method the predator can use to meet up with the prey is to see if the prey’s x & y positions are above or below the predator’s.
Prey ( 3, 6 )
Predator ( 5, 1 )

if ( prey_x > predator_x ) { x++; } else { x–; }
if ( prey_y > predator_y ) { y++; } else { y–; }

So the first pass through the predator moves from ( 5, 1 ) to ( 4, 2 ).

A bit more natural appearing predator chase would be to use line of sight as the path to move towards the prey. Bresenham’s Line Algorithm is usually used for this. While this is not more effective than the previous method it is more natural appearing. It is also more steps to compute.

prey current position ( xp, yp )
predator current position ( xP, yP )

x = x position to move to
y = y position to move to
dx = xp - xP
dy = yp - yP
Adx = AbsoluteValue ( dx )
Ady = AbsoluteValue (dy )

if ( xp > xP ) stepX = 1 else stepX = -1
if ( yp > yP ) stepY = 1 else stepY = -1

if ( Ady > Adx ){ //the y distance from prey is larger than the x distance

fraction = 2*dx - dy;

if (( yP != yp ) && ( fraction > 0 )){
x += stepX
}

y += stepY

}else{

fraction = 2*dy - dx;

if (( xP != xp ) && ( fraction > 0 )){
y += stepY
}

x += stepX
}

Sometimes instead of having the predator chase the prey it is more effective to have the predator intercept the path of the prey. To do this the velocity as well as the position of the prey must be taken into account.

//figure out when we can reach the prey
dvx = vxp - vxP //difference in x direction velocity
dvy = vyp - vxP //difference in y direction velocity

dx = xp - xP //difference in x positions
dy = yp - yP //difference in y positions

dtx = dx/dvx //time away from x intercept position
dty = dy/dvy //time away from y intercept position

//calculate where prey will be at that time
x = xp + vxp*dxt
y = yp + vyp*dxy

//use above Bresenham’s line algorithm to aim for that location ( x, y )

More information:
Line Drawing explained
Bresenham’s line algorithm

Games are merging fantasy with reality

Posted by ljmacphee on July 2, 2007 under artificial intelligence in the news, game ai | Be the First to Comment

Happy News has an interesting article covering several games that are being merged or augmented with reality.

”Within five years people will be able to easily experience Augmented Reality applications on their mobile phones, in their homes, schools, hospitals, workplace and cars,” he said. ”One of the most exciting things is that the current generation of mobile phones have the processing power, display resolution and camera quality necessary to provide compelling AR experiences.”

Billy Pidgeon, a games analyst at the research company IDC, says the field shows promise, especially if its future is staked to the growing computing power of cell phones and other handheld devices.

More information:
New Games Merge Fantasy with Real World
Arcade Reality: Augmented Reality Gaming for Your Cameraphone

Testing the limits of AI in Games

Posted by ljmacphee on June 25, 2007 under artificial intelligence in the news, game ai | Be the First to Comment

Much of cutting edge artificial intelligence is being done in games as it has been for several decades. The newer massively multiplayer online games are showing the glaring flaws in traditional game characters. The main one being the ability to carry on intelligent conversation.

But those bright people writing software that better mimics human intelligence are running smack into an interesting new trend: online virtual worlds like Second Life, and “massively multiplayer online games” such as World of Warcraft, in which characters are inherently pretty intelligent because they’re being controlled by other humans. Players in those games design their own characters and then enter the game realm to interact with one another. Their strategies and dialogue seem authentic — because they are.

“In some ways, all of these massively multiplayer games have shone a light on the deficiencies of artificially intelligent characters in games to this point,” says Hank Howie, chief executive of Blue Fang. Howie’s company makes Zoo Tycoon, distributed by Microsoft, in which players build and operate a virtual zoo. Now the company’s focus is on using artificial intelligence to create more believable animals for future products.

Game designers test the limits of artificial intelligence - Boston Globe

Uncanny AI

Posted by ljmacphee on June 20, 2007 under artificial intelligence in the news, game ai | Be the First to Comment

Normally, the Uncanny Valley theory is used to critique graphical realism in games, but it also applies to AI. In this latest exclusive Gamasutra feature, designer David Hayward examines AI’s Uncanny Valley, citing games such as Valve’s Half-Life 2 and Vivendi’s supernatural shooter F.E.A.R.

More information:
Gamasutra - Uncanny AI: Artificial Intelligence in the Uncanny Valley