Revert biome rework (#38724)
* Revert "Fix world generation (#38713)" This reverts commit10fa6ff4af. * Revert "Biome rework (#37735)" This reverts commitfe7b96147c.
This commit is contained in:
committed by
GitHub
parent
047a49a505
commit
e99fc501a6
@@ -1,12 +0,0 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Runs cables throughout the dungeon.
|
||||
/// </summary>
|
||||
public sealed partial class AutoCablingDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public EntProtoId Entity;
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Iterates room edges and places the relevant tiles and walls on any free indices.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Dungeon data keys are:
|
||||
/// - CornerWalls (Optional)
|
||||
/// - FallbackTile
|
||||
/// - Walls
|
||||
/// </remarks>
|
||||
public sealed partial class BoundaryWallDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField]
|
||||
public BoundaryWallFlags Flags = BoundaryWallFlags.Corridors | BoundaryWallFlags.Rooms;
|
||||
|
||||
[DataField(required: true)]
|
||||
public EntProtoId Wall;
|
||||
|
||||
[DataField]
|
||||
public EntProtoId? CornerWall;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum BoundaryWallFlags : byte
|
||||
{
|
||||
Rooms = 1 << 0,
|
||||
Corridors = 1 << 1,
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Spawns entities inside corners.
|
||||
/// </summary>
|
||||
public sealed partial class CornerClutterDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField]
|
||||
public float Chance = 0.50f;
|
||||
|
||||
[DataField(required:true)]
|
||||
public ProtoId<EntityTablePrototype> Contents = new();
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Adds entities randomly to the corridors.
|
||||
/// </summary>
|
||||
public sealed partial class CorridorClutterDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField]
|
||||
public float Chance = 0.05f;
|
||||
|
||||
/// <summary>
|
||||
/// The default starting bulbs
|
||||
/// </summary>
|
||||
[DataField(required: true)]
|
||||
public ProtoId<EntityTablePrototype> Contents;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Applies decal skirting to corridors.
|
||||
/// </summary>
|
||||
public sealed partial class CorridorDecalSkirtingDunGen : IDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Decal where 1 edge is found.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Dictionary<DirectionFlag, string> CardinalDecals = new();
|
||||
|
||||
/// <summary>
|
||||
/// Decal where 1 corner edge is found.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Dictionary<Direction, string> PocketDecals = new();
|
||||
|
||||
/// <summary>
|
||||
/// Decal where 2 or 3 edges are found.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Dictionary<DirectionFlag, string> CornerDecals = new();
|
||||
|
||||
/// <summary>
|
||||
/// Optional color to apply to the decals.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Color? Color;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Connects room entrances via corridor segments.
|
||||
/// </summary>
|
||||
public sealed partial class CorridorDunGen : IDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// How far we're allowed to generate a corridor before calling it.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Given the heavy weightings this needs to be fairly large for larger dungeons.
|
||||
/// </remarks>
|
||||
[DataField]
|
||||
public int PathLimit = 2048;
|
||||
|
||||
/// <summary>
|
||||
/// How wide to make the corridor.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float Width = 3f;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Selects [count] rooms and places external doors to them.
|
||||
/// </summary>
|
||||
public sealed partial class DungeonEntranceDunGen : IDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// How many rooms we place doors on.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int Count = 1;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<EntityTablePrototype> Contents;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Spawns entities on either side of an entrance.
|
||||
/// </summary>
|
||||
public sealed partial class EntranceFlankDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<EntityTablePrototype> Contents = new();
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// If external areas are found will try to generate windows.
|
||||
/// </summary>
|
||||
public sealed partial class ExternalWindowDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<EntityTablePrototype> Contents;
|
||||
}
|
||||
@@ -1,7 +1,4 @@
|
||||
using System.Numerics;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Procedural.Distance;
|
||||
using Robust.Shared.Noise;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.DungeonLayers;
|
||||
@@ -9,6 +6,10 @@ namespace Content.Shared.Procedural.DungeonLayers;
|
||||
/// <summary>
|
||||
/// Fills unreserved tiles with the specified entity prototype.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// DungeonData keys are:
|
||||
/// - Fill
|
||||
/// </remarks>
|
||||
public sealed partial class FillGridDunGen : IDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
@@ -19,29 +20,4 @@ public sealed partial class FillGridDunGen : IDunGenLayer
|
||||
|
||||
[DataField(required: true)]
|
||||
public EntProtoId Entity;
|
||||
|
||||
#region Noise
|
||||
|
||||
[DataField]
|
||||
public bool Invert;
|
||||
|
||||
/// <summary>
|
||||
/// Optionally don't spawn entities if the noise value matches.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public FastNoiseLite? ReservedNoise;
|
||||
|
||||
/// <summary>
|
||||
/// Noise threshold for <see cref="ReservedNoise"/>. Does nothing without it.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float Threshold = -1f;
|
||||
|
||||
[DataField]
|
||||
public IDunGenDistance? DistanceConfig;
|
||||
|
||||
[DataField]
|
||||
public Vector2 Size;
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// If internal areas are found will try to generate windows.
|
||||
/// </summary>
|
||||
public sealed partial class InternalWindowDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<EntityTablePrototype> Contents;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Places the specified entities at junction areas.
|
||||
/// </summary>
|
||||
public sealed partial class JunctionDunGen : IDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Width to check for junctions.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int Width = 3;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<EntityTablePrototype> Contents;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Places the specified entities on the middle connections between rooms
|
||||
/// </summary>
|
||||
public sealed partial class MiddleConnectionDunGen : IDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// How much overlap there needs to be between 2 rooms exactly.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int OverlapCount = -1;
|
||||
|
||||
/// <summary>
|
||||
/// How many connections to spawn between rooms.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int Count = 1;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<EntityTablePrototype> Contents;
|
||||
|
||||
[DataField]
|
||||
public ProtoId<EntityTablePrototype>? Flank;
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.DungeonLayers;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Spawns mobs inside of the dungeon randomly.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
using Robust.Shared.Noise;
|
||||
|
||||
namespace Content.Shared.Procedural.DungeonLayers;
|
||||
|
||||
/// <summary>
|
||||
/// Sets tiles as rooved.
|
||||
/// </summary>
|
||||
public sealed partial class RoofDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField]
|
||||
public float Threshold = -1f;
|
||||
|
||||
[DataField]
|
||||
public FastNoiseLite? Noise;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Places tiles / entities onto room entrances.
|
||||
/// </summary>
|
||||
public sealed partial class RoomEntranceDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
|
||||
[DataField]
|
||||
public ProtoId<EntityTablePrototype> Contents;
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using Content.Shared.Decals;
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Noise;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
|
||||
namespace Content.Shared.Procedural.DungeonLayers;
|
||||
|
||||
public sealed partial class SampleDecalDunGen : IDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Reserve any tiles we update.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool ReserveTiles = true;
|
||||
|
||||
[DataField(customTypeSerializer:typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
|
||||
public List<string> AllowedTiles { get; private set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Divide each tile up by this amount.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float Divisions = 1f;
|
||||
|
||||
[DataField]
|
||||
public FastNoiseLite Noise { get; private set; } = new(0);
|
||||
|
||||
[DataField]
|
||||
public float Threshold { get; private set; } = 0.8f;
|
||||
|
||||
[DataField] public bool Invert { get; private set; } = false;
|
||||
|
||||
[DataField(required: true)]
|
||||
public List<ProtoId<DecalPrototype>> Decals = new();
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Noise;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
|
||||
namespace Content.Shared.Procedural.DungeonLayers;
|
||||
|
||||
/// <summary>
|
||||
/// Samples noise to spawn the specified entity
|
||||
/// </summary>
|
||||
public sealed partial class SampleEntityDunGen : IDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Reserve any tiles we update.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool ReserveTiles = true;
|
||||
|
||||
[DataField(customTypeSerializer:typeof(PrototypeIdListSerializer<ContentTileDefinition>))]
|
||||
public List<string> AllowedTiles { get; private set; } = new();
|
||||
|
||||
[DataField] public FastNoiseLite Noise { get; private set; } = new(0);
|
||||
|
||||
[DataField]
|
||||
public float Threshold { get; private set; } = 0.5f;
|
||||
|
||||
[DataField] public bool Invert { get; private set; } = false;
|
||||
|
||||
[DataField]
|
||||
public List<EntProtoId> Entities = new();
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Noise;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Procedural.DungeonLayers;
|
||||
|
||||
/// <summary>
|
||||
/// Samples noise and spawns the specified tile in the dungeon area.
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed partial class SampleTileDunGen : IDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Reserve any tiles we update.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool ReserveTiles = true;
|
||||
|
||||
[DataField] public FastNoiseLite Noise { get; private set; } = new(0);
|
||||
|
||||
[DataField]
|
||||
public float Threshold { get; private set; } = 0.5f;
|
||||
|
||||
[DataField] public bool Invert { get; private set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Which tile variants to use for this layer. Uses all of the tile's variants if none specified
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public List<byte>? Variants = null;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile = string.Empty;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.DungeonLayers;
|
||||
|
||||
/// <summary>
|
||||
/// Connects dungeons via points that get subdivided.
|
||||
/// </summary>
|
||||
public sealed partial class SplineDungeonConnectorDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
|
||||
[DataField]
|
||||
public ProtoId<ContentTileDefinition>? WidenTile;
|
||||
|
||||
/// <summary>
|
||||
/// Will divide the distance between the start and end points so that no subdivision is more than these metres away.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int DivisionDistance = 20;
|
||||
|
||||
/// <summary>
|
||||
/// How much each subdivision can vary from the middle.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float VarianceMax = 0.15f;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using Content.Shared.EntityTable;
|
||||
using Content.Shared.Maps;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
/// <summary>
|
||||
/// Spawns on the boundary tiles of rooms.
|
||||
/// </summary>
|
||||
public sealed partial class WallMountDunGen : IDunGenLayer
|
||||
{
|
||||
/// <summary>
|
||||
/// Chance per free tile to spawn a wallmount.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public double Prob = 0.1;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<EntityTablePrototype> Contents;
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
using Content.Shared.Maps;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Procedural.PostGeneration;
|
||||
|
||||
// Ime a worm
|
||||
/// <summary>
|
||||
/// Generates worm corridors.
|
||||
/// </summary>
|
||||
public sealed partial class WormCorridorDunGen : IDunGenLayer
|
||||
{
|
||||
[DataField]
|
||||
public int PathLimit = 2048;
|
||||
|
||||
/// <summary>
|
||||
/// How many times to run the worm
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int Count = 20;
|
||||
|
||||
/// <summary>
|
||||
/// How long to make each worm
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public int Length = 20;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum amount the angle can change in a single step.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public Angle MaxAngleChange = Angle.FromDegrees(45);
|
||||
|
||||
/// <summary>
|
||||
/// How wide to make the corridor.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public float Width = 3f;
|
||||
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ContentTileDefinition> Tile;
|
||||
}
|
||||
Reference in New Issue
Block a user