SirPlease / L4D2-Competitive-Rework

Just refreshing and optimizing the core files a bit, eh?
GNU General Public License v3.0
242 stars 131 forks source link

Custom scoring almost certain to be broken for finales post-update #101

Closed Icy-Inferno closed 3 years ago

Icy-Inferno commented 3 years ago

There was a change to the game's code to now count incapacitated survivors inside of a rescue vehicle as alive. (This doesn't currently seem to be the case on Parish finale for some reason). This is problematic for custom scoring in that we only ever treat upright survivors as alive for the purpose of determining how many times vs_survival_bonus will be multiplied by the game. To fix this, it would be necessary to determine if an incapacitated survivor is inside of/on a rescue vehicle (again, except for Parish finale as that currently seems to still exhibit the old behavior).

https://github.com/SirPlease/L4D2-Competitive-Rework/blob/master/addons/sourcemod/scripting/l4d2_hybrid_scoremod.sp#L525-L541

https://github.com/SirPlease/L4D2-Competitive-Rework/blob/master/addons/sourcemod/scripting/l4d2_hybrid_scoremod_zone.sp#L535-L551

https://github.com/SirPlease/L4D2-Competitive-Rework/blob/master/addons/sourcemod/scripting/l4d2_scoremod.sp#L373-L409

EDIT: The game event "finale_vehicle_leaving" possesses parameter "survivorcount".

From modevents.res:

"finale_vehicle_leaving"
{
    "survivorcount" "short" // number of survivors that made it out
}

Assuming this event fires at the correct time (it had better, considering scoremod.sp has always used it as a time to change the "vs_survival_bonus" cvar before scores get written), it should be possible to make use of this.

Icy-Inferno commented 3 years ago

Off-topic/out of scope for this issue, but I just noticed that l4d2_scoremod.sp doesn't explicitly handle ledge hangs, unlike l4d2_hybrid_scoremod.sp and l4d2_hybrid_scoremod_zone.sp. Hopefully this is just because netprop "m_isIncapacitated" on CTerrorPlayer is 1 whether ledge hanging or incapacitated?

I notice the latter two plugins use "m_isHangingFromLedge" and "m_isFallingFromLedge" netprops to handle ledge hangs, but I have to question how this could have possibly been broken in l4d2_scoremod.sp this entire time. EDIT: Turns out it was broken, but only very slightly. Confirmed via VScript that "m_isIncapacitated" is 1 when hanging from a ledge but NOT when falling from a ledge. Very niche case so I'm not surprised it's never come up. You'd have to be ledge falling exactly when the value for the "vs_survival_bonus" cvar is being determined.

ProdigySim commented 3 years ago

This is also affecting other maps. It looks like incapped survivors within safe area contribute to the survival bonus in normal maps as well.

20200926163521_1

We got a game on zonemod last night where we had 2 alive survivors, and 1 incapped survivor, in end saferoom.

!health read 60 bonus, but we ended up with 3 x 30 points at the round end.

ProdigySim commented 3 years ago

Looks like, in spite of my screenshot above, the behavior is actually still just inconsistent. Had some games where incapped survivors count. Lame!

SirPlease commented 3 years ago

Had this earlier, it's still behaving as before (not tested on finales) in Zonemod and EQ's hybrid bonus scoring. It doesn't count the incapped survivors in the Saferoom.

SirPlease commented 3 years ago

We're fine.