PacMan AI
Hey. I know this question raised not once at this forums so I want to tell that I run search and read most of the topics that was opened here. I also searched at Google for the topic.
My question:
I found some topic here and from Google that says that I need to use A* algorithm or even Genetic Algorithm for ghosts AI. So my question is it really necessary? I mean, writing A* algorithm will take the same amount of time like making Pacman from 0 to full, polished and bug fixed version, if not more (for me anyway, I had bad experience with A*). So is it really necessary? Or it can be done with simple if/else statements? I want to tell that this is not a big game or something like this, I'm not going to do a mega ultra version of pacman I'm just doing it as a part of the article "Path to game developer". I know using A* or Genetic algorithms will be nice practice for me, but I don't think is suits here. Any way I want to hear your opinion.
Thanks a lot.
I would love to change the world, but they won’t give me the source code.
Quote: I found some topic here and from Google that says that I need to use A* algorithm
Nah, not really.
Quote: or even Genetic Algorithm for ghosts AI.
Holy bees on toast NO.
Look, there's a variety of ways to make a reasonable PacMan AI. One of the simplest is to just turn randomly at every intersection. Another is to turn in whichever direction the ghost is furthest from Pacman. Both of these are pretty trivial to program, so try them out and see how they work for you. The second one is a good jumping off point for tweaking, e.g. making the ghost willing to wrap around the screen. A* is actually one of the worst possible algorithms because of how it must constantly recompute from scratch, and genetic algorithms are just as bad for this as they are for virtually all other game AI situations.
Oh thanks a lot :)
I would love to change the world, but they won’t give me the source code.
The Pacman AI was divided into 4 types:
Blinky: Chased you pretty straight, tended to get faster as the level progressed.
Pinky: Favored the Counter Clockwise direction, which would help him get around Pacman.
Inky: Behaved randomly, as in, randomly picked a direction.
Clyde: Favored the clockwise direction, though, made it more a point to stay away from Pacman.
It was also divided into several modes:
Chase: as I described above in the four types.
Scatter: Each ghost took to his favorite corner at certain times in the level.
Edible: After a power pellet was eaten, they all just kept going away from Pacman at slow speed.
Return: After eaten, their eyes would return to the ghost hole, but would make a couple of random turns here and there to appear to be lost.
Blinky: Chased you pretty straight, tended to get faster as the level progressed.
Pinky: Favored the Counter Clockwise direction, which would help him get around Pacman.
Inky: Behaved randomly, as in, randomly picked a direction.
Clyde: Favored the clockwise direction, though, made it more a point to stay away from Pacman.
It was also divided into several modes:
Chase: as I described above in the four types.
Scatter: Each ghost took to his favorite corner at certain times in the level.
Edible: After a power pellet was eaten, they all just kept going away from Pacman at slow speed.
Return: After eaten, their eyes would return to the ghost hole, but would make a couple of random turns here and there to appear to be lost.
william bubel
Yeah I agree with the posts here. A* is really not good because the PacMan ghosts usually never moved directly towards you even if they couldn't directly see you. Also constantly recalculating a path would be very slow and overly complicated.
Using Neural Networks and Genetic Algorithms are lousy solutions to the problems as NNs have to be trained (so this solution is overkill), and GAs are just the completely wrong approach to a ghost AI. Really I don't know why people think every AI problem involves NNs or GAs XD.
Now some possible areas to look into include State Machines State-Driven Game Agent Design (One of my favorite tutorials)
And although this is probally overkill you could check out some steering behaviors: Steering Behaviors For Autonomous Characters
Really it just depends how complicated you want your AI to be.
Using Neural Networks and Genetic Algorithms are lousy solutions to the problems as NNs have to be trained (so this solution is overkill), and GAs are just the completely wrong approach to a ghost AI. Really I don't know why people think every AI problem involves NNs or GAs XD.
Now some possible areas to look into include State Machines State-Driven Game Agent Design (One of my favorite tutorials)
And although this is probally overkill you could check out some steering behaviors: Steering Behaviors For Autonomous Characters
Really it just depends how complicated you want your AI to be.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement