Struct WindingCorridorSettings
Immutable settings that control the shape of winding corridors generated by BSP and Room-and-Corridor algorithms.
Inherited Members
Namespace: Scylla.Core.Util.ProceduralMapGen
Assembly: ScyllaCore.dll
Syntax
public readonly struct WindingCorridorSettings
Remarks
When a corridor-carving algorithm uses Winding, it divides each corridor into a series of straight segments separated by random waypoints called jogs. At each jog the path deviates perpendicularly from the direct line between the two rooms (or BSP leaf centres) by a random offset sampled uniformly from [MinJogOffset, MaxJogOffset).
The number of jogs per corridor is chosen randomly from [0, MaxJogs]. Increasing MaxJogs produces more meandering corridors. Widening the [MinJogOffset, MaxJogOffset) range increases how far each jog can deviate from the direct path. Negative values in the offset range allow jogs in both perpendicular directions, producing S-shaped curves.
This struct is embedded in WindingSettings and WindingSettings and is only consulted by the generator when the parent settings' CorridorStyle is Winding.
When creating a parent settings struct with winding corridors enabled, always pass
a WindingCorridorSettings instance explicitly (or use one of the
static presets). Passing the C# default keyword zero-initializes the struct
(MaxJogs = 0, both offsets = 0), which will produce straight
corridors with no jogs despite the winding style being selected.
Constructors
WindingCorridorSettings(int, int, int)
Initializes a new WindingCorridorSettings with the specified parameters.
Declaration
public WindingCorridorSettings(int maxJogs = 2, int minJogOffset = -3, int maxJogOffset = 4)
Parameters
| Type | Name | Description |
|---|---|---|
| int | maxJogs | Maximum number of perpendicular waypoints per corridor segment. The actual jog
count is chosen randomly from [0, |
| int | minJogOffset | Minimum perpendicular offset in cells (inclusive). Negative values allow jogs in
both directions, producing S-curves. Must be <= |
| int | maxJogOffset | Maximum perpendicular offset in cells (exclusive). The largest offset the algorithm
produces is |
Fields
Default
Default preset: up to 2 jogs per corridor with perpendicular offset range [-3, 3]. Produces gently winding corridors suitable for most dungeon layouts.
Declaration
public static readonly WindingCorridorSettings Default
Field Value
| Type | Description |
|---|---|
| WindingCorridorSettings |
Remarks
The exclusive upper bound is stored as 4, so the actual maximum offset
produced is 3 cells.
Extreme
Extreme preset: up to 3 jogs per corridor with a large perpendicular offset range [-5, 5]. Produces heavily meandering corridors that can curve significantly away from the direct room-to-room path.
Declaration
public static readonly WindingCorridorSettings Extreme
Field Value
| Type | Description |
|---|---|
| WindingCorridorSettings |
Remarks
The exclusive upper bound is stored as 6, so the actual maximum offset
produced is 5 cells. Use with caution on small grids or layouts with tightly
packed rooms, as large offsets can cause corridor cells to overlap room interiors.
MaxJogOffset
Maximum perpendicular offset applied at each jog, in cells (exclusive).
Declaration
public readonly int MaxJogOffset
Field Value
| Type | Description |
|---|---|
| int |
Remarks
The actual offset at each jog is sampled from
[MinJogOffset, MaxJogOffset). Because this bound is
exclusive, the largest offset the algorithm actually produces is
MaxJogOffset - 1. For example, MaxJogOffset = 4 allows offsets of
up to 3 cells. Must be > MinJogOffset.
MaxJogs
Maximum number of random waypoint jogs inserted per corridor segment.
Declaration
public readonly int MaxJogs
Field Value
| Type | Description |
|---|---|
| int |
Remarks
The actual number of jogs for a given corridor is chosen randomly from
[0, MaxJogs] (inclusive). A value of 0 produces straight
corridors identical to the L-shaped style. A value of 1 allows a single
bend mid-corridor. Values of 2-3 produce visibly winding paths.
Very high values can produce corridors that overlap themselves or adjacent rooms
on tightly packed layouts.
MinJogOffset
Minimum perpendicular offset applied at each jog, in cells (inclusive).
Declaration
public readonly int MinJogOffset
Field Value
| Type | Description |
|---|---|
| int |
Remarks
The jog offset is the number of cells the corridor shifts sideways from the
direct path at a waypoint. Negative values allow jogs in both perpendicular
directions relative to the corridor's primary travel direction, enabling S-shaped
curves. A value of 0 means the corridor can only jog in one direction.
Must be <= MaxJogOffset - 1.
Subtle
Subtle preset: at most 1 jog per corridor with a small perpendicular offset range [-2, 2]. Produces corridors with a slight curve that barely deviates from the direct path.
Declaration
public static readonly WindingCorridorSettings Subtle
Field Value
| Type | Description |
|---|---|
| WindingCorridorSettings |
Remarks
The exclusive upper bound is stored as 3, so the actual maximum offset
produced is 2 cells.
Methods
Lerp(WindingCorridorSettings, WindingCorridorSettings, float)
Linearly interpolates between two WindingCorridorSettings instances and returns a new blended settings struct.
Declaration
public static WindingCorridorSettings Lerp(WindingCorridorSettings a, WindingCorridorSettings b, float t)
Parameters
| Type | Name | Description |
|---|---|---|
| WindingCorridorSettings | a | Start settings returned when |
| WindingCorridorSettings | b | End settings returned when |
| float | t | Interpolation factor. Values outside [0, 1] are clamped before use. |
Returns
| Type | Description |
|---|---|
| WindingCorridorSettings | A new WindingCorridorSettings whose fields are linearly blended
between |
Remarks
All three integer fields (MaxJogs, MinJogOffset, MaxJogOffset) are interpolated as floats and rounded to the nearest integer.