Skip to main content

RoomFixPlugin

A class in Root.Township, Alta.Caves.

Cave generation plugin that lines the cave up so its biggest room sits behind the entrance, places the exit near the second biggest room, and shapes the hole between cave layers.

Constructors​

MemberWhat it is
RoomFixPlugin()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

MemberWhat it is
const float PositionOffsetDistance (15) used to pull the cave back from the entrance and push the exit out.
12 private and internal fields
MemberWhat it is
private float floorHeightHeight of the floor in the room the passage starts from (7.5 by default).
private float layerHeightUnitsHeight drop between one cave layer and the next (15 by default).
private AnimationCurve progressLerpValueCurve along the passage scaling how strongly it carves.
private AnimationCurve solidFloorEndCurve along the passage for the top of the solid floor band.
private AnimationCurve solidFloorStartCurve along the passage for the bottom of the solid floor band.
private AnimationCurve solidRoofEndCurve along the passage for the top of the roof band.
private AnimationCurve solidRoofStartCurve along the passage for the bottom of the roof band.
private float stepDepthHorizontal length of one step in the passage between layers.
private int stepsNumber of steps in the passage. With stepDepth it sets how far the next layer is offset.
private RoomFixPlugin.Tunnel[] tunnelsTunnel definitions. Not read anywhere else in this build.
private AnimationCurve widthCurve along the passage giving its half width.
private AnimationCurve widthLerpValueCurve across the passage width scaling how strongly it carves towards the edges.

Properties​

MemberWhat it is
float FloorHeight { get; }Floor height within a layer, probably.
float LayerHeightUnits { get; }Height of one cave layer.
AnimationCurve ProgressLerpValue { get; }Blend curve along the passage, used by the roof hole part.
AnimationCurve SolidFloorEnd { get; }Curve for where the solid floor ends.
AnimationCurve SolidFloorStart { get; }Curve for where the solid floor starts, used by the roof hole part.
AnimationCurve SolidRoofEnd { get; }Curve for where the solid roof ends.
AnimationCurve SolidRoofStart { get; }Curve for where the solid roof starts.
float StepDepth { get; }Depth of each step.
int Steps { get; }Number of steps from the entrance into the cave.
RoomFixPlugin.Tunnel[] Tunnels { get; }Extra tunnel shapes to carve.
AnimationCurve Width { get; }Width curve of the passage.
AnimationCurve WidthLerpValue { get; }Blend curve across the width, used by the roof hole part.

Methods​

MemberWhat it is
override PluginInstance GetInstance(IGenerator generator)Creates the plugin's working instance for a generator.
override IEnumerator Render(MapChunk chunk, PluginInstance pluginInstance)Moves the cave into place behind the entrance and tells the layer streamer where the exit is.

Used in​

Members of other types that take, return or hold a RoomFixPlugin: