12 Quick Main Paths Setup
Raphtalia edited this page 2024-10-22 04:15:35 +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 CANNOT be a start tile. Be sure that this tile has multiple doorways.

The DungenFlow's node list is replicated onto the alternate main paths. The entire list is not replicated; it begins from a starting index 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. In other words, all nodes whose depth is higher than the MainRoomTilePrefab's depth will be replicated.

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: ⚠️ Depending on the moon's map multiplier and other factors beyond your control, you cannot predict the length of the main paths. As such, the MainRoomTilePrefab's depth is unpredictable. This can potentially lead to dungeon generation issues if not accounted for.

This behaviour is perfectly safe to use IF the node's positions are no where near the MainRoomTilePrefab's expected depth OR you only use the start/end nodes and don't use any additional normal nodes.

This behaviour is not safe to use and can lead to funky and broken dungeon generations IF any node's (particularly normal nodes) position are near the MainRoomTilePrefab's expected 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 now 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. By using this behaviour, we are depending on the nodes section to spawn the MainRoomTilePrefab tile instead of the vanilla method with the unique door socket.

⚠️ WARNING: ⚠️ The node section MUST contain some normal 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 properly 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