Connectors
A connector is an opening that leads to another module. For example, a connector could be represented by a door, a vent, or even by nothing if it should just be an empty opening.
You need to add connectors to a module by placing Connector Markers for the generator to know how modules can connect.
Important Concepts
- The location and rotation of connectors are defined by placing Connector Markers in the module creation process (the red arrows).
- Every connector has a Connector Type. The generator will always match two connectors of the same type when connecting two modules. For example, a
Small Ventwill always connect to anotherSmall Vent. - A module must have at least one connector. There is no upper limit.
- Keep in mind that modules with only one connector cannot be used as intermediate modules (leading from a module to another module), meaning if you ask the generator to place multiple modules with only one connector in a row, generation will fail. Instead, these modules can only be used at the start or the end of a route.
- The generator uses connectors as needed. It can leave connectors unused (meaning they end up not leading to another module).
- Used connections can be represented by actors, for example by a door that opens when a player approaches. These actors are called Connector Actors.
- Unused connections can be represented by a static mesh, for example a door that's deactivated and never opens.
- You can define how used and unused connectors should be represented in the Module Set asset.
Creating Connectors
- Right-click in the Content Browser → Dungeon Generator → Create a Dungeon Connector Type.
- Name it something like
Normal DoororSmall Vent. - Optional: Assign a Preview Mesh so you can see the size of the opening while placing markers.
- Ideally, the preview mesh indicates the size of an opening leading to another module. The preview is only a placement aid. It does not have any other function.
- Name it something like
- Open your module level → Select
ConnectorMarker1in the Outliner → Set its Connector Type to the type you just created. - Position it so that the arrow begins exactly where your module geometry ends, pointing outwards.
- The placement height does not matter, as long as you use the same height for every Connector Marker.
- Place one Connector Marker in each of your module's openings that should lead to another module.
- Duplicate the marker as needed.
- Save the level → In the Dungeon Tools, click Save/Update module data.
You can also assign Tags to Connector Markers in the Details Panel. These can later be used in the Dungeon Graph. For example, by adding a tag like Entrance to a connector, you can ensure that the player always enters the module through this connector. For more information on how to set this up, check out Dungeon Graphs → Tags and Labels.
The Connector Marker arrow must point outside of your module and must begin exactly where the level geometry ends.
You can create multiple Connector Types if you have multiple sizes for openings. The generator will always match two connectors of the same type. A Normal Door connector of Module A will always lead to another Normal Door connector of Module B.
Adding Doors and Closing Meshes
In the Module Set asset, you can define which actors can be used for used connections (connections that lead to another module), and which static meshes to use for unused connections.
- Open your Module Set → Connector Pools → Add an entry for your Connector Type.
- Under Used Connections, add the Connector Actors that can be used for this type.
- For example, create a door Blueprint based on Dungeon Connector and select it here.
- Set Actor Class to None if the connection should have no actor.
- Under Unused Connectors, add the meshes that can close unused openings.
- For example, use a wall piece that fills an unused doorway.
- Leave the list empty, or use an entry with no mesh, if the opening should stay unsealed.
- Set the Weight of each entry.
- A higher weight makes an entry more likely to be chosen.
- A weight of 0 disables it.
For example, you could add two entries to the Used Connections pool for the Normal Door Connector Type:
- A door actor, with a low weight.
- None, with a high weight.
With this setup, Normal Door connections will sometimes be represented by a door, but are usually left open.
If you have a Locked Door or another special connector actor, you can force it to spawn at specific connections using the Dungeon Graph. See Dungeon Graphs for more information.
Interacting with Connector Actors During Play
In your Dungeon Connector Blueprint:
- Override On Connector Ready → Call Get Connection if your Connector Actor needs to know which modules it connects.
- Get Connection might not be available yet at Begin Play.
- Call Set Open on the server to open or close the door.
- Override On Open State Changed to react to the door opening (e.g., by playing an animation).
- This event runs on the server and clients.
- If the door takes time to close, call Set Fully Closed to true when the closing animation finishes.
- Properly setting Fully Closed allows the plugin to determine which modules a player can see inside of. For example, this could be used to spawn enemies outside of the player's sight. See Module Managers for more information.