Struct RoomGroup
Describes a group of rooms that share the same size constraints for placement into a maze-based map. A RoomGroup specifies how many rooms to attempt to place and the minimum/maximum dimensions those rooms may have.
Inherited Members
Namespace: Scylla.Core.Util.ProceduralMapGen
Assembly: ScyllaCore.dll
Syntax
public readonly struct RoomGroup
Remarks
Multiple RoomGroup instances can be supplied to RoomGroups to produce levels that mix different room archetypes - for example two large boss chambers combined with six small storage rooms. All groups share the same overlap-checking list so rooms from different groups never overlap regardless of their sizes.
Placement is attempted up to MaxPlacementAttempts times per room. Groups are processed in array order; earlier groups claim their positions first, which may reduce available space for later groups.
Constructors
RoomGroup(int, int, int, int, int)
Initializes a new RoomGroup with fully explicit parameters.
Declaration
public RoomGroup(int count, int minWidth, int minHeight, int maxWidth, int maxHeight)
Parameters
| Type | Name | Description |
|---|---|---|
| int | count | Number of rooms to attempt to place from this group. Must be greater than zero. |
| int | minWidth | Minimum room width in cells. Must be at least |
| int | minHeight | Minimum room height in cells. Must be at least |
| int | maxWidth | Maximum room width in cells. Must be greater than or equal to
|
| int | maxHeight | Maximum room height in cells. Must be greater than or equal to
|
Fields
Count
The number of rooms to attempt to place from this group. The algorithm tries each
room up to MaxPlacementAttempts times; rooms that
cannot be placed without overlap are skipped. The actual number of rooms placed
may therefore be less than Count.
Declaration
public readonly int Count
Field Value
| Type | Description |
|---|---|
| int |
MaxHeight
The maximum height in cells that a room from this group may have. Must be greater than or equal to MinHeight. For square rooms set this equal to MinHeight.
Declaration
public readonly int MaxHeight
Field Value
| Type | Description |
|---|---|
| int |
MaxWidth
The maximum width in cells that a room from this group may have. Must be greater than or equal to MinWidth. For square rooms set this equal to MinWidth.
Declaration
public readonly int MaxWidth
Field Value
| Type | Description |
|---|---|
| int |
MinHeight
The minimum height in cells that a room from this group may have. Must be at
least 1 and no greater than MaxHeight. The actual height
is chosen uniformly in [MinHeight, MaxHeight].
Declaration
public readonly int MinHeight
Field Value
| Type | Description |
|---|---|
| int |
MinWidth
The minimum width in cells that a room from this group may have. Must be at least
1 and no greater than MaxWidth. The actual width is chosen
uniformly in [MinWidth, MaxWidth].
Declaration
public readonly int MinWidth
Field Value
| Type | Description |
|---|---|
| int |
Methods
Lerp(RoomGroup, RoomGroup, float)
Linearly interpolates between two RoomGroup instances and returns the blended result.
Declaration
public static RoomGroup Lerp(RoomGroup a, RoomGroup b, float t)
Parameters
| Type | Name | Description |
|---|---|---|
| RoomGroup | a | The start group returned when |
| RoomGroup | b | The end group returned when |
| float | t | Interpolation factor in the range |
Returns
| Type | Description |
|---|---|
| RoomGroup | A new RoomGroup whose fields are blended between
|
Remarks
All integer fields (Count, MinWidth,
MinHeight, MaxWidth, MaxHeight) are
interpolated and rounded to the nearest integer. t is clamped
to [0, 1] before any calculation.