rex_dungeon_gen
Introduction
Generate random dungeon map which composed of walls, rooms, and corridors asynchronously. Reference: rot.js
Generate random dungeon map which composed of walls, rooms, and corridors asynchronously. Reference: rot.js
Generate map
Call one of these actions under "Map - Generate" category to create a new random map asynchronously in a webworker.
Call one of these actions under "Map - Generate" category to create a new random map asynchronously in a webworker.
- Action:Digger
- Action:Uniform
- Action:Rogue
Types of tile
There are 2 possible raw symbols of each tile -
There are 2 possible raw symbols of each tile -
- 0 : empty space
- 1 : wall
Empty space (0)
Empty space could be subdivided into "room space", "corridor", or "door".
Empty space could be subdivided into "room space", "corridor", or "door".
- Room space : current empty space tile is in a room.
- Corridor : current empty space tile is not in a room, and all neighbors are not room spaces.
- Door : current empty space tile is not in a room, and one or more neighbors are room spaces. i.e. a corridor which connects to a room.
Wall (1)
Wall could be subdivided into "border wall", or "filled wall"
Wall could be subdivided into "border wall", or "filled wall"
- Border wall : current wall is beside any empty space in 8 directions.
- Filled wall : current wall is not a border wall. This kind of tile could be ignored while creating.
Type of corridor
A corridor could be subdivided into
A corridor could be subdivided into
- Dead end : it has 1 corridor neighbor only
- L-junction : it has 2 corridor neighbors, and they are arranged in a L-shape
- I-junction : it has 2 corridor neighbors, and they are arranged in a line
- T-junction : it has 3 corridor neighbors
- X-junction : it has 4 corridor neighbors
Retrieve the map
Gets raw symbol value of a specific tile back by "Expression:ValueAt" in logic ( X, Y)
Moreover, uses "Condition:Corridor type" to classify a specific corridor in logic ( X, Y).
Gets raw symbol value of a specific tile back by "Expression:ValueAt" in logic ( X, Y)
- 0 = empty space
- 1 = wall
- (-1) = invalid ( out of map )
- Filled wall
- Border wall
- Room space
- Corridor
- Door
- Invalid ( out of map )
Moreover, uses "Condition:Corridor type" to classify a specific corridor in logic ( X, Y).
Retrieve rooms
Designer could retrieve rooms in a for each condition, or by room index.
Designer could retrieve rooms in a for each condition, or by room index.
Retrieve rooms in a for each condition
Boundaries of each room could be retrieved by "Condition:For each room".
Get boundaries of the retrieved room in these expressions -
Boundaries of each room could be retrieved by "Condition:For each room".
Get boundaries of the retrieved room in these expressions -
- Expression:CurRoomLeft
- Expression:CurRoomRight
- Expression:CurRoomTop
- Expression:CurRoomBottom
- Expression:CurRoomCenterX
- Expression:CurRoomCenterY
- Expression:CurRoomWidth
- Expression:CurRoomHeight
Retrieve room by index
The amount of rooms could be got by "Expression:RoomsCount".
Get index of room in a specific logic position by "Expression:LXY2RoomIndex( x, y )".
Get boundaries of a specific room by index in these expressions -
The amount of rooms could be got by "Expression:RoomsCount".
Get index of room in a specific logic position by "Expression:LXY2RoomIndex( x, y )".
Get boundaries of a specific room by index in these expressions -
- Expression:RoomLeft ( index )
- Expression:RoomRight ( index )
- Expression:RoomTop ( index )
- Expression:RoomBottom (index )
- Expression:RoomCenterX ( index )
- Expression:RoomCenterY ( index )
- Expression:RoomWidth ( index )
- Expression:RoomHeight ( index )
Cancel
Call "Action:Cancel" to cancel maze generating.
Call "Action:Cancel" to cancel maze generating.
Release
Call "Action:Release" to release current maze in memory.
Call "Action:Release" to release current maze in memory.
Official save/load
This plugin supports official save/load.
This plugin supports official save/load.
And more...
Uses rex_eventbalancer plugin + rex_loopiterator plugin to create tiles in multi-ticks, and rex_board_squareTx plugin to get the position of each tile. rex_board_squareTx plugin could support orthogonal or isometric map.
Uses rex_eventbalancer plugin + rex_loopiterator plugin to create tiles in multi-ticks, and rex_board_squareTx plugin to get the position of each tile. rex_board_squareTx plugin could support orthogonal or isometric map.