Explosion refactor TEST MERG (#6995)

* Explosions

* fix yaml typo

and prevent silly UI inputs

* oop

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
This commit is contained in:
Moony
2022-03-04 13:48:01 -06:00
committed by GitHub
parent 4e203f49d2
commit 4a466f4927
71 changed files with 3958 additions and 760 deletions

View File

@@ -348,6 +348,85 @@ namespace Content.Shared.CCVar
public static readonly CVarDef<bool> AdminAnnounceLogout =
CVarDef.Create("admin.announce_logout", true, CVar.SERVERONLY);
/*
* Explosions
*/
/// <summary>
/// How many tiles the explosion system will process per tick
/// </summary>
/// <remarks>
/// Setting this too high will put a large load on a single tick. Setting this too low will lead to
/// unnaturally "slow" explosions.
/// </remarks>
public static readonly CVarDef<int> ExplosionTilesPerTick =
CVarDef.Create("explosion.tilespertick", 100, CVar.SERVERONLY);
/// <summary>
/// Upper limit on the size of an explosion before physics-throwing is disabled.
/// </summary>
/// <remarks>
/// Large nukes tend to generate a lot of shrapnel that flies through space. This can functionally cripple
/// the server TPS for a while after an explosion (or even during, if the explosion is processed
/// incrementally.
/// </remarks>
public static readonly CVarDef<int> ExplosionThrowLimit =
CVarDef.Create("explosion.throwlimit", 400, CVar.SERVERONLY);
/// <summary>
/// If this is true, explosion processing will pause the NodeGroupSystem to pause updating.
/// </summary>
/// <remarks>
/// This only takes effect if an explosion needs more than one tick to process (i.e., covers more than <see
/// cref="ExplosionTilesPerTick"/> tiles). If this is not enabled, the node-system will rebuild its graph
/// every tick as the explosion shreds the station, causing significant slowdown.
/// </remarks>
public static readonly CVarDef<bool> ExplosionSleepNodeSys =
CVarDef.Create("explosion.nodesleep", true, CVar.SERVERONLY);
/// <summary>
/// Upper limit on the total area that an explosion can affect before the neighbor-finding algorithm just
/// stops. Defaults to a 60-rile radius explosion.
/// </summary>
/// <remarks>
/// Actual area may be larger, as it currently doesn't terminate mid neighbor finding. I.e., area may be that of a ~51 tile radius circle instead.
/// </remarks>
public static readonly CVarDef<int> ExplosionMaxArea =
CVarDef.Create("explosion.maxarea", (int) 3.14f * 50 * 50, CVar.SERVERONLY);
/// <summary>
/// Upper limit on the number of neighbor finding steps for the explosion system neighbor-finding algorithm.
/// </summary>
/// <remarks>
/// Effectively places an upper limit on the range that any explosion can have. In the vast majority of
/// instances, <see cref="ExplosionMaxArea"/> will likely be hit before this becomes a limiting factor.
/// </remarks>
public static readonly CVarDef<int> ExplosionMaxIterations =
CVarDef.Create("explosion.maxiterations", 150, CVar.SERVERONLY);
/// <summary>
/// Max Time in milliseconds to spend processing explosions every tick.
/// </summary>
/// <remarks>
/// This time limiting is not perfectly implemented. Firstly, a significant chunk of processing time happens
/// due to queued entity deletions, which happen outside of the system update code. Secondly, explosion
/// spawning cannot currently be interrupted & resumed, and may lead to exceeding this time limit.
/// </remarks>
public static readonly CVarDef<float> ExplosionMaxProcessingTime =
CVarDef.Create("explosion.maxtime", 7f, CVar.SERVERONLY);
/// <summary>
/// If the explosion is being processed incrementally over several ticks, this variable determines whether
/// updating the grid tiles should be done incrementally at the end of every tick, or only once the explosion has finished processing.
/// </summary>
/// <remarks>
/// The most notable consequence of this change is that explosions will only punch a hole in the station &
/// create a vacumm once they have finished exploding. So airlocks will no longer slam shut as the explosion
/// expands, just suddenly at the end.
/// </remarks>
public static readonly CVarDef<bool> ExplosionIncrementalTileBreaking =
CVarDef.Create("explosion.incrementaltile", false, CVar.SERVERONLY);
/*
* Admin logs
*/