![]() |
Crossfire Server, Trunk
1.75.0
|
Crossfire – cooperative multi-player graphical RPG and adventure game. More...
Include dependency graph for room_gen_crawl.cpp:Go to the source code of this file.
Macros | |
| #define | MAP_CRAWL_ALL 15 |
| #define | MAP_CRAWL_EAST 2 |
| #define | MAP_CRAWL_NONE 0 |
| #define | MAP_CRAWL_NORTH 4 |
| #define | MAP_CRAWL_SOUTH 8 |
| #define | MAP_CRAWL_WEST 1 |
Functions | |
| char ** | map_gen_crawl (int xsize, int ysize, int iter, int hallway) |
| Generator of the crawl maze. More... | |
| static void | print_debug_paths (uint8_t *paths, int x_eff, int y_eff) |
| Function for helping to ensure parity between the compartmentalized and final versions of the map. More... | |
Crossfire – cooperative multi-player graphical RPG and adventure game.
Copyright (c) 2013-2026 The Crossfire Development Team Copyright (c) 1999-2013 Mark Wedel and the Crossfire Development Team Copyright (c) 1992 Frank Tore Johansen
Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. For details, please see COPYING and LICENSE.
The authors can be reached via e-mail at crossfire@metalforge.org.
Crawl room generator
Maze sprawls out and have many dead-ends. Uses an algorithm that differs from the classic maze generator. Loosely inspired by the dungeon layouts of Dragon Warrior Monsters 1.
TODO: Show what crawl mazes look like
Definition in file room_gen_crawl.cpp.
| #define MAP_CRAWL_ALL 15 |
Definition at line 39 of file room_gen_crawl.cpp.
| #define MAP_CRAWL_EAST 2 |
Definition at line 35 of file room_gen_crawl.cpp.
| #define MAP_CRAWL_NONE 0 |
Definition at line 33 of file room_gen_crawl.cpp.
| #define MAP_CRAWL_NORTH 4 |
Definition at line 36 of file room_gen_crawl.cpp.
| #define MAP_CRAWL_SOUTH 8 |
Definition at line 37 of file room_gen_crawl.cpp.
| #define MAP_CRAWL_WEST 1 |
Definition at line 34 of file room_gen_crawl.cpp.
| char** map_gen_crawl | ( | int | xsize, |
| int | ysize, | ||
| int | iter, | ||
| int | hallway | ||
| ) |
Generator of the crawl maze.
| xsize | |
| ysize | layout size. Unused fractions from wide hallways will be evenly distributed at the edges. For size 1 hallways, odd numbers are best for use of space. For size 2 hallways, one more than a multiple of 3 works best (43, 46, 49, etc) For size 3 hallways, one more than a multiple of 4 works best (41, 45, 49, etc) |
| iter | Recursion flag. If fewer than 1/5 of the map is filled, we try again once. If it fails again, just return the second try. Set to nonzero on the retry to denote it as such. |
| hallway | Width of the hallway path inside the maze. Should be 1-3 under most circumstances. Larger values require large layouts to compensate. |
Definition at line 139 of file room_gen_crawl.cpp.
References MAP_CRAWL_ALL, MAP_CRAWL_EAST, MAP_CRAWL_NONE, MAP_CRAWL_NORTH, MAP_CRAWL_SOUTH, MAP_CRAWL_WEST, paths, and RANDOM.
Referenced by layoutgen().
Here is the caller graph for this function:
|
static |
Function for helping to ensure parity between the compartmentalized and final versions of the map.
Prints the layout of the internal paths determination.
| paths | The array of path data to display. |
| x_eff | The effective number of hallways we could have in the x direction. |
| y_eff | The effective number of hallways we could have in the y direction. |
Definition at line 55 of file room_gen_crawl.cpp.
References MAP_CRAWL_EAST, MAP_CRAWL_NONE, MAP_CRAWL_NORTH, MAP_CRAWL_SOUTH, MAP_CRAWL_WEST, and paths.