# 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.

## Recommended Posts

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

##### Share on other sites
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 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 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.

1. 1
Rutin
69
2. 2
3. 3
4. 4
5. 5

• 21
• 10
• 33
• 20
• 9
• ### Forum Statistics

• Total Topics
633430
• Total Posts
3011831
• ### Who's Online (See full list)

There are no registered users currently online

×