Ribbon Maze

by H8UL

The maze itself is destined to be automated.

Overhaul
4 years ago
0.16 - 0.17
54

i Idea for a new maze algorithm / map generation for the maze

5 years ago

I'm playing around with making a completely new maze algorithm and want to summarize my plans and ideas. Hopefully this can be merged into RibbonMaze or you have some useful ideas yourself.

First some ideas for the map generation. Those would apply to the existing maze too:

1) The terrain/void divide looks bad. What the maze needs are natural looking walls that can not be destroyed. One thing that comes are the cliffs. If cliff explosives are disabled then they would make a nice looking natural wall for the maze. Cliffs could go either up or down. The void could possibly be filled deep water or lava (someone have a texture for that already?) I think that would look much better.

2) The straight edges on the maze also look bad and aren't ideal for laying train tracks. Corners could be rounded. Dead ends could optionally have a bulb giving some extra space around the ore field.

Secondly I think a totally different maze algorithm is needed. I really don't like the limited size of the maze and that one starts at one end. The existing algorithm doesn't lend itself to growing in all directions though.

So here is my idea for a new algorithm:

A) The map is divided into hexagons. This gives nicer paths with 6 neighbors per hexagon instead of 4 per square the maze has now. The size of the hexagon would be about 32 to give results similar to now. There could be a config setting to choose 4, 6 or 8 neighbors for the maze, doesn't have to absolutely be hexagons.

B) Hexagons are then grouped into larger hexagons or rombus formed blocks. Or any other form that tiles the area. I think hexagons would give nicer results but rombus would be easier to convert between map and maze coordinates.

The idea now is that each block can be generated on it's own and would only depend on the map seed and it's position and not on the time when it is generated. Since each block is of limited size more expensive maze algorithms can be used. Only requirement is that the blocks later fit together. Therefore:

C) Blocks must overlap by one hexagon. This is where blocks are glued together. Each overlap between 2 blocks is filled with randomly placed walls the same way for both blocks (using the coordinates of both blocks as random seed). The tile where 3 or more blocks overlap is always a wall. Surround the block with an imaginary wall for the purpose of generating the inside. Just so the algorithm doesn't try to leave the block or add walls to the overlap. Create a table of all neighbors of walls just added.

D) If open areas are desired add them randomly in the block as temporary walls (make them one tile smaller than the space you want). At the end the temporary walls are turned into free space.

E) For extra effect add some random walls in the block (maybe clustered around the free space?) and add their neighbors to the table. This will create loops in the maze.

F) Pick a random entry from the table. If the cell is free and has at most one wall neighboring it then it also becomes a wall. If so add it's neighbors to the table.

G) repeat F until the table is empty.

5 years ago

I already tried cliffs. I found they don't look better at all. I'm sure you've seen cliffs that spoil the illusion in early 0.16 map generation. That. And cliffs make the maze hard to see in the minimap. I like that it is easy to trace a path in the minimap. I played around with a lot of options before picking a texture from the More Floors mod, with a blocky design that tiles well for blueprints (a chunk aligned maze is GOOD for trains!) and appeals to a players of a certain other popular mining and crafting game. I welcome submissions of textures but I've had far more positive than negative feedback on the aesthetics, so it's not something I intend to change myself.

A maze growing in all directions seems more cool. But it's quesionable for gameplay. My mod starts you at a clear beginning and gives you progression. Eller's algorithm is not a technical limitation; I picked the algorithm to match game design. Even with Eller's I could easily have had the maze grow in two directions, but it would be pointless. It would merely divide the player's attention, halving the sense of progression.

There are already mods that do lots of different maze generations. Ribbon Maze is a scenario-like challenge in the spirit of the ribbon world that completely changes the way you build your factory and gives new end game goals. It's not meant to be a generic and endlessly configurable "maze terrain" mod, or to play like vanilla but with a maze aesthetic.

I would, of course, be delighted if my mod inspires other maze mods! I hope those mods emphasize gameplay over "look the maze is more cool" though!

New response