Table of Contents

Class DungeonBuilder

Namespace
GrindFest.Editor
Assembly
GrindFest.dll

High-level dungeon builder that provides reusable patterns for creating BuildPlannerPreset graphs. Subclass this and override Configure() to create specific dungeon layouts using Room(), Corridors(), Darkness(), etc.

The builder encapsulates complex PGG node wiring into simple method calls. For custom/advanced wiring, all PGGGraphBuilder low-level methods (N, WirePort, WireExec, etc.) are still available.

public abstract class DungeonBuilder : PGGGraphBuilder
Inheritance
object
DungeonBuilder
Derived
Inherited Members

Properties

AssetFilename

Filename for the saved asset (e.g., "BP_Royal_Tomb_Code.asset").

FnCounterInstr

Shared PlannerFunctionNode for counter cell instructions (doorways).

Preset

The preset being built. Available during Configure().

PresetName

Name for the generated BuildPlannerPreset asset.

Methods

Build()

Build the preset. Call Configure() which subclasses implement.

BuildAndSave()

Build and save to asset file.

Configure()

Called by Build() — add planners, connections, and borders here.

Corridors(FieldSetup, FieldPlanner, FieldPlanner)

Create a Corridor planner that pathfinds connections between all Room-tagged planners. Uses Delaunay triangulation for optimal connections, then A* for actual paths.

connectToEntrance: if not null, also pathfinds from this planner to the corridor network. connectToRooms: if not null, Delaunay connects these specific planners (else uses Room-tagged).

Darkness(FieldSetup)

Create a Darkness planner that forms an outline border around all Room-tagged and Corridor-tagged planners. This is the standard "void surrounding the dungeon" effect.

DoorwayDetection(FieldPlanner, params FieldPlanner[])

Add doorway detection post-procedures to a room planner. Iterates cells, checks for contact with neighboring fields, and marks contact cells with doorway instructions.

Optional: additionalPlanners to include in the contact check (e.g., pass the Entrance planner so doors appear between rooms and entrance).

PushOut(FieldPlanner)

Add a PushOutOfCollision sub-graph to prevent this planner from overlapping others. Uses cell-level collision detection (not bounding boxes) and iterates up to 32 times internally per planner until fully resolved. Single pass is sufficient.

Room(string, FieldSetup, ShapeGeneratorBase, int, bool)

Create a Room planner with standard dungeon settings. Tagged as "Room" for corridor/darkness auto-detection.

ScatterPlacement(FieldPlanner, float)

Add random scatter placement: rooms placed at random grid positions within [-range, +range] * cellSize on X and Z axes. This is the standard "rooms scattered in a dungeon" pattern.

ScatterRoom(string, FieldSetup, ShapeGeneratorBase, int, bool, float, FieldPlanner)

Create a standard scatter room with doorway detection and push-out. This is the most common room pattern: randomly placed, pushed apart, with doorways detected at contact points.

Zone(string, FieldSetup, ShapeGeneratorBase, int, string)

Create a planner with custom tag (not "Room"). Use for corridors, darkness, special zones, etc.