Ye olde maze game generator.

Community Forums/Showcase/Ye olde maze game generator.

Ryan Burnside(Posted 2009) [#1]
I sort of miss the old style maze games so I am working on a little generator that should make some interesting procedural levels. Now there are more maze games than Pacman but this is a mock up. I won't release the code until I get it running well. These levels are nice because they don't have dead ends that would stop a player in their tracks. There are some dead ends around the outside if you look but those will loop around when the engine is done. :)




Vorderman(Posted 2009) [#2]
Could be really fun with 4 players at once and about 50 ghosts!


Ryan Burnside(Posted 2009) [#3]
You could make a game like that with this.
Many players memorize winning patterns at Pacman's tables, it would be hard to memorize 65,535 possible table combinations however! So you have 65,535 possible levels of any reasonable size at your disposal with this system.

However the genre is more than just Pacman. Many of the maze type games like Amidar, Beserk, Pepper II, Rally X, Lady Bug and Wizard of Wor had unique playing styles and had little to do with eating dots. So, this is not limited to just Pacman clones (I think there are enough already).


Retimer(Posted 2009) [#4]
Off-topic: what ever happened to that dungeon rpg of yours? I enjoyed playing that when I was away from my dev pc.


Ryan Burnside(Posted 2009) [#5]
I have never made an RPG, I did however make a dungeon generator for the old roguelike games...


_Skully(Posted 2009) [#6]
BTW: If you go through the maze and remove any walls that don't have any more than 1 adjacent wall you get rooms


ImaginaryHuman(Posted 2009) [#7]
And combine the 4-player 50-ghost idea with `bomberman` style bomb-laying gameplay.


Vorderman(Posted 2009) [#8]
Imagine that - 100 player Bomberman over the net....!!!


Ryan Burnside(Posted 2009) [#9]
OK, I have got everything generating OK.


This generates a structure of tiles. Each tile in the array has walls, so you simply use the tiles to dictate character movement. I hvae not fleshed out a game yet but this is just a tool to generate a maze of tiles for your project. I will probably clean up the code a bit later. This is for blitzmax.






SpaceAce(Posted 2009) [#10]
Long, long ago I wrote a generator that creates perfect mazes (exactly one path between any two points in the maze.) I also wrote code to spawn entry and exit points, and rudimentary AI (with built-in error percentages and decision making delays to create a variety of skill levels) to run through the maze. The code is 100% working and very efficient. I never posted it on the forums, but if you run into any stumbling blocks, I can probably help you.

SpaceAce


Chroma(Posted 2009) [#11]
Hey SpaceAce..would you mind posting your code too? I'd like to take a peek at it.


impixi(Posted 2009) [#12]
@Chroma:
In case you haven't already seen it, I posted some maze-generation code in the archives a few years ago: TDungeon. The first example generates a perfect maze.


Ryan Burnside(Posted 2009) [#13]
The main point of these maze type games is to create mazes that do not have dead ends. I have also mode a maze generator and a dungeon generator. I've been sick but play to show how enemy mosters would work. :)


Ryan Burnside(Posted 2009) [#14]
I have now wrapped the entire abstraction into a single type. I've also added some new featuers.

I've put some thought into different types of possible levels.

Now when the maze object is created you have some generation options. You can have a normal maze (with dead ends) you can have a maze with no dead ends and you can also have a maze in which long stretches of wall have been reduced. The latter two options can be mixed and matched for different results. When I took a hard look at my former generations I noticed that something didn't look right when compared to games such as Pacman, the problem was that the stretches of walls were very long. To reduce this the new maze type will hunt out and cut out sections of long wall. It is all very hard to explain without you tinkering a bit with the outcomes.

If you simply want pure mazes like the classic Amazing Maze, then you would generate the mazes with dead end removal set to false and also remove_long_walls set to false.

If you want to generate a level with dead ends removed (like the former results) you set dead_end_removal to true. This creates long alleys that loop back and connect without ever ending in a dead end.

If you want to generate levels with long walls removed but dead ends still intact you may opt to set remove_long_walls to true and set remove_dead_ends to false. This would be more ideal for a Bomberman style game.

The final option (which creates more Pacman) like mazes with a high level of multidirectional travel is to set dead end removal to true and also long wall removal to true.

So there you have it, a simple type that can generate 4 types of mazes each very different with profound effects on how a game will be played.


Here is the code, you might want to hack out the draw method as it is just for show.

Have fun.

Normal maze shown here. (Not good for much)


Maze with Dead ends removed


Maze with long wall segments broken up.


Maze with dead ends AND long walls removed. (more like procedural pacman)