Maze - a plug-in to draw mazes for the GIMP.
Fills the active selection or layer with a maze. Every square in the maze is accessable from every other, if you can find the right path. There are no loops (well, see Bugs). Features include a choice of maze generation algorithms (Prim's Algorithm or depth-first), tileable mazes, and non-rectangular shaped mazes.
Changes the width/height of the wall and passage blocks (currently there is no support for making the two different sizes). The "pieces" selectors are provided as semi-intelligent aides to choosing a proper size, taking into account the tileable mode and image size. They will only chose sizes that divide more or less evenly into the image size, an even or odd number of times, depending on wether the maze is to be tileable or not. However, in the end, it's the width and height settings which are used to produce the maze, so results may not exactly match the "pieces" setting if you did something weird to it.
The maze plug-in can generate tileable mazes; that is, make passages going off the right (or bottom) edge wrap around and be continued on the left (or top). This is useful for wallpapering and the like.
This places some constraints on the passage size. There must be an even number of divisions, and the passage size should divide evenly into the image size. Note that non-tileable mazes have an odd number of divisions. Maze silently enforces this rule.
The random seed used to generate the maze. Use the same seed with the same maze size and wall width, and you'll end up with the same maze. Pressing the "Time" button will use the current time as the random seed.
The plug-in knows two different ways to make mazes; the depth-first method and Prim's algorithm. Depth-first is much faster than Prim's algorithm, and generally produces long, twisty passages, while Prim's algorithm is typically characterized by many very short passages with frequent branches. A description of the different techniques can be found in the Maze FAQ.
If there is an active selection, maze will keep non-selected portions of the layer as wall and create maze passages within the selection. If the selection is disjoint, the plug-in will draw as many mazes as needed to fill all portions of the selection.
get_colors()in handy.c. If any of you indexed-image fans want to fix that function, I'd appreciate the help.
|Name||PDB Type||C Type||Notes|
|width||INT32||guint||Size of cells, walls, and passages, in pixels.|
|algorithm||INT8||MazeAlgoType||0=Depth First, 1=Prim's Algorithm|
|multiple||INT32||gint||Used by the RNG, 57 works|
mazegen()is adapted from maz.c as found in the Maze FAQ.