Various projectile water splash problems

Issue #481 resolved
Matt Hands created an issue

Examples:

WaterVolumes (i.e. original class, not the new DH version) play a pretty big splash effect when a tiny, slow moving ejected shell bullet case hits the surface. This looks very wrong and makes it appear that the bullet hit effect is spawning in the wrong place.

DH_WaterVolumes don't play the ripple effect when a player moves through the water.

DH_WaterVolumes don't play splash effects for grenades, satchels or mortar shells that land in the water.

Note: The problem with unwanted big splashes from ejected cases happens because strangely they are ballistic projectile actors, so an actor is being spawned for every ejected case. Ramm made this comment & it's still valid, so a future TODO: "Refactor - lets use an emitter or something so this isn't so heavy. This spawns an actor every time you fire a weapon".

Comments (1)

  1. Matt Hands reporter

    Fixed in commit 7810635t.

    Made it so projectile splash effects look for any WaterVolume-based class as well as a PhysicsVolume with bWaterVolme=true. This is because the new DH_waterVolume does not have bWaterVolme=true, as it is mainly for shallow water & that avoids unwanted things like drowning, swimming, 'jump out of water', etc.

    Made DH_WaterVolume extend WaterVolume to facilitate this check (although all properties remain as before). Then removed splash effects from DH_WaterVolume class, as projectiles now handle it themselves, as intended, in CheckForSplash() function. Projectile classes can have more specific effects, which can be subclassed, and they have a corrected EffectIsRelevant() function to handle the effects properly.

    Removed short surface type trace from CheckForSplash(), which was to verify that water had been hit. Had to remove the trace as it will not hit a DH_WaterVolume & only works on PhysicsVolumes with bWaterVolme=true. Suspect CheckForSplash() was conceived as a more general function, but in reality it is only ever called from PhysicsVolumeChange() event, when projectile enters a water volume. So the surface type check isn't needed and always returns true anyway.

    Added location adjustment to splash effect's SpawnLocation in CheckForSplash(), as passed location is usually below water surface, so effect doesn't look quite right.

    All splash effects are subject to an EffectIsRelevant() check, as don't want to spawn visual effects if won't show on screen. All splash sounds are NOT under an EffectIsRelevant() check, as they must play even if effect to side of or behind the player. Splash sounds shouldn't be in an Emitter class, as spawning the emitter will usually be subject to EffectIsRelevant(), so sound may be wrongly skipped if effect isn't in front of player.

    Deleted class 'DHBulletSplashEffect' as was same as 'ROBulletHitWaterEffect' except for added splash sounds & a location offset on the water ring (both now redundant, as per above). Removed splash sounds & location offset on water ring from class 'DH_ExplosiveSplashEffect'. Renamed 'DH_ExplosiveSplashEffect' to 'DHShellSplashEffect', as is an effect for a shell splash generally & is mostly relevant to non-explosive shells, i.e. AP, so naming wasn't ideal. Used 'DHShellSplashEffect' in cannon shell & mortar shell projectile classes to replace RO class 'TankAPHitWaterEffect'.

    Most maps still use UT2004 WaterVolumes, not DH_waterVolumes, & the RO mods to that class (to add splash effects) cause problems and duplicate/conflict with projectile class splashes. So use DHGameReplicationInfo to nullify splash effects in WaterVolume classes at start of game. Stops tiny, slow moving ejected bullet cases from causing big water splashes (strangely, each ejected case is a projectile actor, so a future job is to make them an emitter).

    Made DHPawn.FootStepping() function also use any WaterVolume-based class, not just bWaterVolme=true, so player leaves ripples when walking through a DH_WaterVolume.

    Made it so mortar can't be deployed if player is in any WaterVolume-based class, not just a bWaterVolme=true. Note this volume-based functionality is only partly successful as player's centre must be inside the volume for it to work.

    Various projectile Velocity reductions when fired in or hitting water also updated to look for WaterVolume-based class as well as bWaterVolme=true.

    Added WaterHitSound to bullet class.

    Added PhysicsVolumeChange/CheckForSplash to mortar projectile, to get same splash effects as cannon shell.

    Added splash effects for thrown projectiles (grenades & satchels), with same effects as a bullet splash.

  2. Log in to comment