### Build plugin with RunUAT.bat for Android Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Packaging Command to compile the plugin for a target platform (Android in this example). Replace the UE installation path and plugin/output paths as needed. Use RunUAT.sh when compiling from Mac or Linux. ```cmd > cd "C:\Epic Games\UE_5.2\Engine\Build\BatchFiles" > RunUAT.bat BuildPlugin -Plugin="D:\ProceduralDungeon\ProceduralDungeon.uplugin" -Package="D:\Output\ProceduralDungeon" -TargetPlatforms="Android" ``` -------------------------------- ### Start New Dungeon Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonGeneratorBase Clear current graph and call GenerationInit event. ```APIDOC ## Start New Dungeon ### Description Clear current graph and call GenerationInit event. ### Method StartNewDungeon ### Category GenerationAlgorithm ### Parameters None explicitly documented. ### Returns None explicitly documented. ``` -------------------------------- ### ChooseDoor_Implementation (C++) Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Generating-Dungeon/Choose-Door C++ implementation example for the ChooseDoor function. It demonstrates how to override the ChooseDoor_Implementation method to return a door or wall based on room validity. ```APIDOC ## ChooseDoor_Implementation ### Description Overrides the ChooseDoor function to return a door actor class to spawn between two rooms. The function receives the current and next room data, the door type, and a boolean reference to control door orientation. ### Method Function Override ### Signature `virtual TSubclassOf ChooseDoor_Implementation(const URoomData* CurrentRoom, const URoomData* NextRoom, const UDoorType* DoorType, bool& Flipped) override;` ### Parameters - **CurrentRoom** (const URoomData*) - Input - The room data for the current room. Can be null if no room is connected. - **NextRoom** (const URoomData*) - Input - The room data for the next room. Can be null if no room is connected. - **DoorType** (const UDoorType*) - Input - The door type to use, useful when multiple door types are present. - **Flipped** (bool&) - Output - Controls which room the door faces. If false (default), the door forward faces the Current Room. If true, the door forward faces the Next Room. ### Return Value - **TSubclassOf** - The door actor class to spawn. Return `none` if no door should be placed. ### Example ```cpp TSubclassOf AMyDungeonGenerator::ChooseDoor_Implementation(const URoomData* CurrentRoom, const URoomData* NextRoom, const UDoorType* DoorType, bool& Flipped) { const bool bAreBothRoomValid = IsValid(CurrentRoom) && IsValid(NextRoom); return (bAreBothRoomValid) ? NormalDoor : Wall; } ``` ``` -------------------------------- ### Start New Dungeon Source: https://benpyton.github.io/ProceduralDungeon/guides/Advanced-Features/Custom-Create-Dungeon Resets the rooms and calls Generation Init. Call this at the beginning of a dungeon creation. ```APIDOC ## Start New Dungeon ### Description Resets the rooms and calls Generation Init. Call this at the beginning of a dungeon creation. ### Method N/A ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get Connections Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Returns all the connections of this room. ```APIDOC ## Get Connections ### Description Returns all the connections of this room. ### Method N/A (Blueprint node) ### Parameters None ### Response - **Return Value** (Array of Connection) - All connections of this room. ``` -------------------------------- ### MyCustomDungeonGenerator.cpp - Custom Create Dungeon Implementation Source: https://benpyton.github.io/ProceduralDungeon/guides/Advanced-Features/Custom-Create-Dungeon Implementation template for the custom CreateDungeon function. Shows the required calls to StartNewDungeon and FinalizeDungeon, and demonstrates the use of CreateRoomInstance, TryPlaceRoom, DiscardRoomInstance, AddRoomToDungeon, and OnFailedToAddRoom. This is a non-working example intended to illustrate the important functions. ```cpp URoomData* AMyCustomDungeonGenerator::CreateDungeon_Implementation() { // Must be called whenever you start a new generation. // It will call the `Generation Init` event to allow resetting variables used for the generation. StartNewDungeon(); // ... Do your generation logic here ... // Here the important functions to create and place a new room in the dungeon: { // Create a new room instance from a room data URoom* NewRoom = CreateRoomInstance(RoomData); // Will attempt to place the room in a way to connect the NewRoom's door at specified index to the target door. // The GetWorld() is used to also check is the room is colliding with actors in the world (when the bUseWorldCollisionCheck is true). if (!TryPlaceRoom(NewRoom, NewRoomDoorIndex, TargetDoor, GetWorld()) { // The room could not be placed. DiscardRoomInstance(NewRoom); } // Will actually adds the room into the dungeon and connects the provided doors if possible. // This function will call `OnRoomAdded` and return true if the room has been successfully added to the dungeon. // You can pass an empty array as `DoorsToConnect` to try connecting all the doors. if (!AddRoomToDungeon(NewRoom, /*DoorsToConnect = */TArray{NewRoomDoorIndex}, /*bFailIfNotConnected = */true)) { // The room was not added to the dungeon, because it was invalid (nullptr) or not connected. OnFailedToAddRoom(ParentRoomData, TargetDoor); } } // ... // Must be called when the dungeon has finished the generation. // Will initialize the room instances and call the `Initialize Dungeon` event. FinalizeDungeon(); // You should return true when the dungeon is generated properly. // If returning false, the dungeon will be erased and an error will be displayed. return true; } ``` -------------------------------- ### C++ Actor Replication Setup for Procedural Dungeon Source: https://benpyton.github.io/ProceduralDungeon/guides/Misc/Multiplayer Set bReplicates to true and bNetLoadOnClient to false in the actor constructor to ensure proper replication with the plugin. This is required for actors placed in room levels. ```cpp AMyActor::AMyActor() { // ... bReplicates = true; bNetLoadOnClient = false; // ... } ``` -------------------------------- ### C++ Room Data child class example (AMyRoomData) Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Creating-Rooms Optional but recommended: create a child class of ARoomData to add custom data to rooms. This example adds an integer DifficultyLevel property. You can create multiple child classes or skip this step if no custom data is needed. ```cpp UCLASS() class AMyRoomData : public ARoomData { GENERATED_BODY() public: // This variables is just for example purpose. // You can add whatever variables your rooms need in your project. UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Room Data") int32 DifficultyLevel {0}; } ``` -------------------------------- ### Get All Relevancy Levels Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Get all relevancy levels for this room. ```APIDOC ## Get All Relevancy Levels ### Description Get all relevancy levels for this room. ### Method N/A (Blueprint node) ### Parameters None ### Response - **Return Value** (Map of Player to RelevancyLevel) - All relevancy levels for this room. ``` -------------------------------- ### Get Progress Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonGeneratorBase Returns the current generation progress. ```APIDOC ## Get Progress ### Description Returns the current generation progress. ### Method GetProgress ### Category Dungeon Generator ### Parameters None explicitly documented. ### Returns - **float** - The current generation progress (0 to 1). ``` -------------------------------- ### Get All Doors Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Fills an array with all the door actors connected to the room. ```APIDOC ## Get All Doors ### Description Fill an array with all the door actors connected to the room. ### Method N/A (Blueprint node) ### Parameters - **Doors** (Array of Door) - Output array to be filled with door actors. ### Response None ``` -------------------------------- ### StartNewDungeon Source: https://benpyton.github.io/ProceduralDungeon/api/DungeonGeneratorBase/StartNewDungeon Clears the current graph and calls the GenerationInit event. This method is part of the DungeonGeneratorBase class and is used to start a new dungeon generation. ```APIDOC ## StartNewDungeon ### Description Clear current graph and call GenerationInit event. ### Method C++ ### Signature ```cpp void StartNewDungeon() ``` ### Inputs | Name | Type | Description | | --- | --- | --- | | In | Exec | | | Target | Dungeon Generator Base Object Reference | | ### Outputs | Name | Type | Description | | --- | --- | --- | | Out | Exec | | ``` -------------------------------- ### Get Room A Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Door Node to retrieve the first room connected to the door. ```APIDOC ## Get Room A ### Description Retrieves the first room connected to the door. ### Method N/A (Blueprint Node) ### Endpoint N/A ### Parameters None ### Response - **Return Value** (URoom*) - The first room connected to the door. ``` -------------------------------- ### ShortTooltip meta specifier for USTRUCT Source: https://benpyton.github.io/ProceduralDungeon/contributing/api-references Use the ShortTooltip meta specifier to provide a one-line short description for a type. This example shows a USTRUCT with a short tooltip. ```cpp USTRUCT(BlueprintType, meta = (ShortTooltip = "Just a short one-line description here.")) struct FMyStruct { ... } ``` -------------------------------- ### C++ Header for AMyDungeonGenerator Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Generating-Dungeon/Choose-Next-Room-Data Declares the ChooseNextRoomData_Implementation override and example properties (NormalRooms, EndingRoom, MinNbRoom) for a custom dungeon generator class. ```cpp UCLASS() class AMyDungeonGenerator : public ADungeonGenerator { GENERATED_BODY() public: // ... virtual URoomData* ChooseNextRoomData_Implementation(const URoomData* CurrentRoom, const TScriptInterface& CurrentRoomInstance, const FDoorDef& DoorData, int& DoorIndex) override; // The following variables are just for example purpose UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Dungeon") TArray NormalRooms; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Dungeon") URoomData* EndingRoom; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Dungeon") int32 MinNbRoom; // ... } ``` -------------------------------- ### Get All Connected Rooms Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Returns all the room instances connected with this one. ```APIDOC ## Get All Connected Rooms ### Description Returns all the room instances connected with this one. ### Method N/A (Blueprint node) ### Parameters None ### Response - **Return Value** (Array of Room) - All connected room instances. ``` -------------------------------- ### C++ ChooseDoor Implementation - Header (MyDungeonGenerator.h) Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Generating-Dungeon/Choose-Door Declares the ChooseDoor_Implementation override and example UPROPERTY variables for NormalDoor and Wall in a custom dungeon generator class. ```cpp UCLASS() class AMyDungeonGenerator : public ADungeonGenerator { GENERATED_BODY() public: // ... virtual TSubclassOf ChooseDoor_Implementation(const URoomData* CurrentRoom, const URoomData* NextRoom, const UDoorType* DoorType, bool& Flipped) override; // The following variables are just for example purpose UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Dungeon") TSubclassOf NormalDoor {nullptr}; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Dungeon") TSubclassOf Wall {nullptr}; // ... } ``` -------------------------------- ### Get Room Transform Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/ReadOnlyRoom Returns the transform of the room. ```APIDOC ## Get Room Transform ### Description Returns the transform of the room. ### Category Room ### Returns Transform - The room's transform. ``` -------------------------------- ### Get Door Instance Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomConnection Returns the door instance associated with the room connection. ```APIDOC ## Get Door Instance ### Description Returns the door instance associated with the room connection. ### Category Room Connection ### Defined in Public/RoomConnection.h ### Returns - **Actor** - The door instance. ``` -------------------------------- ### Get Door Def Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Retrieves the door definition for a specific door index. ```APIDOC ## Get Door Def ### Description Get the door definition for a specific door index. ### Method N/A (Blueprint node) ### Parameters - **DoorIndex** (Integer) - The index of the door to get the definition for. ### Response - **Return Value** (DoorDef) - The door definition. ``` -------------------------------- ### ContinueToAddRoom_Implementation Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Generating-Dungeon/Continue-To-Add-Room C++ implementation of the ContinueToAddRoom function. It returns true to continue generation, false to stop. The example stops generation when the EndingRoom has been placed. ```APIDOC ## ContinueToAddRoom_Implementation ### Description This function is called by the generator to determine whether to continue adding rooms. Return true to continue, false to stop. ### Method Override in C++ or Blueprint. ### Signature `virtual bool ContinueToAddRoom_Implementation() override;` ### Parameters None. ### Return Value - **bool** - `true` to continue generation, `false` to stop. ### Example (C++) ```cpp bool AMyDungeonGenerator::ContinueToAddRoom_Implementation() { return !GetRooms()->HasAlreadyRoomData(EndingRoom); } ``` ### Notes - The generation naturally stops if there are no remaining unconnected doors. - Use this function to stop generation before too many rooms are spawned. ``` -------------------------------- ### Full description comment above UPROPERTY Source: https://benpyton.github.io/ProceduralDungeon/contributing/api-references Add a standard comment above the UE macro to provide a full description. Markdown syntax can and should be used. This example shows a comment above a UPROPERTY declaration. ```cpp // Here is the description of the variable. // *It can be on multiple lines.* UPROPERTY(BlueprintReadWrite) int MyVariable; ``` -------------------------------- ### Get Door A Index Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomConnection Returns the index of door A for the room connection. ```APIDOC ## Get Door A Index ### Description Returns the index of door A for the room connection. ### Category Room Connection ### Defined in Public/RoomConnection.h ### Returns - **int** - The index of door A. ``` -------------------------------- ### Get Connected Room At Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Returns the connected room instance at the specified door index. ```APIDOC ## Get Connected Room At ### Description Returns the connected room instance at DoorIndex. ### Method N/A (Blueprint node) ### Parameters - **DoorIndex** (Integer) - The index of the door to get the connected room from. ### Response - **Return Value** (Room) - The connected room instance at the given index. ``` -------------------------------- ### Doxygen comments for function parameters and return value Source: https://benpyton.github.io/ProceduralDungeon/contributing/api-references Use Doxygen syntax in comments to describe function parameters and return value. This example shows a UFUNCTION with @param and @return tags. ```cpp // This is the full description of the function // @param SomeActor This is the description for the SomeActor parameter. // @param SomeValue Description for the SomeValue input. // @return The description for the return value. UFUNCTION(BlueprintCallable) int MyFunction(AActor* SomeActor, int SomeValue) { ... } ``` -------------------------------- ### Get Compatible Room Data Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonGeneratorBase Returns an array of room data with at least one compatible door with the door data provided. ```APIDOC ## Get Compatible Room Data ### Description Returns an array of room data with at least one compatible door with the door data provided. ### Method GetCompatibleRoomData ### Category Dungeon Generator ### Parameters - **doorData** (DoorData) - Required - The door data to check compatibility against. ### Returns - **RoomData[]** - An array of room data that have at least one compatible door. ``` -------------------------------- ### Get Default Door Size Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonBlueprintLibrary Returns the default door type's size. Category: Procedural Dungeon > Settings. ```APIDOC ## Get Default Door Size ### Description Returns the default door type's size. ### Category Procedural Dungeon > Settings ### Node Name Get Default Door Size ### Parameters No parameters documented. ### Returns No return values documented. ``` -------------------------------- ### Get Door Offset Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonBlueprintLibrary Returns the room offset as a percentage of the height of a room unit. Category: Procedural Dungeon > Settings. ```APIDOC ## Get Door Offset ### Description Returns the room offset as a percentage of the height of a room unit. ### Category Procedural Dungeon > Settings ### Node Name Get Door Offset ### Parameters No parameters documented. ### Returns No return values documented. ``` -------------------------------- ### Get Doors With Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Returns the door actor shared with the provided room, or null if not connected. ```APIDOC ## Get Doors With ### Description Returns the door actor shared with the provided room. Returns null if the provided room is not connected with this. ### Method N/A (Blueprint node) ### Parameters - **Room** (Room) - The room to check for a shared door. ### Response - **Return Value** (Door) - The shared door actor, or null if not connected. ``` -------------------------------- ### Get Guid Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomActorGuid Returns the guid associated with this actor. ```APIDOC ## Get Guid ### Description Returns the guid associated with this actor. ### Category Room Actor Id ### Defined In Public/Interfaces/RoomActorGuid.h ### Exposed In Blueprint As Blueprint Base Class | Variable Type ### Return Value - **Guid** - The guid associated with this actor. ``` -------------------------------- ### Get Random Room Data Weighted Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonGeneratorBase 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. ```APIDOC ## Get Random Room Data Weighted ### Description 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. ### Method GetRandomRoomDataWeighted ### Category Dungeon Generator ### Parameters - **weightedRoomData** (Dictionary) - Required - The weighted map of room data to choose from. ### Returns - **RoomData** - A random RoomData based on the weights. ``` -------------------------------- ### Get Seed Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonGeneratorBase Gets the current seed. ```APIDOC ## Get Seed ### Description Gets the current seed. ### Method GetSeed ### Category Dungeon Generator ### Parameters None explicitly documented. ### Returns - **int** - The current seed. ``` -------------------------------- ### C++ Header: Override ChooseFirstRoomData Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Generating-Dungeon/Choose-First-Room-Data Declares the ChooseFirstRoomData_Implementation override in a custom dungeon generator class. Includes a UPROPERTY for the first room, used for example purposes. ```cpp UCLASS() class AMyDungeonGenerator : public ADungeonGenerator { GENERATED_BODY() public: // ... virtual URoomData* ChooseFirstRoomData_Implementation(FRoomTransform& Transform) override; // This variable is just for example purpose UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Dungeon") URoomData* FirstRoom {nullptr}; // ... } ``` -------------------------------- ### Get Door Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Get the door actor from a specific index. ```APIDOC ## Get Door ### Description Get the door actor from a specific index. ### Method N/A (Blueprint node) ### Parameters - **DoorIndex** (Integer) - The index of the door to retrieve. ### Response - **Return Value** (Door) - The door actor at the given index. ``` -------------------------------- ### Try Place Room At Transform Source: https://benpyton.github.io/ProceduralDungeon/guides/Advanced-Features/Custom-Create-Dungeon Same as Try Place Room but you provide directly the room transform instead of letting the plugin compute the room transform from a target door location. ```APIDOC ## Try Place Room At Transform ### Description Same as Try Place Room but you provide directly the room transform instead of letting the plugin compute the room transform from a target door location. ### Method N/A ### Endpoint N/A ### Parameters - **roomInstance** (RoomInstance) - Required - The room instance to move. - **transform** (Transform) - Required - The transform to place the room at. - **collideWithWorld** (bool) - Optional - Whether to check collision with the world. ### Request Example N/A ### Response - **bool** - Whether the room instance overlaps another existing room or optionally collides with the world. ``` -------------------------------- ### Create Room Instance Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonGeneratorBase Create and initialize a new room instance using the room data provided. If you don't add the room to the dungeon, use DiscardRoomInstance to benefit from the pooling system. ```APIDOC ## Create Room Instance ### Description Create and initialize a new room instance using the room data provided. If you don't add the room to the dungeon, use DiscardRoomInstance to benefit from the pooling system. ### Method CreateRoomInstance ### Category GenerationAlgorithm ### Parameters - **roomData** (RoomData) - Required - The room data to create the instance from. ### Returns - **RoomInstance** - The created room instance. ``` -------------------------------- ### PlatformAllowList for UE5 Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Installation Add Mac to the platform allow list for the module in the .uplugin file for UE5 projects. ```txt "PlatformAllowList": ["Win64", "Mac"] ``` -------------------------------- ### Get Room Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomLevel Node to get the room associated with this level. ```APIDOC ## Node: Get Room ### Description Gets the room associated with this level. ### Category Procedural Dungeon ### Parameters None documented. ### Response No return value documented. ``` -------------------------------- ### Get Relevancy Level Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Get the relevancy level for the specified player. ```APIDOC ## Get Relevancy Level ### Description Get the relevancy level for the specified player. A relevancy level < 0 means the room is not relevant for the player. A relevancy level of 0 means the player is inside the room. A relevancy level > 0 means the player is outside the room, the higher the level, the further away the room is. ### Method N/A (Blueprint node) ### Parameters - **Player** (Player) - The player to get the relevancy level for. ### Response - **Return Value** (Integer) - The relevancy level for the player. ``` -------------------------------- ### Get Bounds Extent Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomLevel Node to get the extent of the room bounds. ```APIDOC ## Node: Get Bounds Extent ### Description Gets the extent of the room bounds. ### Category Procedural Dungeon ### Parameters None documented. ### Response No return value documented. ``` -------------------------------- ### Finalize Dungeon Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonGeneratorBase Initialize room instances after all rooms have been placed and connected (call InitializeDungeon). ```APIDOC ## Finalize Dungeon ### Description Initialize room instances after all rooms have been placed and connected (call InitializeDungeon). ### Method FinalizeDungeon ### Category GenerationAlgorithm ### Parameters None explicitly documented. ### Returns None explicitly documented. ``` -------------------------------- ### Get Bounds Center Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomLevel Node to get the center of the room bounds. ```APIDOC ## Node: Get Bounds Center ### Description Gets the center of the room bounds. ### Category Procedural Dungeon ### Parameters None documented. ### Response No return value documented. ``` -------------------------------- ### Get Min Relevancy Level Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Get the minimum relevancy level for this room. ```APIDOC ## Get Min Relevancy Level ### Description Get minimum relevancy level for this room. The lowest value, the closest the room is from any player. A value < 0 means no player has this room as relevant. ### Method N/A (Blueprint node) ### Parameters None ### Response - **Return Value** (Integer) - The minimum relevancy level. ``` -------------------------------- ### Finalize Dungeon Source: https://benpyton.github.io/ProceduralDungeon/guides/Advanced-Features/Custom-Create-Dungeon Initializes all room instances and calls Initialize Dungeon. Call this at the end of dungeon creation. ```APIDOC ## Finalize Dungeon ### Description Initializes all room instances and calls Initialize Dungeon. Call this at the end of dungeon creation. ### Method N/A ### Endpoint N/A ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### WhitelistPlatforms for UE4 Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Installation Add Mac to the whitelisted platforms for the module in the .uplugin file for UE4 projects. ```txt "WhitelistPlatforms": ["Win64", "Mac"] ``` -------------------------------- ### Get Max Relevancy Level Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Get the maximum relevancy level for this room. ```APIDOC ## Get Max Relevancy Level ### Description Get the maximum relevancy level for this room. The highest value, the farthest the room is from any player. A value < 0 means no player has this room as relevant. ### Method N/A (Blueprint node) ### Parameters None ### Response - **Return Value** (Integer) - The maximum relevancy level. ``` -------------------------------- ### Markdown Ordered and Unordered Lists Source: https://benpyton.github.io/ProceduralDungeon/contributing/guides Shows how to create ordered lists with numbers and unordered lists with dashes. Use these to present sequential steps or bullet points. ```markdown 1. This 2. is an 3. ordered list - This - is an - unordered list ``` -------------------------------- ### Get Visibility Mode Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/StaticRoomVisibilityComponent Node to get the current visibility mode of the component. ```APIDOC ## Node: Get Visibility Mode ### Description Retrieves the current visibility mode of the component. ### Category None specified ### Returns - **Visibility Mode** (EVisibilityMode) - The current visibility mode. ``` -------------------------------- ### Markdown Tables Source: https://benpyton.github.io/ProceduralDungeon/contributing/guides Shows how to create a table using pipes and dashes. The header row is separated by a row of dashes, and each subsequent row is a table row. ```markdown | ID | Name | Description | | --- | ----- | ----------- | | 0 | Base | This is a table row | | 2 | Other | Another row in the table | ``` -------------------------------- ### GetGuid Source: https://benpyton.github.io/ProceduralDungeon/api/RoomActorGuid/GetGuid Returns the GUID associated with this actor. This is a method on the Room Actor Guid interface. ```APIDOC ## GetGuid ### Description Return the guid associated with this actor. ### Method GetGuid ### Signature ```cpp FGuid GetGuid() const ``` ### Inputs | Name | Type | Description | | --- | --- | --- | | Target | Room Actor Guid Interface | | ### Outputs | Name | Type | Description | | --- | --- | --- | | Return Value | Guid Structure | | ``` -------------------------------- ### Whitelist platforms in ProceduralDungeon.uplugin Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Packaging Add the desired platforms to the 'WhitelistPlatforms' array in the .uplugin file. Only include the platforms you want to target. ```text "WhitelistPlatforms": [ "Win64", "Android", "IOS", "Mac", "Linux" ] ``` -------------------------------- ### Get Direction Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/ReadOnlyRoom Returns the direction of the room. ```APIDOC ## Get Direction ### Description Returns the direction of the room. ### Category Room ### Returns Direction - The direction of the room. ``` -------------------------------- ### C++ Implementation: ChooseFirstRoomData Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Generating-Dungeon/Choose-First-Room-Data Implements the ChooseFirstRoomData_Implementation function to return the FirstRoom variable, which is set in the editor. ```cpp URoomData* AMyDungeonGenerator::ChooseFirstRoomData_Implementation(FRoomTransform& Transform) { return FirstRoom; } ``` -------------------------------- ### Room Class Overview Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Overview of the Room class including its hierarchy, interfaces, and description. ```APIDOC ## Room Class ### Description The room instances of the dungeon. Holds data specific to each room instance, e.g. location, direction, is player inside, room custom data, etc. ### Defined In `Public/Room.h` ### Hierarchy Object → Replicable Object → Room ### Implements - ReadOnlyRoom - DungeonSaveInterface ### Exposed in Blueprint as Variable Type ``` -------------------------------- ### Get Custom Data Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Access to custom data of the room. ```APIDOC ## Get Custom Data ### Description Access to custom data of the room. ### Method N/A (Blueprint node) ### Parameters - **Type** (Class) - The type of custom data to retrieve. ### Response - **Return Value** (Object) - The custom data of the specified type. ``` -------------------------------- ### RunUAT.sh BuildPlugin command for MacOS Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Installation Command to build the plugin for MacOS using RunUAT.sh. Replace and with actual paths. ```txt ./RunUAT.sh BuildPlugin -Plugin="/PluginPath/ProceduralDungeon.uplugin" -Package="/OutputPath" -Rocket -TargetPlatforms=Mac ``` -------------------------------- ### Get ID Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomConnection Returns the unique identifier of the room connection. ```APIDOC ## Get ID ### Description Returns the unique identifier of the room connection. ### Category Room Connection ### Defined in Public/RoomConnection.h ### Returns - **int** - The connection ID. ``` -------------------------------- ### Get Position Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/ReadOnlyRoom Returns the position of the room (in Room Units). ```APIDOC ## Get Position ### Description Returns the position of the room (in Room Units). ### Category Room ### Returns Vector - The position in Room Units. ``` -------------------------------- ### FinalizeDungeon Source: https://benpyton.github.io/ProceduralDungeon/api/DungeonGeneratorBase/FinalizeDungeon Initializes room instances after all rooms have been placed and connected. This method should be called after InitializeDungeon. ```APIDOC ## FinalizeDungeon ### Description Initializes room instances after all rooms have been placed and connected (call InitializeDungeon). ### Method void FinalizeDungeon() ### Parameters #### Inputs - **In** (Exec) - Required - Execution pin. - **Target** (Dungeon Generator Base Object Reference) - Required - The target DungeonGeneratorBase object. ### Outputs - **Out** (Exec) - Execution pin. ### C++ Signature ```cpp void FinalizeDungeon() ``` ``` -------------------------------- ### Classes Overview Source: https://benpyton.github.io/ProceduralDungeon/api List of classes provided by the Procedural Dungeon plugin, with brief descriptions of their roles. ```APIDOC ## Classes | Class | Module | Type | Description | |-------|--------|------|-------------| | Replicable Object | | | Base class for sub-objects that can be replicated. This class is not blueprintable and should not be used directly in blueprints. | | Room | | Variable Type | The room instances of the dungeon. | | Room Actor Guid | | Blueprint Base Class, Variable Type | Interface to access a custom Guid for actors saved within a dungeon. | | Room Connection | | Variable Type | A DungeonGraph subobject that represents a connection between two rooms. | | Room Constraint | | Blueprint Base Class, Variable Type | Base class for constraints applied to rooms. | | Room Custom Data | | Blueprint Base Class, Variable Type | Base class for user custom data embedded in room instances. | | Room Data | | Blueprint Base Class, Variable Type | Static data shared by multiple room instances. This data is used to define the room's properties and the room level to spawn. | | Room Level | Procedural | Blueprint Base Class, Variable Type | Level script actor for a room instance. This class is used to manage the room instance and its bounds. | | Room Observer Component | ProceduralDungeon | Variable Type | Room Observer that auto-(un)bind itself when it enters/exits a dungeon room. Could observe (be bound) multiple rooms at once if the actor overlaps multiple room. This component does track its own Room, thus the actor can move between rooms (use StaticRoomObserverComponent instead if this behavior is not needed). | | Room Visibility | ProceduralDungeon | Variable Type | Actor component to manage the visibility of an actor in the dungeon. Use this one if the actor is able to move room. If the actor remains in the same room, use UStaticRoomVisibilityComponent instead. | | Room Visibility (Static) | ProceduralDungeon | Variable Type | Component to manage the visibility of an actor in the dungeon. Use this one if the actor remains in the same room. If the actor is able to move room, use URoomVisibilityComponent instead. | | Room Visitor | | Blueprint Base Class, Variable Type | Interface which adds events to an actor (or a component) when the actor enters/exits a dungeon room. | | Simple Guid Component | ProceduralDungeon | Blueprint Base Class, Variable Type | A simple guid component that will retrieve the Editor's ActorGuid to save/load it in packaged games. Warning: This component will work only on placed actor, not actors spawned during runtime! | | Static Room Observer Component | ProceduralDungeon | Variable Type | Room Observer that auto-(un)bind itself at BeginPlay and EndPlay. This component will bind to the level it belongs to. So it needs to be placed directly in the Room map. This component does not track its own Room, thus the actor should not move between rooms (use RoomObserverComponent instead). | | Trigger Door | | Blueprint Base Class, Variable Type | Door that opens when an actor enters the trigger box. You can customize which actors can open the door by overriding the IsValidActor function. | | Trigger Type | Custom | Variable Type | Trigger box that manages detection of actors entering and exiting the trigger. Can execute gameplay logic at regular intervals, with an optional delay before activation. You can customize the actor type that can activate the trigger by setting the ActorType property. | ``` -------------------------------- ### C++ ChooseDoor Implementation - Source (MyDungeonGenerator.cpp) Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Generating-Dungeon/Choose-Door Implements ChooseDoor_Implementation to return NormalDoor if both rooms are valid, otherwise Wall. ```cpp TSubclassOf AMyDungeonGenerator::ChooseDoor_Implementation(const URoomData* CurrentRoom, const URoomData* NextRoom, const UDoorType* DoorType, bool& Flipped) { const bool bAreBothRoomValid = IsValid(CurrentRoom) && IsValid(NextRoom); return (bAreBothRoomValid) ? NormalDoor : Wall; } ``` -------------------------------- ### Get Door Rotation Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomConnection Returns the rotation of the door for the room connection. ```APIDOC ## Get Door Rotation ### Description Returns the rotation of the door for the room connection. ### Category Room Connection ### Defined in Public/RoomConnection.h ### Returns - **Rotator** - The door rotation. ``` -------------------------------- ### Get Door Location Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomConnection Returns the location of the door for the room connection. ```APIDOC ## Get Door Location ### Description Returns the location of the door for the room connection. ### Category Room Connection ### Defined in Public/RoomConnection.h ### Returns - **Vector** - The door location. ``` -------------------------------- ### Open Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DoorComponent Node that opens the door. ```APIDOC ## Open ### Description Opens the door. ### Method Node ### Parameters None ### Response No return value. ``` -------------------------------- ### ChooseNextRoomData_Implementation Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Generating-Dungeon/Choose-Next-Room-Data This function is called each time the generator tries to add a room to the dungeon. It takes the current room, current room instance, and door data as inputs, and returns the next room data and door index. ```APIDOC ## ChooseNextRoomData_Implementation ### Description This function is the main part of the procedural generation: it's where you set your own logic to generate your dungeon. This function is run each time the generator tries to add a room to the dungeon. ### Method C++ virtual function override ### Signature `virtual URoomData* ChooseNextRoomData_Implementation(const URoomData* CurrentRoom, const TScriptInterface& CurrentRoomInstance, const FDoorDef& DoorData, int& DoorIndex) override;` ### Parameters #### Input Parameters - **CurrentRoom** (const URoomData*) - The room from which the generator will try to add the next room. For example, the first time this function is called, the `Current Room` is the `RoomData` asset you have returned in the `Choose First Room` function. [DEPRECATED: use `Get Room Data` of the `Current Room Instance` input instead] - **CurrentRoomInstance** (TScriptInterface) - The room instance from which the generator will try to add the next room. For example, the first time this function is called, the `Current Room Instance` is the `Room` instance created from the room data you have returned in the `Choose First Room` function. - **DoorData** (const FDoorDef&) - The door on which the next room will be connected to. You have access to its location (expressed in room units, not in unreal units!), its orientation and its `DoorType`. #### Output Parameters - **DoorIndex** (int&) - The index of the door (from the `Room Data` asset you return) used to connect with the `Current Room`. If the index is negative, it will choose a random compatible door. If you set a value, it will take the door at the same index in your `Room Data` asset (_make sure the door is compatible!_). ### Return Value - **Return Value** (URoomData*) - The `Room Data` asset you want to add as the next room. The value must be non-null and have at least one compatible door with `Door Data`. ### Example ```cpp URoomData* AMyDungeonGenerator::ChooseNextRoomData_Implementation(const URoomData* CurrentRoom, const TScriptInterface& CurrentRoomInstance, const FDoorDef& DoorData, int& DoorIndex) { // After reaching the minimum number of room, place the end room if (GetRooms()->Count() >= MinNbRoom) { return EndingRoom; } // Otherwise, place a random normal room return GetRandomRoomData(NormalRooms); } ``` ``` -------------------------------- ### Get Bounds Center Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/ReadOnlyRoom Returns the world center position of the room. ```APIDOC ## Get Bounds Center ### Description Returns the world center position of the room. ### Category Room ### Returns Vector - The world center position. ``` -------------------------------- ### ChooseFirstRoomData_Implementation Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Generating-Dungeon/Choose-First-Room-Data Overrides the ChooseFirstRoomData function to return the first room of the dungeon. Must return a valid URoomData pointer and can optionally modify the FRoomTransform to place the room elsewhere. ```APIDOC ## ChooseFirstRoomData_Implementation ### Description Defines the root room of the dungeon generation. Must return a valid `URoomData` pointer, otherwise the generator throws an error. The `FRoomTransform` can be modified to place the first room at a different location than (0,0,0). ### Method Override (C++ virtual function) ### Signature `virtual URoomData* ChooseFirstRoomData_Implementation(FRoomTransform& Transform) override;` ### Parameters #### Out Parameters - **Transform** (FRoomTransform&) - Optional - The transform of the first room. Modify this to change the room's position and rotation. ### Return Value - **URoomData*** - Required - The room data for the first room. Must be a valid pointer. ### Example ```cpp URoomData* AMyDungeonGenerator::ChooseFirstRoomData_Implementation(FRoomTransform& Transform) { return FirstRoom; } ``` ``` -------------------------------- ### Try Place Room at Transform Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonGeneratorBase Set the position and rotation of a room instance and return true if there is nothing colliding with it. ```APIDOC ## Try Place Room at Transform ### Description Set the position and rotation of a room instance and return true if there is nothing colliding with it. ### Method TryPlaceRoomAtTransform ### Category GenerationAlgorithm ### Parameters - **roomInstance** (RoomInstance) - Required - The room instance to place. - **transform** (Transform) - Required - The transform to use for position and rotation. ### Returns - **bool** - True if there is nothing colliding with the room instance at the given transform. ``` -------------------------------- ### DisplayName meta specifier for UCLASS Source: https://benpyton.github.io/ProceduralDungeon/contributing/api-references Use the DisplayName meta specifier to override the default display name for an Unreal Engine type. For example, an enum named EMyEnum would otherwise display as 'EMy Enum'. This example shows a UCLASS with a custom display name 'My Great Actor!'. ```cpp UCLASS(Blueprintable, meta = (DisplayName = "My Great Actor!")) class AMyActor : public AActor { ... } ``` -------------------------------- ### Load All Dungeons Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonGeneratorBase Loads all dungeons from saved data. ```APIDOC ## Load All Dungeons ### Description Loads all dungeons from saved data. ### Method LoadAllDungeons ### Category Dungeon Generator ### Parameters None explicitly documented. ### Returns None explicitly documented. ``` -------------------------------- ### Clone the wiki branch of the forked repository Source: https://benpyton.github.io/ProceduralDungeon/contributing/guides Use this command to clone only the 'wiki' branch of your forked ProceduralDungeon repository. This is the first step in the pull request workflow. Replace 'YourGithubUserName' with your actual GitHub username. ```cmd git clone https://github.com/YourGithubUserName/ProceduralDungeon.git --branch wiki --single-branch ``` -------------------------------- ### Get Random Room Data Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonGeneratorBase Return a random RoomData from the array provided. ```APIDOC ## Get Random Room Data ### Description Return a random RoomData from the array provided. ### Method GetRandomRoomData ### Category Dungeon Generator ### Parameters - **roomDataArray** (RoomData[]) - Required - The array of room data to choose from. ### Returns - **RoomData** - A random RoomData from the array. ``` -------------------------------- ### Is Visible Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Room Is the room currently visible? ```APIDOC ## Is Visible ### Description Is the room currently visible? ### Method N/A (Blueprint node) ### Parameters None ### Response - **Return Value** (Boolean) - True if the room is visible. ``` -------------------------------- ### Get Room Data Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/ReadOnlyRoom Returns the room data asset of this room instance. ```APIDOC ## Get Room Data ### Description Returns the room data asset of this room instance. ### Category Room ### Returns RoomData - The room data asset. ``` -------------------------------- ### RoomData Class Overview Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomData Overview of the RoomData class, its hierarchy, and its purpose. ```APIDOC ## RoomData Class ### Description Static data shared by multiple room instances. This data is used to define the room's properties and the room level to spawn. ### Hierarchy Object → Data Asset → Primary Data Asset → Room Data ### Defined In `Public/RoomData.h` ### Exposed In Blueprint Blueprint Base Class | Variable Type ``` -------------------------------- ### Get Bounds Extent Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/ReadOnlyRoom Returns the world extents (half size) of the room. ```APIDOC ## Get Bounds Extent ### Description Returns the world extents (half size) of the room. ### Category Room ### Returns Vector - The world extents (half size). ``` -------------------------------- ### Get Level Room Data Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/DungeonBlueprintLibrary Retrieves the room data for the current level. ```APIDOC ## Get Level Room Data ### Description Retrieves the room data for the current level. ### Category Utilities > Procedural Dungeon ### Parameters None ### Returns - **Return Value** (LevelRoomData) - The room data for the level. ``` -------------------------------- ### Get Room B Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/Door Node to retrieve the second room connected to the door. ```APIDOC ## Get Room B ### Description Retrieves the second room connected to the door. ### Method N/A (Blueprint Node) ### Endpoint N/A ### Parameters None ### Response - **Return Value** (URoom*) - The second room connected to the door. ``` -------------------------------- ### C++ Implementation of ContinueToAddRoom with EndingRoom Check Source: https://benpyton.github.io/ProceduralDungeon/guides/Getting-Started/Generating-Dungeon/Continue-To-Add-Room Header and source files for a custom dungeon generator that overrides ContinueToAddRoom_Implementation to stop generation when the EndingRoom is placed. The header declares the override and an EndingRoom property; the source returns false when the room is already present. ```cpp UCLASS() class AMyDungeonGenerator : public ADungeonGenerator { GENERATED_BODY() public: // ... virtual bool ContinueToAddRoom_Implementation() override; // This variable is just for example purpose UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "My Dungeon") URoomData* EndingRoom {nullptr}; // ... } ``` ```cpp bool AMyDungeonGenerator::ContinueToAddRoom_Implementation() { return !GetRooms()->HasAlreadyRoomData(EndingRoom); } ``` -------------------------------- ### Get Door B Index Source: https://benpyton.github.io/ProceduralDungeon/api/Classes/RoomConnection Returns the index of door B for the room connection. ```APIDOC ## Get Door B Index ### Description Returns the index of door B for the room connection. ### Category Room Connection ### Defined in Public/RoomConnection.h ### Returns - **int** - The index of door B. ```