Skip to content

Fix classic co-op auto-shot death animation ordering - #186

Open
xcomcoopdev wants to merge 2 commits into
mainfrom
fix/classic-coop-autoshot-death-animation
Open

xcomcoopdev wants to merge 2 commits into
mainfrom
fix/classic-coop-autoshot-death-animation

Conversation

@xcomcoopdev

Copy link
Copy Markdown
Collaborator

Summary

Fixes a classic-turn co-op regression where the client could fire the remaining rounds of an auto shot before displaying the target unit's collapse animation.

The client could consequently show later rounds hitting a unit that had already fallen on the host, then change the target directly from standing to dead after the burst.

Cause

The receive-order barrier treated the classic unit_death packet as unable to overtake its pending hit_unit opener. Both packets could remain behind the active projectile gate while the subject-less hasHitUnit packet was still allowed through.

This released ExplosionBState and allowed ProjectileFlyBState to create the next round before the client had queued its authoritative UnitDieBState.

In addition, allowing after_unit_death through as a chain closer could apply the final dead status before the queued client death animation started. UnitDieBState would then see an already-out unit and skip its collapse frames.

Changes

  • Keep the opener-order barrier restricted to parallel turns, preserving the original classic packet-closing behavior.
  • Allow classic unit_death to queue the authoritative client UnitDieBState while the shot is waiting.
  • Stop treating classic after_unit_death as a gate-bypassing chain closer, so it cannot apply the final dead status ahead of the collapse animation.
  • Keep unit_death releasing the parked explosion immediately after the death state has been queued.
  • Expose fallPhase through the test harness battle state for animation-order assertions.
  • Add a classic co-op auto-shot regression test using a rifle with finite ammunition.

The parallel unit_casualty and death-ghost paths are unchanged.

Testing

Added:

python tools/coop_test/test_classic_autoshot_death_pacing.py

The test stages a deterministic lethal first round in a three-round auto shot and verifies that the client enters intermediate collapse frames while two rounds still remain.

RED result without the fix:

[FAIL] client displayed no intermediate UnitDieBState collapse frame: [(0, 0, 19), (0, 0, 18), (0, 0, 17), (6, 0, 17)]

GREEN result with the fix:

PASS: Classic client collapsed the victim before consuming the remaining auto-shot rounds (ammo 20 -> 19 during collapse -> 17).

The corrected behavior was also verified manually in classic turns.

…it_death to queue the client UnitDieBState before the

subject-less auto-shot release advances the next projectile.

Keep after_unit_death behind the normal receive gate so its final dead
status cannot skip the queued collapse animation. Restrict the newer
opener-order barrier to parallel turns, whose unit_casualty and death-ghost
paths remain unchanged.

Add a harness regression test that verifies the client starts collapsing
after the lethal round and before the remaining auto-shot rounds consume
their ammunition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant