Jump to content
  • Advertisement
Sign in to follow this  
eSam

Pacman Maze!

This topic is 4317 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there any algorithm to generate pacman game mazes? It follows a specific patterns, kinda regular. Any idea?

Share this post


Link to post
Share on other sites
Advertisement
I haven't seen one, and I believe the mazes in the original Pac-Man were hard-coded into the game.

If I were going to approach a maze generation algorithm for Pac-Man, I'd probably do half of a maze and then flip it over, making sure you can still get to one end from the other and that there's a decent amount of circularity.

Share this post


Link to post
Share on other sites
Yup! But out of help. The pacman maze generation is far different in a way it's a pattern based, not one end leads to another thorugh a couple of paths or so. It's more open.

Share this post


Link to post
Share on other sites
It's difficult to summarise this problem, as all of Pacman's mazes were (presumably) manually created. However, you could reduce the problem down to existing ones. I'm not entirely sure how convincing the results might be, but you could, in theory, create the maze automatically.

Pacman, as a game, requires that there is a central box that only the ghosts may enter. Your maze-generation algorithm may not touch this. Also, Pacman himself must start on a clear horizontal path just below this box. Furthermore, we require that each quadrant has its own power-pill and that every walkable square, including those containing the power-pills, are accessible from everywhere else in the maze.

So we need to create the central box, the start point, and the power pills, then let the algorithm 'mazify' the remainder of the map, without creating any disconnected components. Kruskal or Prim's algorithm can do this: we create the default parts of the map, randomly generate more walls to fill in the rest of the map (excluding the ghost-box interior and the power-pill spawn points), then use a spanning-tree generating algorithm to cut holes so that everywhere is accessible.

I leave the details to you, but I'd like to see how your results turn out.

Admiral

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!