Fix CommonSense meditation desync: host-authoritative sync#562
Open
sviyh wants to merge 1 commit intorwmt:masterfrom
Open
Fix CommonSense meditation desync: host-authoritative sync#562sviyh wants to merge 1 commit intorwmt:masterfrom
sviyh wants to merge 1 commit intorwmt:masterfrom
Conversation
Instead of disabling the meditation economy feature entirely in MP, replace it with a host-authoritative version. The host evaluates the joy/psyfocus thresholds and syncs the EndJobWith decision to all clients via RegisterSyncMethod, ensuring deterministic execution. The original postfix checked joy.CurLevel >= 0.98f directly on each client, but floating point drift caused divergent job endings that cascaded into full desyncs through PickUpAndHaul job creation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d0c9195 to
fa43e72
Compare
Member
|
Some issues:
|
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.
Summary
JobDriver_MeditationTick_CommonSensePatchpostfix evaluatingjoy.CurLevel >= 0.98fdifferently on host vs client due to floating point driftEndJobWithdecision to all clients viaRegisterSyncMethodJobDriver_Meditate.MeditationTickruns only on the hostRoot cause
Observed in desync log (map 19): CommonSense ended a reign/meditation job on the host (joy hit 0.98), triggering PickUpAndHaul's
CheckIfPawnShouldUnloadInventorywhich created a new job and consumed extra RNG state. The client's joy was slightly below threshold, so the job continued — permanent RNG divergence from that tick forward.Test plan
🤖 Generated with Claude Code