Explosion SFX juicing + higher persistence (#22544)
This commit is contained in:
@@ -19,11 +19,6 @@ public sealed class ExplosionOverlaySystem : EntitySystem
|
||||
[Dependency] private readonly IOverlayManager _overlayMan = default!;
|
||||
[Dependency] private readonly SharedPointLightSystem _lights = default!;
|
||||
|
||||
/// <summary>
|
||||
/// For how many seconds should an explosion stay on-screen once it has finished expanding?
|
||||
/// </summary>
|
||||
public float ExplosionPersistence = 0.3f;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
@@ -63,7 +63,7 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
/// </summary>
|
||||
public const ushort DefaultTileSize = 1;
|
||||
|
||||
private AudioParams _audioParams = AudioParams.Default.WithVolume(-3f);
|
||||
public const int MaxExplosionAudioRange = 30;
|
||||
|
||||
/// <summary>
|
||||
/// The "default" explosion prototype.
|
||||
@@ -328,15 +328,33 @@ public sealed partial class ExplosionSystem : EntitySystem
|
||||
var visualEnt = CreateExplosionVisualEntity(epicenter, type.ID, spaceMatrix, spaceData, gridData.Values, iterationIntensity);
|
||||
|
||||
// camera shake
|
||||
CameraShake(iterationIntensity.Count * 2.5f, epicenter, totalIntensity);
|
||||
CameraShake(iterationIntensity.Count * 4f, epicenter, totalIntensity);
|
||||
|
||||
//For whatever bloody reason, sound system requires ENTITY coordinates.
|
||||
var mapEntityCoords = EntityCoordinates.FromMap(EntityManager, _mapManager.GetMapEntityId(epicenter.MapId), epicenter);
|
||||
|
||||
// play sound.
|
||||
var audioRange = iterationIntensity.Count * 5;
|
||||
// for the normal audio, we want everyone in pvs range
|
||||
// + if the bomb is big enough, people outside of it too
|
||||
// this is capped to 30 because otherwise really huge bombs
|
||||
// will attempt to play regular audio for people who can't hear it anyway because the epicenter is so far away
|
||||
var audioRange = Math.Min(iterationIntensity.Count * 2, MaxExplosionAudioRange);
|
||||
var filter = Filter.Pvs(epicenter).AddInRange(epicenter, audioRange);
|
||||
_audio.PlayStatic(type.Sound.GetSound(), filter, mapEntityCoords, true, _audioParams);
|
||||
var sound = iterationIntensity.Count < type.SmallSoundIterationThreshold
|
||||
? type.SmallSound
|
||||
: type.Sound;
|
||||
|
||||
_audio.PlayStatic(sound, filter, mapEntityCoords, true, sound.Params);
|
||||
|
||||
// play far sound
|
||||
// far sound should play for anyone who wasn't in range of any of the effects of the bomb
|
||||
var farAudioRange = iterationIntensity.Count * 5;
|
||||
var farFilter = Filter.Empty().AddInRange(epicenter, farAudioRange).RemoveInRange(epicenter, audioRange);
|
||||
var farSound = iterationIntensity.Count < type.SmallSoundIterationThreshold
|
||||
? type.SmallSoundFar
|
||||
: type.SoundFar;
|
||||
|
||||
_audio.PlayGlobal(farSound, farFilter, true, farSound.Params);
|
||||
|
||||
return new Explosion(this,
|
||||
type,
|
||||
|
||||
@@ -127,7 +127,7 @@ public sealed partial class AnomalyComponent : Component
|
||||
/// The sound plays when an anomaly goes supercritical
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public SoundSpecifier? SupercriticalSound = new SoundCollectionSpecifier("explosion");
|
||||
public SoundSpecifier? SupercriticalSound = new SoundCollectionSpecifier("Explosion");
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -846,7 +846,7 @@ namespace Content.Shared.CCVar
|
||||
/// This determines for how many seconds an explosion should stay visible once it has finished expanding.
|
||||
/// </summary>
|
||||
public static readonly CVarDef<float> ExplosionPersistence =
|
||||
CVarDef.Create("explosion.persistence", 0.3f, CVar.SERVERONLY);
|
||||
CVarDef.Create("explosion.persistence", 1.0f, CVar.SERVERONLY);
|
||||
|
||||
/// <summary>
|
||||
/// If an explosion covers a larger area than this number, the damaging/processing will always start during
|
||||
|
||||
@@ -62,8 +62,26 @@ public sealed partial class ExplosionPrototype : IPrototype
|
||||
[DataField("fireColor")]
|
||||
public Color? FireColor;
|
||||
|
||||
[DataField("Sound")]
|
||||
public SoundSpecifier Sound = new SoundCollectionSpecifier("explosion");
|
||||
/// <summary>
|
||||
/// If an explosion finishes in less than this many iterations, play a small sound instead.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This value is tuned such that a minibomb is considered small, but just about anything larger is normal
|
||||
/// </remarks>
|
||||
[DataField("smallSoundIterationThreshold")]
|
||||
public int SmallSoundIterationThreshold = 6;
|
||||
|
||||
[DataField("sound")]
|
||||
public SoundSpecifier Sound = new SoundCollectionSpecifier("Explosion");
|
||||
|
||||
[DataField("smallSound")]
|
||||
public SoundSpecifier SmallSound = new SoundCollectionSpecifier("ExplosionSmall");
|
||||
|
||||
[DataField("soundFar")]
|
||||
public SoundSpecifier SoundFar = new SoundCollectionSpecifier("ExplosionFar", AudioParams.Default.WithVolume(2f));
|
||||
|
||||
[DataField("smallSoundFar")]
|
||||
public SoundSpecifier SmallSoundFar = new SoundCollectionSpecifier("ExplosionSmallFar", AudioParams.Default.WithVolume(2f));
|
||||
|
||||
[DataField("texturePath")]
|
||||
public ResPath TexturePath = new("/Textures/Effects/fire.rsi");
|
||||
|
||||
@@ -71,7 +71,7 @@ public sealed partial class LightBulbComponent : Component
|
||||
/// </summary>
|
||||
[DataField("breakSound")]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public SoundSpecifier BreakSound = new SoundCollectionSpecifier("GlassBreak");
|
||||
public SoundSpecifier BreakSound = new SoundCollectionSpecifier("GlassBreak", AudioParams.Default.WithVolume(-6f));
|
||||
|
||||
#region Appearance
|
||||
|
||||
|
||||
@@ -171,3 +171,8 @@
|
||||
copyright: '"jumps from reason.3.Rev.wav" by martian of Freesound.org. Modified by reversing and altering volume.'
|
||||
license: CC0-1.0
|
||||
source: https://freesound.org/people/martian/sounds/19261/
|
||||
|
||||
- files: ["explosion_small1.ogg", "explosion_small2.ogg", "explosion_small3.ogg", "explosion1.ogg", "explosion2.ogg", "explosion3.ogg", "explosion4.ogg", "explosion5.ogg", "explosion6.ogg", "explosionfar.ogg", "explosionsmallfar.ogg"]
|
||||
copyright: "vgstation at c5edbfd7179288080f081e2b8ac2496b7e4455db"
|
||||
license: CC-BY-SA-3.0
|
||||
source: https://github.com/vgstation-coders/vgstation13/tree/c5edbfd7179288080f081e2b8ac2496b7e4455db/sound/effects
|
||||
|
||||
BIN
Resources/Audio/Effects/explosion_small1.ogg
Normal file
BIN
Resources/Audio/Effects/explosion_small1.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Effects/explosion_small2.ogg
Normal file
BIN
Resources/Audio/Effects/explosion_small2.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Effects/explosion_small3.ogg
Normal file
BIN
Resources/Audio/Effects/explosion_small3.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Effects/explosionfar.ogg
Normal file
BIN
Resources/Audio/Effects/explosionfar.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Effects/explosionsmallfar.ogg
Normal file
BIN
Resources/Audio/Effects/explosionsmallfar.ogg
Normal file
Binary file not shown.
Binary file not shown.
@@ -149,7 +149,8 @@
|
||||
damage: 300
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
sound: /Audio/Effects/metalbreak.ogg
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
- !type:EmptyContainersBehaviour
|
||||
containers:
|
||||
- borg_brain
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -8
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
FoodPlateTrash:
|
||||
@@ -84,6 +86,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -8
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
FoodPlateSmallTrash:
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -8
|
||||
- !type:SpillBehavior { }
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -4
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
ShardGlass:
|
||||
@@ -157,6 +159,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -4
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
ShardGlassReinforced:
|
||||
@@ -231,6 +235,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -4
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
ShardGlassPlasma:
|
||||
@@ -357,6 +363,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -4
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
ShardGlassUranium:
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -4
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
ShardGlass:
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
thresholds:
|
||||
- trigger:
|
||||
!type:DamageTrigger
|
||||
damage: 40
|
||||
damage: 30
|
||||
behaviors:
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Destruction" ]
|
||||
@@ -33,7 +33,10 @@
|
||||
damage: 20
|
||||
behaviors:
|
||||
- !type:PlaySoundBehavior
|
||||
sound: /Audio/Effects/metalbreak.ogg
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -8
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Destruction" ]
|
||||
- type: DamageOnLand
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -8
|
||||
- !type:DoActsBehavior
|
||||
acts: [ "Breakage" ]
|
||||
- trigger:
|
||||
@@ -48,6 +50,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -8
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
ShardGlass:
|
||||
|
||||
@@ -79,6 +79,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -4
|
||||
- !type:SpillBehavior { }
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
|
||||
@@ -62,6 +62,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -4
|
||||
- !type:SpillBehavior
|
||||
solution: beaker
|
||||
- !type:SpawnEntitiesBehavior
|
||||
|
||||
@@ -93,6 +93,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
collection: GlassBreak
|
||||
params:
|
||||
volume: -4
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
PartRodMetal1:
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
PartRodMetal1:
|
||||
@@ -140,6 +142,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
@@ -179,6 +183,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
@@ -215,6 +221,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
@@ -601,6 +609,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
|
||||
@@ -91,6 +91,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -8
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
GasPipeBroken:
|
||||
|
||||
@@ -56,6 +56,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
|
||||
@@ -75,6 +75,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
@@ -148,6 +150,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
@@ -254,6 +258,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
|
||||
@@ -103,6 +103,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -4
|
||||
|
||||
- type: entity
|
||||
id: AirAlarmAssembly
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -4
|
||||
placement:
|
||||
mode: SnapgridCenter
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -4
|
||||
placement:
|
||||
mode: SnapgridCenter
|
||||
snap:
|
||||
|
||||
@@ -82,6 +82,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -4
|
||||
- type: GenericVisualizer
|
||||
visuals:
|
||||
enum.PowerDeviceVisuals.Powered:
|
||||
|
||||
@@ -64,6 +64,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -8
|
||||
placement:
|
||||
mode: SnapgridCenter
|
||||
snap:
|
||||
|
||||
@@ -92,6 +92,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -8
|
||||
|
||||
- type: entity
|
||||
id: ApcNetSwitch
|
||||
|
||||
@@ -44,6 +44,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
PartRodMetal1:
|
||||
@@ -111,6 +113,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
PartRodMetal1:
|
||||
@@ -169,6 +173,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
PartRodMetal1:
|
||||
@@ -242,6 +248,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -6
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
PartRodMetal1:
|
||||
|
||||
@@ -720,8 +720,6 @@
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
- !type:DoActsBehavior
|
||||
acts: ["Destruction"]
|
||||
destroySound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
- type: Construction
|
||||
graph: Girder
|
||||
node: diagonalshuttleWall
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
- !type:PlaySoundBehavior
|
||||
sound:
|
||||
path: /Audio/Effects/metalbreak.ogg
|
||||
params:
|
||||
volume: -4
|
||||
- !type:SpawnEntitiesBehavior
|
||||
spawn:
|
||||
SheetSteel1:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- type: soundCollection
|
||||
id: explosion
|
||||
id: Explosion
|
||||
files:
|
||||
- /Audio/Effects/explosion1.ogg
|
||||
- /Audio/Effects/explosion2.ogg
|
||||
@@ -7,3 +7,20 @@
|
||||
- /Audio/Effects/explosion4.ogg
|
||||
- /Audio/Effects/explosion5.ogg
|
||||
- /Audio/Effects/explosion6.ogg
|
||||
|
||||
- type: soundCollection
|
||||
id: ExplosionSmall
|
||||
files:
|
||||
- /Audio/Effects/explosion_small1.ogg
|
||||
- /Audio/Effects/explosion_small2.ogg
|
||||
- /Audio/Effects/explosion_small3.ogg
|
||||
|
||||
- type: soundCollection
|
||||
id: ExplosionFar
|
||||
files:
|
||||
- /Audio/Effects/explosionfar.ogg
|
||||
|
||||
- type: soundCollection
|
||||
id: ExplosionSmallFar
|
||||
files:
|
||||
- /Audio/Effects/explosionsmallfar.ogg
|
||||
|
||||
Reference in New Issue
Block a user