Open Iridar opened 3 weeks ago
Hmm....this seems to be handled by OnDeath in XGUnit -
SurvivingUnit = GetSquad().GetNextGoodMember();
kIsRobotic = IsRobotic();
if (SurvivingUnit != none && !kIsRobotic && !IsAlien_CheckByCharType())
SurvivingUnit.UnitSpeak( 'SquadMemberDead' );
OK So I did a bit of logging on this and there are actually a few different things going on. A lot of the speech lines are fired from X2Action_ApplyWeaponDamageToUnit (I logged mainly ShowDamageMessage and ShowCritMessage ) - only the DeathScream and SquadMemberDeath lines are run through the OnDeath function in XGUnit. It should be noted that both the 'taking damage' and 'critically wounded' voicelines are actual speech ("My blood spills" as a skirmisher example). DeathScream is obviously just the "Aaaarrgggghh" noise.
Basically, from logging, the following things happen:
Unit is killed by enemy / put in bleeding out status (no crit) [0204.82] BDLOG: Playing Taking Damage Voiceline (From ApplyWeaponDamageToUnit) [0204.82] BDLOG: Playing DeathScream speechline (From XGUnit) [0204.82] BDLOG: Playing SquadMemberDead Speechline (From XGUnit)
Multiple units hit by a grenade: (Every unit fires their taking damage voiceline at once) [0261.22] BDLOG: Playing Taking Damage Voiceline [0261.22] BDLOG: Playing Taking Damage Voiceline [0261.22] BDLOG: Playing Taking Damage Voiceline [0261.22] BDLOG: Playing Taking Damage Voiceline
Unit killed / made to bleed out by enemy (Crit) [0443.20] BDLOG: Playing Critically Wounded Voiceline [0443.21] BDLOG: Playing DeathScream speechline [0443.21] BDLOG: Playing SquadMemberDead Speechline
5/6 Squadmembers obliterated by suicidal SPARK blaster bomb: [1198.21] BDLOG: Playing Taking Damage Voiceline [1198.21] BDLOG: Playing DeathScream speechline [1198.21] BDLOG: Playing SquadMemberDead Speechline [1198.21] BDLOG: Playing Taking Damage Voiceline [1198.22] BDLOG: Playing DeathScream speechline [1198.22] BDLOG: Playing SquadMemberDead Speechline [1198.22] BDLOG: Playing Critically Wounded Voiceline [1198.22] BDLOG: Playing DeathScream speechline [1198.22] BDLOG: Playing SquadMemberDead Speechline [1198.23] BDLOG: Playing Critically Wounded Voiceline [1198.23] BDLOG: Playing DeathScream speechline [1198.23] BDLOG: Playing SquadMemberDead Speechline [1198.24] BDLOG: Playing Critically Wounded Voiceline [1198.24] BDLOG: Playing DeathScream speechline [1198.24] BDLOG: Playing SquadMemberDead Speechline [1198.25] BDLOG: Playing Taking Damage Voiceline [1198.25] BDLOG: Playing DeathScream speechline [1198.25] BDLOG: Playing SquadMemberDead Speechline
So firstly, there are no real guardrails in place inside ShowDamageMessage / ShowCritMessage in X2Action_ApplyWeaponDamageToUnit to prevent the Taking Damage / Critically Wounded voicelines from playing if the damage killed the unit - personally I think adding that check alone would improve the experience quite a bit (I'd say the unit being unable to speak after just being blasted to pieces by advent is a reasonable adjustment to make).
Even if we did that, if multiple units were killed, you'd still get multiple SquadMemberDead speechlines being played as well so some measure of preventing those for multi-unit-kills would probably be welcome (A single squadmember lamenting their fallen comrades would be ample from my perspective but that's open to a bit of interpretation). Perhaps we could set a unitvalue that prevents the squadmemberdead line from playing more than once per turn or something like that.
I don't think removing any deathscream lines is a good idea, generally.
Lastly, every time a unit is hit, it plays the 'taking damage' voiceline for each unit - this in its-self makes getting hit by grenades or multi-target abilities quite screamy most of the time - I'm divided over whether we ought to change this - it's certainly loud and a bit annoying but it might sound a little 'flat' if a grenade gets chucked into the middle of a cluster of units and one dude shouts "ow my eyes" or something.
So yeah, there are 3 areas we can target for a fix - open to discussion on which (if any) we'd like to address.
When a squadmate dies or is knocked into a bleedout, their squadmates will play overlapping voicelines about that, which can get pretty loud and cacophonic.