![]() Some cell edges are erased to create some variation in how walls connect with the boundary of the map (shown in green). The highlighted cells show the type of tunnel candidates by color. But the above diagram titled "Border Cells and Tunnels" has arrows to indicate the tunnel candidates. I won't explain too much about this right now. Care is taken to prevent discontinuities in the edges as a result of the shifting of cells from the size change. walls that have non-uniform thickness).Īrrows occupy cells which have been chosen for size adjustment. Shown in the above diagrams titled "Height Adjustments" and "Width Adjustments", the highlighted cells are the candidate cells whose size can be changed without creating ugly walls (i.e. So, we increase the height of one cell for every column, and decrease the width of one cell for every row, allowing the generated map to fit in the exact dimensions of the original game. Unfortunately, this creates a resulting map that is too short by 1 tile and too wide by 1 tile. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |