Dungeon Generator
1.6.6
Procedural 3D dungeon generator plugin for Unreal Engine 5. Easy generation of levels, mini-maps and missions.
|
#include <DungeonRoomSensorBase.h>
Public Member Functions | |
ADungeonRoomSensorBase (const FObjectInitializer &initializer) | |
int32 | GetIdentifier () const noexcept |
bool | OnPrepare (const float depthFromStartRatio) |
virtual bool | OnPrepare_Implementation (const float depthFromStartRatio) |
void | OnInitialize (const EDungeonRoomParts parts, const EDungeonRoomItem item, const uint8 depthFromStart, const float depthFromStartRatio) |
void | OnFinalize (const bool finish) |
void | OnReset (const bool fallToAbyss) |
void | OnResume () |
UBoxComponent * | GetBounding () |
const UBoxComponent * | GetBounding () const |
const FBox & | GetRoomSize () const noexcept |
int32 | IdealNumberOfActor (const float areaRequiredPerPerson=500.f, const int32 maxNumberOfActor=5) const |
bool | RandomPoint (FVector &result, const float offsetHeight=0.f, const bool useLocalRandom=true) const |
bool | RandomTransform (FTransform &result, const float offsetHeight=0.f, const bool useLocalRandom=true) const |
bool | GetFloorHeightPosition (FVector &result, FVector startPosition, const float offsetHeight=0.f) const |
AActor * | SpawnActorFromClass (TSubclassOf< class AActor > actorClass, const FTransform transform, const ESpawnActorCollisionHandlingMethod spawnCollisionHandlingOverride=ESpawnActorCollisionHandlingMethod::Undefined, APawn *instigator_=nullptr, const bool transient=false) |
float | GetDepthRatioFromStart () const |
uint8 | GetDoorAddingProbability () const noexcept |
void | SetDoorAddingProbability (const uint8 doorAddingProbability) noexcept |
void | AddDungeonDoor (ADungeonDoorBase *dungeonDoorBase) |
template<typename Function > | |
void | EachDungeonDoors (Function &&function) const noexcept |
bool | HasLockedDoor () const |
void | AddDungeonTorch (AActor *actor) |
template<typename Function > | |
void | EachDungeonTorch (Function &&function) const noexcept |
TArray< FString > | GetInquireInteriorTags () const |
CDungeonRandom & | GetSynchronizedRandom () |
CDungeonRandom & | GetLocalRandom () |
virtual uint32_t | GenerateCrc32 (uint32_t crc=0xffffffffU) const noexcept override |
virtual void | BeginPlay () override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
virtual void | BeginDestroy () override |
Static Public Member Functions | |
static const FName & | GetDungeonGeneratorTag () |
static const TArray< FName > & | GetDungeonGeneratorTags () |
![]() | |
static uint32_t | GenerateCrc32 (const AActor *actor, uint32_t crc=0xffffffffU) noexcept |
static uint32_t | GenerateCrc32 (const FBox &box, uint32_t crc=0xffffffffU) noexcept |
static uint32_t | GenerateCrc32 (const FRotator &rotator, uint32_t crc=0xffffffffU) noexcept |
static uint32_t | GenerateCrc32 (const FQuat &rotator, uint32_t crc=0xffffffffU) noexcept |
static uint32_t | GenerateCrc32 (const FTransform &transform, uint32_t crc=0xffffffffU) noexcept |
static uint32_t | GenerateCrc32 (const FVector &vector, uint32_t crc=0xffffffffU) noexcept |
Protected Member Functions | |
virtual bool | OnNativePrepare (const FVector ¢er) |
virtual void | OnNativeInitialize () |
virtual void | OnNativeFinalize (const bool finish) |
virtual void | OnNativeReset (const bool fallToAbyss) |
virtual void | OnNativeResume () |
![]() | |
ADungeonVerifiableActor (const FObjectInitializer &initializer) | |
virtual | ~ADungeonVerifiableActor () override=default |
Protected Attributes | |
TObjectPtr< UBoxComponent > | Bounding |
FBox | RoomSize |
float | HorizontalMargin = 0.f |
float | VerticalMargin = 0.f |
int32 | Identifier = -1 |
EDungeonRoomParts | Parts = EDungeonRoomParts::Any |
EDungeonRoomItem | Item = EDungeonRoomItem::Empty |
uint8 | BranchId = 0 |
uint8 | DepthFromStart = 0 |
uint8 | DeepestDepthFromStart = 0 |
bool | AutoReset = true |
FDungeonRoomSensorBaseEventSignature | OnFallToAbyss |
uint8 | DoorAddingProbability = 100 |
TArray< TObjectPtr< ADungeonDoorBase > > | DungeonDoors |
TArray< TObjectPtr< AActor > > | DungeonTorches |
float | AreaRequiredPerPerson = 500.f |
int32 | MaxNumberOfActor = 5 |
TArray< FSoftObjectPath > | SpawnActors |
FSoftObjectPath | SpawnKeyActor |
FSoftObjectPath | SpawnUniqueKeyActor |
Friends | |
class | ADungeonGenerateBase |
Room Area Sensor Actor DungeonRoomSensorBase is an actor that is not intended to be replicated. Please be very careful with server-client synchronization.
部屋の領域センサーアクター DungeonRoomSensorBaseはレプリケーションされない前提のアクターです。 サーバーとクライアントの同期に十分注意して下さい。
void ADungeonRoomSensorBase::AddDungeonDoor | ( | ADungeonDoorBase * | dungeonDoorBase | ) |
Add room door 部屋にドアを追加します
void ADungeonRoomSensorBase::AddDungeonTorch | ( | AActor * | actor | ) |
Add torchlight in a room 部屋に燭台を追加します
|
inlinenoexcept |
Update room doors 部屋のドアを更新します
|
inlinenoexcept |
Update the torchlight in the room. 部屋の燭台を更新します
|
overridevirtualnoexcept |
Calculate CRC32 CRC32を計算します
Reimplemented from ADungeonVerifiableActor.
UBoxComponent * ADungeonRoomSensorBase::GetBounding | ( | ) |
Get the bounding of the room entry sensor 部屋の進入センサーの範囲を取得します
const UBoxComponent * ADungeonRoomSensorBase::GetBounding | ( | ) | const |
Get the bounding of the room entry sensor 部屋の進入センサーの範囲を取得します
float ADungeonRoomSensorBase::GetDepthRatioFromStart | ( | ) | const |
Calculate the depth ratio from the start スタート部屋からゴール部屋の部屋数からこの部屋の深さの割合を計算します
|
noexcept |
Gets the probability (0%-100%) of adding a door. Settings after OnInitialize are invalid. ドアを追加する確率(0~100%)を取得します。 OnInitialize以降の設定は無効です。
|
static |
Get the DungeonGenerator tag name. DungeonGeneratorのタグを取得します
|
static |
Get the DungeonGenerator tag name. DungeonGeneratorのタグを取得します
bool ADungeonRoomSensorBase::GetFloorHeightPosition | ( | FVector & | result, |
FVector | startPosition, | ||
const float | offsetHeight = 0.f |
||
) | const |
Get floor height position 部屋の高さ取得します
|
noexcept |
Get the room identifier 部屋の識別子を取得します
TArray<FString> ADungeonRoomSensorBase::GetInquireInteriorTags | ( | ) | const |
Gets the tag of the interior of the room to be generated. For example, if the creator returns the tag kitchen
, the interior with the kitchen tag will be selected. If multiple tags are set, actors containing all tags will be selected as spawn candidates.
生成する部屋のインテリアのタグを取得します。 例えば、クリエイターが kitchen
というタグを返した場合、キッチンのタグを持つインテリアが選択されます。 複数のタグが設定されている場合、すべてのタグを含むアクターがスポーン候補として選択されます。
CDungeonRandom & ADungeonRoomSensorBase::GetLocalRandom | ( | ) |
Get a random object that can be used locally Use when using random numbers only remotely.
ローカルで使用できるランダムオブジェクトを取得します リモートのみで乱数を使用する時に使用して下さい。
|
noexcept |
Get room size 部屋の範囲を取得します
CDungeonRandom & ADungeonRoomSensorBase::GetSynchronizedRandom | ( | ) |
Get a random object for synchronization Make sure that the remote and client get the same number of random numbers. If the counts are different, synchronization of dungeon creation will fail.
同期用のランダムオブジェクトを取得します 必ずリモートとクライアントが同じ回数乱数を取得するようにしてください。 回数が違った場合はダンジョンの生成の同期に失敗します。
bool ADungeonRoomSensorBase::HasLockedDoor | ( | ) | const |
Does the room have a locked door? 部屋に鍵付きドアがあるか?
int32 ADungeonRoomSensorBase::IdealNumberOfActor | ( | const float | areaRequiredPerPerson = 500.f , |
const int32 | maxNumberOfActor = 5 |
||
) | const |
Get the ideal number of people in the bounding 部屋に含める理想的な人数を求めます
[in] | areaRequiredPerPerson | (default : 500cm) |
[in] | maxNumberOfActor | (default : 5 actors) |
void ADungeonRoomSensorBase::OnFinalize | ( | const bool | finish | ) |
Finalize function called before object destruction オブジェクト破棄前に呼び出される終了用関数
void ADungeonRoomSensorBase::OnInitialize | ( | const EDungeonRoomParts | parts, |
const EDungeonRoomItem | item, | ||
const uint8 | depthFromStart, | ||
const float | depthFromStartRatio | ||
) |
Function called during initialization after object creation オブジェクト生成後に呼び出される初期化用関数
|
protectedvirtual |
Function called before object destruction オブジェクト破棄前の終了用関数
|
protectedvirtual |
Functions for initialization after object creation オブジェクト生成後の初期化用関数
|
protectedvirtual |
遅延スポーン直後の初期化準備関数 Prepareが成功するとInitializeが呼び出され、失敗するDungeonRoomSensorBaseは破棄されます。
|
protectedvirtual |
Reset room sensor ルームセンサーのリセット
|
protectedvirtual |
Reset room sensor ルームセンサーの再開
bool ADungeonRoomSensorBase::OnPrepare | ( | const float | depthFromStartRatio | ) |
Preparation for initialization immediately after spawning If OnPrepare succeeds, OnInitialize is called and the failing DungeonRoomSensorBase is deleted. スポーン直後の初期化準備 OnPrepareが成功するとOnInitializeが呼び出され、失敗するDungeonRoomSensorBaseは破棄されます。
void ADungeonRoomSensorBase::OnReset | ( | const bool | fallToAbyss | ) |
Function called on reset
void ADungeonRoomSensorBase::OnResume | ( | ) |
Function called on resume
bool ADungeonRoomSensorBase::RandomPoint | ( | FVector & | result, |
const float | offsetHeight = 0.f , |
||
const bool | useLocalRandom = true |
||
) | const |
Get a random position in the bounding If useLocalRandom is set to false, be sure to call it the same number of times for all clients.
部屋の範囲内のランダムな位置を取得します useLocalRandomをfalseにした場合、必ず全てのクライアントで同じ回数呼び出すようにしてください。
bool ADungeonRoomSensorBase::RandomTransform | ( | FTransform & | result, |
const float | offsetHeight = 0.f , |
||
const bool | useLocalRandom = true |
||
) | const |
Get random transforms in bounding If useLocalRandom is set to false, be sure to call it the same number of times for all clients.
部屋の範囲内のランダムなトランスフォームを取得します useLocalRandomをfalseにした場合、必ず全てのクライアントで同じ回数呼び出すようにしてください。
|
noexcept |
Sets the probability (0% to 100%) that a door will be added. Settings after OnInitialize are invalid. ドアを追加する確率(0~100%)を設定します。 OnInitialize以降の設定は無効です。
AActor * ADungeonRoomSensorBase::SpawnActorFromClass | ( | TSubclassOf< class AActor > | actorClass, |
const FTransform | transform, | ||
const ESpawnActorCollisionHandlingMethod | spawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::Undefined , |
||
APawn * | instigator_ = nullptr , |
||
const bool | transient = false |
||
) |
Utility function to spawn an actor. Makes the spawned actor's own owner-actor and adds a dungeon generator to the tag. アクターをスポーンするユーティリティ関数です。 スポーンされたアクターの自身をオーナーアクターにして、タグにダンジョンジェネレータを追加します。
|
protected |
Number of people per area to find the ideal number of people to spawn in a room. If the SpawnActors array is empty, it will not spawn.
部屋にスポーンする理想的な人数を求めるための面積毎の人数 SpawnActors配列が空の場合はスポーンしません
|
protected |
Automatically calls OnReset when the player leaves プレイヤーが離れたら自動的にOnResetを呼ぶ
|
protected |
Room Bounding Box 部屋のバウンディングボックスセンサーコンポーネント
|
protected |
ミッショングラフが生成したブランチ識別子 Branch identifier generated by the mission graph
|
protected |
Depth of deepest room from starting room Can be used to change the background music as you go deeper into the room, etc.
スタート部屋から最も深い部屋の深さ 奥に行くほどBGMが変化するなどに利用できます
|
protected |
Room depth from the starting room Can be used to change the background music as you go deeper into the room, etc.
スタート部屋から部屋の深さ
奥に行くほどBGMが変化するなどに利用できます
|
protected |
the probability (0%-100%) of adding a door ドアを追加する確率(0~100%)
|
protected |
Room door 部屋のドア
|
protected |
Torchlight in a room 部屋の燭台
|
protected |
Horizontal margin of room bounding box sensor 部屋のバウンディングボックスセンサーの水平マージン
|
protected |
Room Identifier 部屋の識別子
|
protected |
Types of items that should be placed in the room 部屋に配置すべきアイテムの種類
|
protected |
Maximum number of people to find the ideal number of people to spawn in a room If the SpawnActors array is empty, it will not spawn.
部屋にスポーンする理想的な人数を求めるための最大人数 SpawnActors配列が空の場合はスポーンしません
|
protected |
Notification when exiting from the bottom of the sensor (falling into the abyss) センサーの底面から出た時の通知(奈落落下)
|
protected |
Type of room parts (start, goal, hall, etc.) 部屋パーツの種類(スタート、ゴール、ホール等)
|
protected |
Room Size 部屋の大きさ
|
protected |
Actor spawning in a room For finer control, spawn actors individually using OnNativeInitialize or OnInitialize
部屋にスポーンするアクター 細やかな制御をおこなう場合はOnNativeInitializeやOnInitializeでアクターを個別にスポーンして下さい
|
protected |
Key actor in the mission graph. Spawns at a random location in the room if specified. If you want the key to be obtained from a treasure chest or when an enemy is defeated, implement it independently.
ミッショングラフの鍵アクター 指定した場合は部屋のランダムな位置にスポーンします。 宝箱や敵を倒した時に鍵を入手させたい場合は独自に実装して下さい。
|
protected |
Unique key actor in the mission graph. Spawns at a random location in the room if specified. If you want the key to be obtained from a treasure chest or when an enemy is defeated, implement it independently.
ミッショングラフのユニーク鍵アクター 指定した場合は部屋のランダムな位置にスポーンします。 宝箱や敵を倒した時に鍵を入手させたい場合は独自に実装して下さい。
|
protected |
Vertical margin of room bounding box sensor 部屋のバウンディングボックスセンサーの垂直マージン