-
-
Notifications
You must be signed in to change notification settings - Fork 23
CustomSelector en
Custom Selector is the mechanism used when Random, Identifier, or Depth From Start are not enough and you want to replace the selection rule with a UDungeonPartsSelector-derived asset.
- You want visual choices to react to surrounding room shape or progression depth
- You want deterministic weighted selection so server and client stay aligned
- You want theme switching that is hard to express with built-in policies
- Create a Blueprint or C++ class derived from
UDungeonPartsSelector. - Implement
SelectMeshSetIndexorSelectPartsIndex. - Change the target
Selection PolicytoCustom Selector. - Assign your selector asset to the corresponding selector property.
Set up UDungeonMeshSetDatabase like this:
Mesh Set Selection Policy = Custom Selector- Assign a
UDungeonPartsSelector-derived asset toCustom Mesh Set Selector
SelectMeshSetIndex is then called with FMeshSetQuery and the number of candidates, and should return the chosen mesh-set index.
Floors, walls, roofs, slopes, catwalks, chandeliers, pillars, torches, and doors can also use Custom Selector.
- On
FDungeonMeshSetfor floor / wall / roof / slope / catwalk / chandelier
Set the corresponding*PartsSelectionPolicytoCustom Selectorand assignCustom Mesh Parts Selector. - On
UDungeonGenerateParameterfor pillars / torches / doors and similar fixtures
Set the corresponding*SelectionPolicytoCustom Selectorand assignCustom Dungeon Parts Selector.
In that case, SelectPartsIndex is called with FPartsQuery and the candidate count, and should return the final part index.
UDungeonSamplePartsSelector is included as a sample implementation.
-
FMeshSetQuery
The query passed when selecting a mesh set. -
FPartsQuery
The query passed when selecting an individual part. The sample includes deterministic rules usingNeighborMask6andSeedKey.
A practical starting point is to duplicate the sample and add conditions gradually.
- Selectors run on the generation hot path on the game thread
- Avoid heavy processing, asynchronous work, and expensive external lookups
- Avoid unsynchronized randomness or time-dependent branching because they can create server/client divergence
- Keep the return value in the range
0throughNumCandidates - 1
UDungeonGenerateParameter::SelectMeshSetIndex still exists, but in the current setup it is mainly a legacy-compatibility path.
For new content, selector assets make it much easier to understand where the selection rule is defined.
-
UDungeonMeshSetDatabase.en.md
Review mesh-set policies and chandelier settings. -
ADungeonGenerateActor.en.md
Apply these advanced settings to the runtime generation actor.
- Quick Start
- Prepare Mesh Parts
- ADungeonGenerateActor
- ADungeonSubLevelScriptActor
- ADungeonRoomSensorBase
- UDungeonGenerateParameter
- UDungeonMeshSetDatabase
- UDungeonInteriorDatabase
- UDungeonSubLevelDatabase
- UDungeonRoomSensorDatabase
- Generate Minimap Textures
- Apply MissionGraph
- Custom Selector Guide
- Lobby Connection Guide