Procedural Dungeon ⏵ Dungeon Generator Base
Dungeon Generator Base
Class Details
Defined in: Public/DungeonGeneratorBase.h
Hierarchy: Object → Actor → Dungeon Generator Base
Exposed in blueprint as: Variable Type
Description
This is the main actor of the plugin. The dungeon generator is responsible to generate dungeons and replicate them over the network.
This base class is abstract. You need to override the CreateDungeon
function to write your own generation algorithm.
Events
Name | Category | Description |
---|---|---|
On Failed to Add Room Event | Dungeon Generator | Called each time no room could have been placed at a door (all room placement tries have been exhausted). |
On Generation Failed Event | Dungeon Generator | Called when all dungeon generation tries are exhausted (IsValidDungeon always return false). No dungeon had been generated. |
On Generation Init Event | Dungeon Generator | Called before trying to generate a new dungeon and each time IsValidDungeon return false. |
On Post Generation Event | Dungeon Generator | Called once after all the dungeon generation (even if failed). |
On Pre Generation Event | Dungeon Generator | Called once before anything else when generating a new dungeon. |
On Room Added Event | Dungeon Generator | Called each time a room is added in the dungeon (but not spawned yet). Those rooms can be destroyed without loading them if the generation try is not valid. |
Properties
Name | Type | Category | Accessors | Description |
---|---|---|---|---|
Random Stream | FRandomStream | Dungeon Generator | Blueprint Read Only | |
Rooms | UDungeonGraph* | Dungeon Generator | Blueprint Read Only | |
Id | FGuid | GUID | Blueprint Read Only | |
Draw Debug Dungeon Bounds | bool | Procedural Generation | Edit Anywhere | Draws the computed dungeon bounding box. |
Rebuild Navmesh | bool | Procedural Generation | Edit Anywhere | If true, the generator will manage the default UE navmesh system to rebuild it at the end of a generation. If false, the generator will do nothing with the navigation system. |
Use Generator Transform | bool | Procedural Generation | Blueprint Read/Write Edit Anywhere | If ticked, the rooms location and rotation will be relative to this actor transform. If unticked, the rooms will be placed relatively to the world's origin. |
Use Json Save | bool | Procedural Generation | Edit Anywhere | If true the dungeon will be saved in a human readable json format. WARNING: This is only available in editor and dev builds and will not change anything in packaged builds. It should be used for debugging purposes only. |
Use World Collision Checks | bool | Procedural Generation | Blueprint Read/Write Edit Anywhere | If ticked, when trying to place a new room during a dungeon generation, a box overlap test will be made to make sure the room will not spawn inside existing meshes in the persistent world. This is a heavy work and should be ticked only when necessary. Does not have impact during gameplay. Only during the generation process. |
Seed | uint32 | Procedural Generation └ Seed | Edit Anywhere | |
Seed Increment | uint32 | Procedural Generation └ Seed | Edit Anywhere | The increment number for each subsequent dungeon generation when SeedType is AutoIncrement. |
Seed Type | ESeedType | Procedural Generation └ Seed | Blueprint Read/Write Edit Anywhere | How to handle the seed at each generation call. Random: Generate and use a random seed. Auto Increment: Use Seed for first generation, and increment it by SeedIncrement in each subsequent generation. Fixed: Use only Seed for each generation. |
Nodes
Name | Category | Description |
---|---|---|
Generate | Dungeon Generator | Update the seed and call the generation on all clients Do nothing when called on clients |
Get Compatible Room Data | Dungeon Generator | Returns an array of room data with at least one compatible door with the door data provided. |
Get Progress | Dungeon Generator | Returns the current generation progress. |
Get Random Room Data | Dungeon Generator | Return a random RoomData from the array provided |
Get Random Room Data Weighted | Dungeon Generator | Return a random RoomData from the weighted map provided. For example: you have RoomA with weight 1 and RoomB with weight 2, then RoomA has proba of 1/3 and RoomB 2/3 to be returned. |
Get Seed | Dungeon Generator | |
Load All Dungeons | Dungeon Generator | |
Load Dungeon | Dungeon Generator | Load a dungeon from a previously saved data |
Save All Dungeons | Dungeon Generator | |
Save Dungeon | Dungeon Generator | Create a saved data from the current dungeon state |
Set Seed | Dungeon Generator | |
Unload | Dungeon Generator | Unload the current dungeon Do nothing when called on clients |