Pacman Maze!

Started by
3 comments, last by TheAdmiral 17 years, 2 months ago
Is there any algorithm to generate pacman game mazes? It follows a specific patterns, kinda regular. Any idea?
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.
Have you read this article ?
Q: How many programmers does it take to write a nice piece of software?A: MORE.
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.
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
Ring3 Circus - Diary of a programmer, journal of a hacker.

This topic is closed to new replies.

Advertisement