11 Quick Main Paths Setup
Raphtalia edited this page 2024-08-20 16:49:44 +00:00

This guide is to quickly setup multiple main paths for your interior. What these features do exactly is explained here.

Preview

Single Path Dungeon Generation

The following is an example if the dungeon generation were to create only one main path. The tile that will act as the MainRoomTilePrefab is outlined in yellow. The main path depth is the ratio of the main tile's position in the main path. 0 is the start of the main path, 0.5 is the midpoint, and 1 is the end of the main path. Since there is only one main path, the dungeon generation is no different than the vanilla version.

Static Gif

Multi-Path Dungeon Generation

The following is an example if the dungeon generation were to create two main paths instead. Please pay attention to the following:

  • The second main path begins after the MainRoomTilePrefab
  • The MainRoomTilePrefab is NOT the start tile
  • The end tile node is duplicated for the second main path, but not the start tile
  • The main tile depth for the second main path does not refresh to 0. It follows after the MainRoomTilePrefab
Static Gif

NOTE: Adding a main path will quickly increase the amount of tiles in your dungeon. Though the pictures above are only abstract, the tile count still increased from 27 to 42.

Setting up DunGenExtender

In the DunGenExtender asset, set MainPathCount to some value above 1.

Set the MainRoomTilePrefab to the tile that you want the alternate main paths to start from. This is NOT the fake start tile that many dungeon's like to use. Be sure that this tile has multiple doorways.

The DungenFlow's node list is replicated onto the alternate main paths. The starting index is based on the MainPathCopyNodeBehaviour selected. Any nodes before the starting index will be ignored and not be generated. I suggest you select Copy From Main Path Position first, and later decide if Copy From Node List is right for your dungeon.

NOTE: Due to how injection tile rules work, they cannot be duplicated to the alternate main paths. They still function properly for the first main path. If you want to force generation of certain tiles, you can achieve a similar effect with the Copy From Node List behaviour and the Archetypes On Normal Nodes feature below.

Copy From Main Path Position

The starting index is the first node whose position is greater than the MainRoomTilePrefab's depth on the first main path.

NOTE: The depth is some number between 0 and 1. As such, you can expect the start node to always be ignored and the end node to always be duplicated on the alternate main paths.

⚠️ WARNING: ⚠️ This behaviour is perfectly safe to use IF the node's positions are no where near the MainRoomTilePrefab's predicated depth or you don't use nodes besides the start and end node. This behaviour is not safe to use and can lead to funky and broken dungeon generations IF the node's position are near the MainRoomTilePrefab's depth. In these situations, I recommend using Copy From Node List instead.

Main Path Length 10 (Good) Main Path Length 5 (Scary)

In the picture to the left, the 0.15 node tile is the first node replicated onto the alternate main path as it's the first node whose position is greater than the MainRoomTilePrefab's depth of 0.1.

In the picture to the right, you can see the dangers if the node's positions are near the MainRoomTilePrefab's depth. Since the main path's length is 5, the first tile after the start tile would have a depth of 0.2. This would lead to the node tile generating first before the MainRoomTilePrefab. As such, the 0.15 node will not be replicated for the alternate main path. More scary, since the start tile doesn't follow with the MainRoomTilePrefab, the dungeon generation may completely break both code-wise and/or visual-wise. See the Copy From Node List section below for how you could address this.

Copy From Node List

The starting index is the first node whose tilesets contain MainRoomTilePrefab plus 1. Due to this, the node section MUST contain some node whose tileset contains MainRoomTilePrefab.

If you select this behaviour, you may want to enable the Archetypes On Normal Nodes feature below.

NOTE: This behaviour is the only way to guarantee that certain tiles generate in a certain order on the alternate main paths.

The following is an example to why you'd want to choose Copy From Node List. You can force the interior to generate a sequence of tiles at the start of the main path. You simply list out the sequence in the node list and set their position to all 0. This works perfectly fine for the first main path. However, the nodes after the main tile (which would generate the MainRoomTilePrefab) would not replicate onto the alternate main paths. This behaviour occurs with Copy From Main Path Position.

If you choose and setup Copy From Node List instead, the algorithm will replicate the nodes after the main tile.

Copy From Main Path Position Copy From Node List

After that's selected

That's it. You are done. Multiple main paths should spawn from the main room selected, with branching paths and all.

Archetypes On Normal Nodes

Tiles generated from nodes cannot create branching paths. This is because those tiles cannot have archetypes, which describes how branching paths are created. However with this feature, we can finally allow these nodes to branch out.

If you want nodes to generate certain tiles on the alternate main paths and you want those tiles to have branching paths, you should enable this feature. If the MainPathCopyNodeBehaviour chosen is Copy From Node List, you may want to enable this feature so the MainRoomTilePrefab tile can generate branching paths along with multiple main paths.

Activate the Archetypes On Normal Nodes feature by toggling AddArchetypesToNormalNodes. If you want every normal node to have the same archetype, then add an element to the list whose Label is empty and the Archetype list which contains that archetype. If you want specify which node gets a specific archetype, then add an element whose Label is that node's Label and the Archetype list which contains that specific archetype.

Examples of multiple main pathed interiors

Vanilla interior examples

Custom interior w/ DungeonGenerationPlus examples