Dungeon Generator  1.6.6
Procedural 3D dungeon generator plugin for Unreal Engine 5. Easy generation of levels, mini-maps and missions.
ADungeonRoomSensorBase Class Reference

#include <DungeonRoomSensorBase.h>

Inheritance diagram for ADungeonRoomSensorBase:
ADungeonVerifiableActor

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
 
CDungeonRandomGetSynchronizedRandom ()
 
CDungeonRandomGetLocalRandom ()
 
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 Public Member Functions inherited from ADungeonVerifiableActor
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 &center)
 
virtual void OnNativeInitialize ()
 
virtual void OnNativeFinalize (const bool finish)
 
virtual void OnNativeReset (const bool fallToAbyss)
 
virtual void OnNativeResume ()
 
- Protected Member Functions inherited from ADungeonVerifiableActor
 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
 

Detailed Description

Room Area Sensor Actor DungeonRoomSensorBase is an actor that is not intended to be replicated. Please be very careful with server-client synchronization.

部屋の領域センサーアクター DungeonRoomSensorBaseはレプリケーションされない前提のアクターです。 サーバーとクライアントの同期に十分注意して下さい。

Member Function Documentation

◆ AddDungeonDoor()

void ADungeonRoomSensorBase::AddDungeonDoor ( ADungeonDoorBase dungeonDoorBase)

Add room door 部屋にドアを追加します

◆ AddDungeonTorch()

void ADungeonRoomSensorBase::AddDungeonTorch ( AActor *  actor)

Add torchlight in a room 部屋に燭台を追加します

◆ EachDungeonDoors()

template<typename Function >
void ADungeonRoomSensorBase::EachDungeonDoors ( Function &&  function) const
inlinenoexcept

Update room doors 部屋のドアを更新します

◆ EachDungeonTorch()

template<typename Function >
void ADungeonRoomSensorBase::EachDungeonTorch ( Function &&  function) const
inlinenoexcept

Update the torchlight in the room. 部屋の燭台を更新します

◆ GenerateCrc32()

uint32_t ADungeonRoomSensorBase::GenerateCrc32 ( uint32_t  crc = 0xffffffffU) const
overridevirtualnoexcept

Calculate CRC32 CRC32を計算します

Reimplemented from ADungeonVerifiableActor.

◆ GetBounding() [1/2]

UBoxComponent * ADungeonRoomSensorBase::GetBounding ( )

Get the bounding of the room entry sensor 部屋の進入センサーの範囲を取得します

◆ GetBounding() [2/2]

const UBoxComponent * ADungeonRoomSensorBase::GetBounding ( ) const

Get the bounding of the room entry sensor 部屋の進入センサーの範囲を取得します

◆ GetDepthRatioFromStart()

float ADungeonRoomSensorBase::GetDepthRatioFromStart ( ) const

Calculate the depth ratio from the start スタート部屋からゴール部屋の部屋数からこの部屋の深さの割合を計算します

◆ GetDoorAddingProbability()

uint8 ADungeonRoomSensorBase::GetDoorAddingProbability ( ) const
noexcept

Gets the probability (0%-100%) of adding a door. Settings after OnInitialize are invalid. ドアを追加する確率(0~100%)を取得します。 OnInitialize以降の設定は無効です。

◆ GetDungeonGeneratorTag()

const FName & ADungeonRoomSensorBase::GetDungeonGeneratorTag ( )
static

Get the DungeonGenerator tag name. DungeonGeneratorのタグを取得します

Author
Shun Moriya

◆ GetDungeonGeneratorTags()

const TArray< FName > & ADungeonRoomSensorBase::GetDungeonGeneratorTags ( )
static

Get the DungeonGenerator tag name. DungeonGeneratorのタグを取得します

◆ GetFloorHeightPosition()

bool ADungeonRoomSensorBase::GetFloorHeightPosition ( FVector &  result,
FVector  startPosition,
const float  offsetHeight = 0.f 
) const

Get floor height position 部屋の高さ取得します

◆ GetIdentifier()

int32 ADungeonRoomSensorBase::GetIdentifier ( ) const
noexcept

Get the room identifier 部屋の識別子を取得します

◆ GetInquireInteriorTags()

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 というタグを返した場合、キッチンのタグを持つインテリアが選択されます。 複数のタグが設定されている場合、すべてのタグを含むアクターがスポーン候補として選択されます。

◆ GetLocalRandom()

CDungeonRandom & ADungeonRoomSensorBase::GetLocalRandom ( )

Get a random object that can be used locally Use when using random numbers only remotely.

ローカルで使用できるランダムオブジェクトを取得します リモートのみで乱数を使用する時に使用して下さい。

◆ GetRoomSize()

const FBox & ADungeonRoomSensorBase::GetRoomSize ( ) const
noexcept

Get room size 部屋の範囲を取得します

◆ GetSynchronizedRandom()

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.

同期用のランダムオブジェクトを取得します 必ずリモートとクライアントが同じ回数乱数を取得するようにしてください。 回数が違った場合はダンジョンの生成の同期に失敗します。

◆ HasLockedDoor()

bool ADungeonRoomSensorBase::HasLockedDoor ( ) const

Does the room have a locked door? 部屋に鍵付きドアがあるか?

◆ IdealNumberOfActor()

int32 ADungeonRoomSensorBase::IdealNumberOfActor ( const float  areaRequiredPerPerson = 500.f,
const int32  maxNumberOfActor = 5 
) const

Get the ideal number of people in the bounding 部屋に含める理想的な人数を求めます

Parameters
[in]areaRequiredPerPerson(default : 500cm)
[in]maxNumberOfActor(default : 5 actors)
Returns
ideal number of people in the bounding

◆ OnFinalize()

void ADungeonRoomSensorBase::OnFinalize ( const bool  finish)

Finalize function called before object destruction オブジェクト破棄前に呼び出される終了用関数

◆ OnInitialize()

void ADungeonRoomSensorBase::OnInitialize ( const EDungeonRoomParts  parts,
const EDungeonRoomItem  item,
const uint8  depthFromStart,
const float  depthFromStartRatio 
)

Function called during initialization after object creation オブジェクト生成後に呼び出される初期化用関数

◆ OnNativeFinalize()

void ADungeonRoomSensorBase::OnNativeFinalize ( const bool  finish)
protectedvirtual

Function called before object destruction オブジェクト破棄前の終了用関数

◆ OnNativeInitialize()

void ADungeonRoomSensorBase::OnNativeInitialize ( )
protectedvirtual

Functions for initialization after object creation オブジェクト生成後の初期化用関数

◆ OnNativePrepare()

bool ADungeonRoomSensorBase::OnNativePrepare ( const FVector &  center)
protectedvirtual

遅延スポーン直後の初期化準備関数 Prepareが成功するとInitializeが呼び出され、失敗するDungeonRoomSensorBaseは破棄されます。

◆ OnNativeReset()

void ADungeonRoomSensorBase::OnNativeReset ( const bool  fallToAbyss)
protectedvirtual

Reset room sensor ルームセンサーのリセット

◆ OnNativeResume()

void ADungeonRoomSensorBase::OnNativeResume ( )
protectedvirtual

Reset room sensor ルームセンサーの再開

◆ OnPrepare()

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は破棄されます。

◆ OnReset()

void ADungeonRoomSensorBase::OnReset ( const bool  fallToAbyss)

Function called on reset

◆ OnResume()

void ADungeonRoomSensorBase::OnResume ( )

Function called on resume

◆ RandomPoint()

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にした場合、必ず全てのクライアントで同じ回数呼び出すようにしてください。

◆ RandomTransform()

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にした場合、必ず全てのクライアントで同じ回数呼び出すようにしてください。

◆ SetDoorAddingProbability()

void ADungeonRoomSensorBase::SetDoorAddingProbability ( const uint8  doorAddingProbability)
noexcept

Sets the probability (0% to 100%) that a door will be added. Settings after OnInitialize are invalid. ドアを追加する確率(0~100%)を設定します。 OnInitialize以降の設定は無効です。

◆ SpawnActorFromClass()

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. アクターをスポーンするユーティリティ関数です。 スポーンされたアクターの自身をオーナーアクターにして、タグにダンジョンジェネレータを追加します。

Member Data Documentation

◆ AreaRequiredPerPerson

float ADungeonRoomSensorBase::AreaRequiredPerPerson = 500.f
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配列が空の場合はスポーンしません

◆ AutoReset

bool ADungeonRoomSensorBase::AutoReset = true
protected

Automatically calls OnReset when the player leaves プレイヤーが離れたら自動的にOnResetを呼ぶ

◆ Bounding

TObjectPtr<UBoxComponent> ADungeonRoomSensorBase::Bounding
protected

Room Bounding Box 部屋のバウンディングボックスセンサーコンポーネント

◆ BranchId

uint8 ADungeonRoomSensorBase::BranchId = 0
protected

ミッショングラフが生成したブランチ識別子 Branch identifier generated by the mission graph

◆ DeepestDepthFromStart

uint8 ADungeonRoomSensorBase::DeepestDepthFromStart = 0
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が変化するなどに利用できます

◆ DepthFromStart

uint8 ADungeonRoomSensorBase::DepthFromStart = 0
protected

Room depth from the starting room Can be used to change the background music as you go deeper into the room, etc.

スタート部屋から部屋の深さ

奥に行くほどBGMが変化するなどに利用できます

◆ DoorAddingProbability

uint8 ADungeonRoomSensorBase::DoorAddingProbability = 100
protected

the probability (0%-100%) of adding a door ドアを追加する確率(0~100%)

◆ DungeonDoors

TArray<TObjectPtr<ADungeonDoorBase> > ADungeonRoomSensorBase::DungeonDoors
protected

Room door 部屋のドア

◆ DungeonTorches

TArray<TObjectPtr<AActor> > ADungeonRoomSensorBase::DungeonTorches
protected

Torchlight in a room 部屋の燭台

◆ HorizontalMargin

float ADungeonRoomSensorBase::HorizontalMargin = 0.f
protected

Horizontal margin of room bounding box sensor 部屋のバウンディングボックスセンサーの水平マージン

◆ Identifier

int32 ADungeonRoomSensorBase::Identifier = -1
protected

Room Identifier 部屋の識別子

◆ Item

EDungeonRoomItem ADungeonRoomSensorBase::Item = EDungeonRoomItem::Empty
protected

Types of items that should be placed in the room 部屋に配置すべきアイテムの種類

◆ MaxNumberOfActor

int32 ADungeonRoomSensorBase::MaxNumberOfActor = 5
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配列が空の場合はスポーンしません

◆ OnFallToAbyss

FDungeonRoomSensorBaseEventSignature ADungeonRoomSensorBase::OnFallToAbyss
protected

Notification when exiting from the bottom of the sensor (falling into the abyss) センサーの底面から出た時の通知(奈落落下)

◆ Parts

EDungeonRoomParts ADungeonRoomSensorBase::Parts = EDungeonRoomParts::Any
protected

Type of room parts (start, goal, hall, etc.) 部屋パーツの種類(スタート、ゴール、ホール等)

◆ RoomSize

FBox ADungeonRoomSensorBase::RoomSize
protected

Room Size 部屋の大きさ

◆ SpawnActors

TArray<FSoftObjectPath> ADungeonRoomSensorBase::SpawnActors
protected

Actor spawning in a room For finer control, spawn actors individually using OnNativeInitialize or OnInitialize

部屋にスポーンするアクター 細やかな制御をおこなう場合はOnNativeInitializeやOnInitializeでアクターを個別にスポーンして下さい

◆ SpawnKeyActor

FSoftObjectPath ADungeonRoomSensorBase::SpawnKeyActor
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.

ミッショングラフの鍵アクター 指定した場合は部屋のランダムな位置にスポーンします。 宝箱や敵を倒した時に鍵を入手させたい場合は独自に実装して下さい。

◆ SpawnUniqueKeyActor

FSoftObjectPath ADungeonRoomSensorBase::SpawnUniqueKeyActor
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.

ミッショングラフのユニーク鍵アクター 指定した場合は部屋のランダムな位置にスポーンします。 宝箱や敵を倒した時に鍵を入手させたい場合は独自に実装して下さい。

◆ VerticalMargin

float ADungeonRoomSensorBase::VerticalMargin = 0.f
protected

Vertical margin of room bounding box sensor 部屋のバウンディングボックスセンサーの垂直マージン


The documentation for this class was generated from the following files: