fix(fake-death): fix client death-restart sync (stuck Game Over, stale corpse, blocked doors)#44
Closed
lisniuse wants to merge 1 commit into
Closed
fix(fake-death): fix client death-restart sync (stuck Game Over, stale corpse, blocked doors)#44lisniuse wants to merge 1 commit into
lisniuse wants to merge 1 commit into
Conversation
…e corpse, doors) When all players are downed and the host restarts the run, the client could get stuck on Game Over (no respawn/heal, occasional Null access .curCine crash); after restart the host kept seeing the client as a corpse with interactions (exit doors) blocked. - LevelSync: guard TryTriggerLevelGraphReload / TryTriggerBossRuneReload with ShouldSuppressClientLevelReload() so the host's restart-level graph cannot fire an in-place reloadAfterBossRuneModif that pre-empts the queued full launchGame restart while the client is downed / restart pending. - GameMenu: add a client-restart-pending flag (set when QueueClientRestartFromHostSeed queues, cleared on MarkInRun) covering the window where _localFakeDead is already cleared but the new run has not started. - FakeDeath: ResetDownedPlayersForRestart now broadcasts the not-downed state (sendNetworkUpState: true) so the peer clears stale remote-downed tracking (corpse pinning + interaction gating). Source-level equivalent of the deployed binary patches (see patches/PATCHES.md). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In co-op, when both players go down and the host restarts the run (all-players-downed), the client could end up:
Null access .curCine.Reproduction
Root cause
1. In-place level reload pre-empts the full restart (stuck Game Over / crash).
On the all-downed restart the host broadcasts a new run seed + the new level graph. On the client:
QueueClientRestartFromHostSeed→ a queued fulllaunchGamerestart;TryTriggerLevelGraphReload→ an in-placereloadAfterBossRuneModif, which runs first and reloads the old run in place, swallowing the full restart. The client is left in the old run at 1 HP with Game Over; a badcurCinestate can crash withNull access .curCine.2. Revived state never broadcast (stale corpse + blocked doors).
ResetDownedPlayersForRestartcalledResetFakeDeathState(sendNetworkUpState: false), so the restarting client never told the peer it was no longer downed. The host's_remoteDowned[client]stayed set, soReceiveGhostCoordspinned the client ghost at the corpse position andLevelExitSyncgated its interactions.Fix
TryTriggerLevelGraphReload/TryTriggerBossRuneReloadwithShouldSuppressClientLevelReload()— skip the in-place reload while the local player is downed or a full restart is pending, so the queuedlaunchGamerestart wins. Map consistency is unaffected (still synced viagenerateGraph+TryApplyRemoteLevelGraph).QueueClientRestartFromHostSeedqueues, cleared onMarkInRun) to cover the window where_localFakeDeadis already cleared but the new run hasn't started yet.ResetDownedPlayersForRestartnow broadcasts the not-downed state (sendNetworkUpState: true) so the peer clears stale remote-downed tracking.Notes
🤖 Generated with Claude Code