Dungeon Architect for Unity 1.20 Help

Create Spawn Room

We're going to create a spawn room and place a marker there to spawn our player prefab

Spawn Room

Create a spawn room module like before and leave a few connection points open

Ut 11 48

In this example, we've created a 1x1x1 spawn room with a single connection point

Create SpawnPoint Marker

We want the theme engine to spawn our player prefab in the spawn room. Create a placeable actor asset named PM_SpawnPoint

Ut 11 49
Ut 11 50

Select the PM_SpawnPoint asset and inspect the properties.

Ut 11 51
  • Add a marker named SpawnPoint in the Supported Markers array

  • Change the debug color to green

  • Set the debug text to something descriptive, like Spawn Point

Save and placeable marker prefab

Add SpawnPoint Marker

Open the Spawn Room module prefab and drop this placeable marker asset somewhere appropriate

Ut 11 53

Close the prefab and return to the scene

Add Player prefab

Open the theme file we created previously.

Ut 11 59
Ut 11 60

Create a new Marker node and rename it to SpawnPoint

Ut 11 62
Ut 11 61

Add a player prefab. We already have a player prefab setup with some fps controls. Drop it from the samples folder Navigate to Assets > CodeRespawn > DungeonArchitect_Samples > DemoBuilder_SnapGridFlow > Art > Prefabs > Player and drag-drop SGFDemoPlayer on to the theme editor

Ut 11 63

We want the player prefab to spawn 1 unit high (since the placeable markers was placed on the ground)

Ut 11 64

Save and close the theme editor

Register Spawn Module

Open up the module database and register this spawn room module

Ut 11 54

Set the category name to SpawnRoom. We'll use this category name in the flow graph shortly, to force it to use our spawn room while building the main path

Recompile the module database cache

Ut 11 55

Save the module database

Update Flow Graph

Open up our flow graph editor and reassign the Module database in the Editor Settings as before

Ut 11 56

Select the Create Main Path node and inspect the properties

Ut 11 57
Ut 11 58

Add an entry to Start Node Category Constraints and set it to SpawnRoom.

This will make the flow editor choose the start room registered in the module database with the specified category. As of now, we have only one spawn room, feel free to register more modules with the same name to have it randomly pick one spawn room

Hit build in the flow editor and make sure it generates a flow graph correctly

Goal Room

Open up the Goal room prefab we created earlier

Ut 11 67
Ut 11 68

We'll create a placeable marker prefab that supports the marker name LevelGoal. We'll then use the theme engine to spawn our level goal prefab (e.g. it could be an artifact that takes you to another dungeon)

Create LevelGoal Marker

Create a Placeable Marker asset and name it PM_LevelGoal

Ut 11 49
Ut 11 69

Inspect the properties. Add LevelGoal as a Supported Marker

Ut 11 70

Change the Debug Text to something descriptive

Ut 11 71

Add LevelGoal Marker

Add the PM_LevelGoal marker to the goal module. Drag and drop it somwhere appropriate in your goal module

Ut 11 73

Close the goal room prefab and return back to the scene

Ut 11 74

Since we've modified the markers in the module prefab, we'll need to recompile the module database cache

Open the module database and click Compile Module Database button

Ut 11 55

Add LevelGoal Prefab

Open the theme file we created previously.

Ut 11 59

Create a new Marker node and rename it to LevelGoal

Ut 11 62
Ut 11 75

Add your level goal prefab here. We'll use a simple cube for this example that will represent the final boss

Ut 11 76

Build dungeon

Open the scene where we previously set up our dungeon. Rebuild the dungeon

You should see the spawn room, and a PlayerStart actor spawned at the correct place

Ut 11 65

You should be able to play your game and move around with the player prefab

Ut 11 66

Level Goal prefab:

Ut 11 77
Last modified: 24 January 2024