|
Space Plunder
|
#include <ProceduralDungeonBuilder.h>
Public Member Functions | |
| AProceduralDungeonBuilder () | |
Protected Member Functions | |
| virtual void | BeginPlay () override |
| virtual void | OnConstruction (const FTransform &Transform) override |
| void | CreateDungeonInEditor () |
| void | DestroyDungeonInEditor () |
| void | HideAllRoomRoofs () |
| void | CreateDungeon () |
| void | OnDungeonComplete (const int32 NumOfRooms) |
| void | OnDoorsSpawned (const int32 NumOfDoors) |
| void | OnAISpawned (const int32 NumOfPawns) |
| void | Multicast_DungeonComplete (int32 NumRooms) |
| FRandomStream & | GetRandomStream () const |
| bool | IsOverlapping (const FBox &CandidateBox) |
| bool | GetIsValidRoomConnection (const EDungeonRoomType ParentType, const EDungeonRoomType CandidateType) const |
| UMaterialInstanceDynamic * | GetMaterialInstance () const |
| void | SpawnStartingRoom () |
| void | SpawnAllRooms () |
| void | CreateDynamicMaterials () |
| void | SpawnNextRoom () |
| void | ContinueSpawnNextRoom () |
| void | SetInitialValues () |
| void | SpawnSpecialRoom () |
| void | ScheduleSpawn (const FTimerDelegate::TMethodPtr< AProceduralDungeonBuilder > SpawnMethod) |
| void | AddAISpawnPointsToList (const USceneComponent *AIRootComponent) |
| void | CheckExitsForJoiningRooms () |
| void | CloseHoles () |
| void | SpawnDoorAtLocation () |
| void | SpawnAIAtLocation () |
| void | SetRoomsReady () const |
| void | DungeonComplete () |
Protected Attributes | |
| FDungeonSpawns | RoomTypes |
| int32 | StartingRoomNumber = 0 |
| int32 | NumberOfRoomsToSpawn = 50 |
| bool | bUseRandomNumberOfRooms = false |
| int32 | MinNumberOfRoomsToSpawn = 2 |
| TSubclassOf< AActor > | RoomChecker = nullptr |
| bool | bApplyDynamicMaterial = true |
| UMaterialInterface * | RoomMaterial = nullptr |
| class UDataTable * | MaterialDataTable = nullptr |
| bool | bCheckRoomExitCount = false |
| int32 | CheckRoomExitCountMin = 3 |
| bool | bCheckRoomTypes = true |
| bool | bGetClosestExit = false |
| bool | bRandomGetClosestExit = false |
| float | RandomClosesExitWeight = 0.5f |
| bool | bUseRandomSeed = true |
| int32 | Seed = 0 |
| TSubclassOf< AActor > | WallFill = nullptr |
| bool | bFillWithDeadEndRooms = false |
| bool | bSpawnDoors = true |
| bool | bLimitDoors = true |
| int32 | DoorLimit = 10 |
| TArray< TSubclassOf< AActor > > | DoorTypes |
| TArray< int32 > | DoorWeights |
| bool | bCreateOnBeginPlay = true |
| bool | bUseGameModeStream = true |
| bool | bCheckForJoiningRooms = true |
| int32 | AIToSpawn = 10 |
| TArray< TSubclassOf< AActor > > | AITypes |
| bool | bComplete = false |
| TArray< USceneComponent * > | AvailableExits |
| TArray< USceneComponent * > | DoorLocations |
| TArray< USceneComponent * > | ExitsToFill |
| USceneComponent * | SelectedExit = nullptr |
| AActor * | LastSpawnedRoom = nullptr |
| TArray< UPrimitiveComponent * > | OverlappedComponents |
| TArray< AActor * > | DungeonActors |
| TArray< TSubclassOf< AActor > > | SpecialRoomTypeClasses |
| UMaterialInstanceDynamic * | RoomMaterialInstance = nullptr |
| TArray< FBox > | PlacedRoomBounds |
| USceneComponent * | SelectedAISpawn = nullptr |
| USceneComponent * | SelectedDoorSpawn = nullptr |
| TArray< USceneComponent * > | AISpawns |
| bool | bUsingGameModeSteam = false |
| TArray< USceneComponent * > | AISpawnsSelected |
| TArray< USceneComponent * > | AISpawnsFailed |
| TArray< USceneComponent * > | DoorSpawnsSelected |
| TArray< USceneComponent * > | DoorSpawnsFailed |
Private Member Functions | |
| void | OnRoomsComplete () |
| void | CheckRoomAttemptsNumber () |
| void | SetSeed () |
| void | SetNumberOfRooms () |
| bool | GetShouldStopSpawningRooms () const |
| bool | GetShouldSpawnSpecialRoom () const |
| USceneComponent * | GetNextExit () |
| UClass * | GetNewRoomClass () const |
| UClass * | GetStartingRoomClass () |
| UClass * | GetSpecialRoomClass () const |
| UClass * | GetDeadEndRoomClass () const |
| TArray< FDungeonSpawnRoom > | GetRoomsOfTypeBP (const TArray< EDungeonRoomType > &FilterTypes, const bool bInverseSelection=false) const |
| TArray< FDungeonSpawnRoom > | GetRoomsOfType (const TArray< EDungeonRoomType > &FilterTypes, const bool bInverseSelection=false) const |
| TArray< FDungeonSpawnRoom > | GetRoomsOfType (const EDungeonRoomType FilterType, const bool bInverseSelection=false) const |
| TArray< FDungeonSpawnRoom > | GetRoomsByExits () const |
| void | RemoveExitsByDistance (TArray< USceneComponent * > &ExitsA, TArray< USceneComponent * > &ExitsB) const |
| bool | SetDungeonValues () |
| void | LogDebugError (const FString &Message) const |
| void | LogDebugWarning (const FString &Message) const |
| void | LogDebugMessage (const FString &Message, const bool bWarning=false, const bool bError=false) const |
| AProceduralDungeonBuilder::AProceduralDungeonBuilder | ( | ) |
|
protected |
Adds any overlapping components to a List
|
overrideprotectedvirtual |
|
protected |
Check exits after the generator is complete, to see if they're next to Rooms
|
private |
Checks that room attempts number hasn't been incorrectly input
|
protected |
Closes empty exits after the generator is complete
|
protected |
Triggers next room function
|
protected |
|
protected |
Creates a Dungeon From the Editor
|
protected |
|
protected |
Deletes the Last Dungeon From the Editor
|
protected |
Sets the dungeon to complete
|
private |
|
protected |
|
inlineprotected |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
Gets if the next spawn should take from the special list
|
private |
Checks if Still rooms to spawn, if too many attempts
|
private |
|
private |
|
protected |
|
protected |
|
private |
Gets random from the array
|
private |
|
private |
|
protected |
|
protected |
|
overrideprotectedvirtual |
|
protected |
|
protected |
|
private |
For use if there is a Delay,
|
private |
|
protected |
|
private |
|
protected |
|
private |
Sets the Number Of Rooms
|
protected |
Sets all rooms to be Ready
|
private |
Sets the RandomStream
|
protected |
Spawns Random AI at the Spawn points
|
protected |
Create first room at Actors location
|
protected |
Closes empty exits after the generator is complete
|
protected |
The function that loops creating rooms
|
protected |
The function that Spawns from the Special rooms List, only creating a certain amount of them
|
protected |
Create first room at Actors location
|
private |
Number of rooms spawned
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
private |
Total times we have tried to spawn a room
|
protected |
All available Exit Components
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
If the builder is complete
|
private |
If the Dungeon was created in Editor
|
protected |
|
private |
|
private |
|
private |
|
private |
For showing the build process slowly, which can make it easier to find faults
|
private |
Should a possible exit be removed once selected, or after the actor has spawned false will guarantee that all rooms will try to spawn, causing more memory leaks true will remove exits that have failed to spawn a room, causing more fills, and likely fewer rooms than intended
|
private |
|
protected |
|
protected |
|
private |
|
private |
Saves if one of the Rooms is invalid
|
private |
|
protected |
|
private |
Log Each Main function of the builder
|
private |
Log main stats after build complete
|
protected |
|
private |
|
protected |
Actor with collision to Check if 2 rooms are joining
|
private |
|
private |
|
protected |
|
protected |
If true, Set the NumberOfRooms to the Max Amount
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
|
protected |
How likely the Door is to be picked, 1 Standard, 2 double
|
protected |
|
private |
The max distance two exits have to be auto deleted
|
protected |
Exits that failed to spawn, but should be filed
|
protected |
The Last Room that was Created
|
protected |
|
protected |
|
private |
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
Stored Stream to generate Random Numbers
|
private |
|
private |
How many times should we try to spawn a room before giving up, any higher than 5 is too risky
|
private |
Math Function is calculated differently, so it can have more Attempts
|
protected |
|
protected |
|
protected |
|
private |
Number of rooms spawned
|
protected |
List of the Room types to Spawn in
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
|
private |
Saved Starting Special Rooms
|
private |
Saved number of rooms we are trying to spawn
|
protected |
From the RoomTypes Array, set to -1 for Random
|
private |
Saved Starting room Classes
|
private |
Saved number of rooms * the Random Amount
|
protected |
Wall to fill in any gaps