Building Entity Types¶
This page describes the public data types used for Building Entities, ownership, save data, and world rebuilding.
Type Relationships¶
EBuildingOwnerType
└── FBuildingOwnerId
└── FBuildingEntity
└── FUpdateBuildingEntityInfo
└── FEntitySnapTree
FUpdateBuildingEntityIdInfo
├── EntityId
├── WorldTransform
└── FEntitySnapTree
EBuildingOwnerType¶
EBuildingOwnerType represents the type of a building owner.
| Enum Value | Description |
|---|---|
None |
No valid owner. |
Player |
A player. |
Faction |
A faction or team. |
NPC |
An NPC. |
System |
The game system or another system-level object. |
FBuildingOwnerId¶
FBuildingOwnerId represents building ownership using an owner type and a stable string ID.
This structure does not depend on a Player Controller, Player State, Pawn, or Actor instance.
Fields¶
| Field | Type | Default | Description |
|---|---|---|---|
Type |
EBuildingOwnerType |
None |
The owner type. |
Id |
FString |
Empty | The stable identifier of the owner. |
A valid owner ID must satisfy:
Member Functions¶
| Function | Description |
|---|---|
IsValid |
Checks whether the owner type and ID are valid. |
IsPlayer |
Checks whether the owner is a player. |
None |
Creates an empty owner ID. |
Player |
Creates a player owner ID. |
Faction |
Creates a faction owner ID. |
operator== |
Compares two owner IDs. |
Projects usually provide owner IDs through IBuildingOwnerProvider.
For interface details, see Project Interfaces.
Warning
Do not use Actor names, object addresses, temporary array indexes, or runtime Controller IDs as persistent owner IDs.
FBuildingEntity¶
FBuildingEntity represents the persistent data of a placed building.
Fields¶
| Field | Type | Default | Description |
|---|---|---|---|
EntityId |
int32 |
INDEX_NONE |
The unique identifier of the Building Entity. |
ChunkId |
int32 |
0 |
The Chunk to which the building belongs at runtime. |
WorldTransform |
FTransform |
Identity | The building's world transform. |
BuildableAssetId |
FPrimaryAssetId |
Invalid | The ID of the building configuration asset. |
OwnerId |
FBuildingOwnerId |
None |
The building owner. |
EntityData |
FBuildingEntityData |
Default | The persistent state of the building. |
EntityId¶
EntityId is used for:
- Querying buildings
- Moving or removing buildings
- Network synchronization
- Snap Tree references
- Save restoration
An invalid ID uses:
RebuildAll preserves existing EntityId values and sets the next ID to the highest existing ID plus one.
ChunkId¶
ChunkId is runtime data.
When the world is rebuilt, Chunks are recreated and assigned according to WorldTransform. Therefore, ChunkId should not be used as a persistent relationship.
WorldTransform¶
WorldTransform stores:
| Component | Description |
|---|---|
| Location | World-space location. |
| Rotation | World-space rotation. |
| Scale | World-space scale. |
BuildableAssetId¶
BuildableAssetId references the UBuildingDataAsset used to create the Entity.
When restoring a building, the system uses this ID to locate the corresponding building data asset.
OwnerId¶
OwnerId can be used for:
- Building permissions
- Save ownership
- Faction checks
- Building statistics
- Resource refunds
EntityData¶
EntityData stores additional building state, such as:
- Gameplay Tags
- Attributes
- Health or durability
- Project-specific extension data
FUpdateBuildingEntityInfo¶
FUpdateBuildingEntityInfo combines a complete Entity with its Snap Tree.
| Field | Type | Description |
|---|---|---|
Entity |
FBuildingEntity |
The complete Building Entity. |
SnapTree |
FEntitySnapTree |
The building's snapping relationships. |
It is primarily used by:
| API | Purpose |
|---|---|
CollectSaveRecords |
Collects the current building records. |
RebuildAll |
Rebuilds the building world from saved records. |
Note
The Snap Tree represents snapping relationships and is not used for structural support evaluation.
FUpdateBuildingEntityIdInfo¶
FUpdateBuildingEntityIdInfo is a lightweight update structure.
| Field | Type | Default | Description |
|---|---|---|---|
EntityId |
int32 |
INDEX_NONE |
The target Entity ID. |
WorldTransform |
FTransform |
Identity | The updated world transform. |
SnapTree |
FEntitySnapTree |
Default | The updated snapping relationships. |
This type is used for internal update operations that do not need to transfer the complete EntityData.
Standard projects usually do not need to create this structure manually.
Type Usage¶
| Type | Purpose | Complete Entity | Snap Tree |
|---|---|---|---|
FBuildingOwnerId |
Building ownership | No | No |
FBuildingEntity |
Individual Building Entity | Yes | No |
FUpdateBuildingEntityInfo |
Save data and world rebuilding | Yes | Yes |
FUpdateBuildingEntityIdInfo |
Lightweight updates | No | Yes |
Save Rules¶
| Save | Do Not Save |
|---|---|
EntityId |
Actor pointers |
WorldTransform |
HISM Component pointers |
BuildableAssetId |
HISM Instance Indexes |
OwnerId |
Render Chunk Actor pointers |
EntityData |
Runtime component mappings |
SnapTree |
Client preview state |
During rebuilding:
Preserve EntityId
→ Reassign Chunks according to WorldTransform
→ Rebuild runtime representations
→ Next Entity Id = Highest existing Entity Id + 1
Related APIs¶
| Functionality | API |
|---|---|
| Query a single Entity | UBuildingWorldSubsystem::TryFindEntity |
| Get all Entities | UBuildingWorldSubsystem::GetAllEntity |
| Collect save records | UBuildingWorldSubsystem::CollectSaveRecords |
| Rebuild the building world | UBuildingWorldSubsystem::RebuildAll |
| Get the owner ID | IBuildingOwnerProvider::GetBuildingOwnerId |