PDA

View Full Version : Very interesting AI video



paul_nicholls
04-08-2010, 10:35 PM
http://tv.devexpress.com/#PacManCode.movie

cheers,
Paul

WILL
04-08-2010, 11:09 PM
Great find. :) I like that he makes you change your perspective to think about the problem.

paul_nicholls
05-08-2010, 09:32 AM
Glad you liked it, and yeah, it was very informative to look at a new perspective :)

cheers,
Paul

Traveler
05-08-2010, 09:35 AM
Very interesting! I once made a pacman clone myself and did exactly what he said. That is, I made a pacman class, ghost class etc. I even added a path finding algorithm to make the ghosts chase pacman. It did the job well and I never even gave it a second thought.

Not only does this video show that there are multiple ways to solve a problem, it also shows that often there's an even better solution than the one you already have.

pstudio
05-08-2010, 11:47 AM
Very interesting! I once made a pacman clone myself and did exactly what he said. That is, I made a pacman class, ghost class etc. I even added a path finding algorithm to make the ghosts chase pacman. It did the job well and I never even gave it a second thought.

Not only does this video show that there are multiple ways to solve a problem, it also shows that often there's an even better solution than the one you already have.


I'll agree that this is an interesting solution and there are often multiple ways to solve a problem but in this particular case there's a small issue with the solution as far as I can see.

Imagine a setup like this:
# #
##########|###
-G -PG
########## ###
# #

#: Wall
G: Ghost
P: Pacman
- or |: Trail

The first ghost and Pacman are moving left while the second ghost is moving downwards. The first ghost has caught pacmans sense and is chasing him. As we can see Pacman is in trouble. However the second ghost has just reached a crossroad section and has to decide where to go next. There's no trail from Pacman to follow so he'll just choose a random direction and with a bit of luck Pacman msy survive this situation even though he should clarly be dead.

As far as I can see, this method is good for making ghosts chasing Pacman where Pacman has already been but if he's coming right towards a ghost, the ghost will not discover it unless the AI is improved on.

jdarling
05-08-2010, 01:14 PM
First, you have to realize that what Julian was talking about was only a small part of the AI of the ghosts in PacMan. In fact, it was the "chase" section of code. Each ghost also had an "Idle" or "Search" section of code that was unique to only he/she.

A pretty good overview of how the ghosts "think" is posted at:
http://www.webpacman.com/ghosts.html

For information overload on the topic, check out:
http://home.comcast.net/~jpittman2/pacman/pacmandossier.html

The scent by the way is VERY limited and "evaporates" quickly, thus even in the case of the 90 deg corners it is virtually imposable to get a scent trail confusion. Of course, there are ways to do it, and these are "break zones" in the game that many advanced players will make use of simply to get a break (if you go to them under the right circumstances the ghosts will NEVER come find you).

- Jeremy

farcodev
07-08-2010, 05:43 PM
interesting method

phibermon
10-08-2010, 12:17 AM
The idea is still in development today. Modern path finding system use flow field optimizations, not just a decrementing integer within a cell, but a field (sometimes many fields for different 'goals') of flow, with vectors of varying lengths indicating direction and bias. Entities seeking goals within this spatial region impart their velocity upon the field. Tied in with the heuristics of a* and it can greatly optimize long, frequently used paths.