

The ghost pen and the edge between rows 7 and 8 at column 1 are present in every map, since the starting location of Pac-Man and the ghost pen location are constant.Ĭells are directly transformed into a 3x3 group of tiles. The pieces are created one cell at a time using some algorithm to limit the type of pieces at certain locations (they are numbered to show the order of creation). Shown in the above diagram titled "Simple Model" is the 5x9 grid of tetris pieces. So, this algorithm first creates the cells and transforms them into tiles Simple Model This grid is then mirrored across the left vertical axis to create a symmetric map, then scaled by 3 to form an original-size 28x31 map.įor clarity, I call the squares in the initial 5x9 grid, cells, and the squares in the final 28x31 grid, tiles. The edges of the resulting tetris pieces correspond to walkable paths in the maze. Gravity pulls the pieces in the left direction rather than down. We start by stacking tetris pieces on a 5x9 grid. Any non-rectangular wall pieces must only be 2 tiles thick.Only I, L, T, or + wall shapes are allowed, including the occasional rectangular wall.intersections are separated by atleast 2 tiles). The mazes are built carefully to closely match design patterns deduced from the original maps found in Pac-Man and Ms. It will slowly be refined (your feedback appreciated) until it is all stated as clearly as possible. This page is an effort to begin communicating how the algorithm works. Generating random Pac-Man mazes is a deceptively difficult problem that I spent some months working on.
