mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-17 05:27:38 +03:00
# Description
This PR fixes all remaining bugs with Space Wind, while providing
extremely significant performance improvements by way of aggressive
early exits, and also completely reworking how pressure moved entities
are tracked(The server now caches entities under active air movements).
I haven't profiled it yet, but the performance improvements are
extremely noticeable on the machine I'm running in comparison to before,
which is particularly noteworthy since previous versions of space wind
caused significant frame drops in testing on my monster rig. While this
new update to space wind straight up doesn't even budge the tickrate on
my machine anymore.
I had to also rip out some of Monstermos' Guts, and deprecate the
tileripping system. In the future, Tile-ripping will be handled by MAS.
Also, MAS outright no longer requires Monstermos to work, and can
operate entirely off of the much cheaper LINDA system. However, while
LINDA is cheaper, Monstermos is needed for handling "Extra violent air".
Eventually I can do away with Monstermos entirely, and have it replaced
with an airflow system that outright does not require pathfinding
algorithms.
# Changelog
🆑
- fix: Fixed a bug where items thrown by space wind could remain in air
for as long as 500 seconds. Items thrown by space wind can now remain in
the air for a maximum of 2 seconds past the last time they were thrown.
- fix: DRAMATICALLY IMPROVED SPACE WIND PERFORMANCE.
- tweak: ShowAtmos command now shows vectors representing the exact
direction space wind at a given tile is trying to throw objects! The
length of the lines shown directly correspond to how powerful the flow
of air is at that tile. Shorter lines = shorter throws. Longer lines =
more powerful throws. These are also no longer restricted to compass
directions, and can point in arbitrarily any direction on a circle.
- tweak: Space Wind now no longer has Monstermos as a hard requirement.
It'll be as weak as a toddler without it, but if you're running your
server on a toaster, you can turn off Monstermos and still have working
space wind.
- tweak: Wreckages in space are now never airtight. I'm sorry, but this
was basically the cost I had to pay in exchange for making Atmos no
longer even on the top 20 systems for server tickrate cost.
(cherry picked from commit 2fcc806423a259fd75977b78350c2232a823739b)
129 lines
4.2 KiB
C#
129 lines
4.2 KiB
C#
using Content.Server.Atmos.EntitySystems;
|
|
using Content.Server.Atmos.Piping.Components;
|
|
using Content.Server.Atmos.Serialization;
|
|
using Content.Server.NodeContainer.NodeGroups;
|
|
|
|
namespace Content.Server.Atmos.Components
|
|
{
|
|
/// <summary>
|
|
/// Internal Atmos class. Use <see cref="AtmosphereSystem"/> to interact with atmos instead.
|
|
/// </summary>
|
|
[RegisterComponent, Serializable,
|
|
Access(typeof(AtmosphereSystem), typeof(GasTileOverlaySystem), typeof(AtmosDebugOverlaySystem))]
|
|
public sealed partial class GridAtmosphereComponent : Component
|
|
{
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
public bool Simulated { get; set; } = true;
|
|
|
|
[ViewVariables]
|
|
public bool ProcessingPaused { get; set; } = false;
|
|
|
|
[ViewVariables]
|
|
public float Timer { get; set; } = 0f;
|
|
|
|
[ViewVariables]
|
|
public int UpdateCounter { get; set; } = 1; // DO NOT SET TO ZERO BY DEFAULT! It will break roundstart atmos...
|
|
|
|
[ViewVariables]
|
|
[IncludeDataField(customTypeSerializer:typeof(TileAtmosCollectionSerializer))]
|
|
public Dictionary<Vector2i, TileAtmosphere> Tiles = new(1000);
|
|
|
|
[ViewVariables]
|
|
public HashSet<TileAtmosphere> MapTiles = new(1000);
|
|
|
|
[ViewVariables]
|
|
public readonly HashSet<TileAtmosphere> ActiveTiles = new(1000);
|
|
|
|
[ViewVariables]
|
|
public int ActiveTilesCount => ActiveTiles.Count;
|
|
|
|
[ViewVariables]
|
|
public readonly HashSet<ExcitedGroup> ExcitedGroups = new(1000);
|
|
|
|
[ViewVariables]
|
|
public int ExcitedGroupCount => ExcitedGroups.Count;
|
|
|
|
[ViewVariables]
|
|
public readonly HashSet<TileAtmosphere> HotspotTiles = new(1000);
|
|
|
|
[ViewVariables]
|
|
public int HotspotTilesCount => HotspotTiles.Count;
|
|
|
|
[ViewVariables]
|
|
public readonly HashSet<TileAtmosphere> SuperconductivityTiles = new(1000);
|
|
|
|
[ViewVariables]
|
|
public int SuperconductivityTilesCount => SuperconductivityTiles.Count;
|
|
|
|
[ViewVariables]
|
|
public HashSet<TileAtmosphere> HighPressureDelta = new(1000);
|
|
|
|
[ViewVariables]
|
|
public int HighPressureDeltaCount => HighPressureDelta.Count;
|
|
|
|
[ViewVariables]
|
|
public readonly HashSet<IPipeNet> PipeNets = new();
|
|
|
|
[ViewVariables]
|
|
public readonly HashSet<Entity<AtmosDeviceComponent>> AtmosDevices = new();
|
|
|
|
[ViewVariables]
|
|
public readonly Queue<TileAtmosphere> CurrentRunTiles = new();
|
|
|
|
[ViewVariables]
|
|
public readonly Queue<ExcitedGroup> CurrentRunExcitedGroups = new();
|
|
|
|
[ViewVariables]
|
|
public readonly Queue<IPipeNet> CurrentRunPipeNet = new();
|
|
|
|
[ViewVariables]
|
|
public readonly Queue<Entity<AtmosDeviceComponent>> CurrentRunAtmosDevices = new();
|
|
|
|
[ViewVariables]
|
|
public readonly HashSet<Vector2i> InvalidatedCoords = new(1000);
|
|
|
|
[ViewVariables]
|
|
public readonly Queue<TileAtmosphere> CurrentRunInvalidatedTiles = new();
|
|
|
|
[ViewVariables]
|
|
public readonly List<TileAtmosphere> PossiblyDisconnectedTiles = new(100);
|
|
|
|
[ViewVariables]
|
|
public int InvalidatedCoordsCount => InvalidatedCoords.Count;
|
|
|
|
[ViewVariables]
|
|
public long EqualizationQueueCycleControl { get; set; }
|
|
|
|
[ViewVariables]
|
|
public AtmosphereProcessingState State { get; set; } = AtmosphereProcessingState.Revalidate;
|
|
|
|
[DataField]
|
|
public bool SpaceWindSimulation = true;
|
|
|
|
/// <summary>
|
|
/// Used to calculate the exits for Space Wind. If pressure is below this number, or is within +- this value above its default starting pressure,
|
|
/// then no calculation for space wind is performed.
|
|
/// </summary>
|
|
[DataField]
|
|
public float PressureCutoff = 5f;
|
|
|
|
[DataField]
|
|
public string SpaceWindSound { get; private set; } = "/Audio/Effects/space_wind.ogg";
|
|
|
|
[DataField]
|
|
public int SpaceWindSoundCooldown;
|
|
|
|
[DataField]
|
|
public int SpaceWindSoundCooldownCycles = 75;
|
|
|
|
[DataField]
|
|
public float SpaceWindSoundDenominator = 0.1f;
|
|
|
|
[DataField]
|
|
public float SpaceWindSoundMinVolume = 10f;
|
|
|
|
[DataField]
|
|
public float SpaceWindSoundMaxVolume = 100f;
|
|
}
|
|
}
|