Skip to content

Parallel Battlescape desync with Counter-Terrorist Operations and XComFiles #178

Description

@xcomcoopdev

We encountered co-op synchronization problems in two separate tests using different mods:

  1. Counter-Terrorist Operations v1.1
  2. XComFiles v3.9.1

Environment

  • Windows 64-bit
  • Nightly 2.0.31 (cbff795)
  • OXCE version: 8.4.2
  • Co-op mode: PvE
  • Battlescape turn mode: Parallel
  • Shared campaign: disabled
  • Custom battle

Counter-Terrorist Operations test

  • Active mod: Counter-Terrorist Operations
  • Mod ID: CTO
  • Version: 1.1
  • Master: xcom1
  • Desync report: desync-20260831-142338.zip

The first mismatch appears at the start-of-side synchronization boundary in the saveBlob bucket:

[COOP] SYNC-CHECK MISMATCH seq=1 (boundary)
kind=sidestart
bucket=saveBlob

Later, a mismatch also appears in the unitsCombat bucket. The mismatch remains visible during subsequent soldier movement and walk-related synchronization checks.

XComFiles test

  • Active mod: XComFiles
  • Mod ID: xcom1
  • Version: v3.9.1
  • Desync report: desync-20260831-152828.zip

Immediately before the first mismatch, the log reports unsupported script RNG use:

coop: mod script called randomRange during a co-op battle.
Script RNG is UNSUPPORTED in co-op: each machine draws from its own
stream and the result is not replicated, so anything it decides can
differ between the two players (turn 1).

This is followed by mismatches in the items and saveBlob buckets:

[COOP] SYNC-CHECK MISMATCH seq=1 (boundary)
kind=sidestart
bucket=items
host=3968615542812609006
peer=8839461385161901697

[COOP] SYNC-CHECK MISMATCH seq=1 (boundary)
kind=sidestart
bucket=saveBlob
host=13392003787454007015
peer=16318660022920312040

Observed behavior

  • Counter-Terrorist Operations first diverged in the saveBlob bucket and later in unitsCombat.
  • XComFiles logged an unsupported randomRange script call immediately before the initial items and saveBlob mismatches.
  • After the battle state had diverged, later synchronization checks continued to detect the mismatch during soldier movement.
  • During soldier movement, the message CO-OP DESYNC DETECTED - SEE openxcom.log appeared repeatedly. It was shown almost every time a soldier was moved, which became disruptive and negatively affected the gameplay experience :/

Expected behavior

  • Parallel Battlescape should remain synchronized between the host and peer.
  • Mod scripts should not use independent, unreplicated RNG streams during co-op battles.
  • Script RNG warnings should ideally identify the responsible script, script hook, and ruleset file.

Development

Regarding the mod script RNG synchronization issue, I assume work on this has not started yet. I can start working on it, unless @NonPolynomialTim is already working on it :)

I am not yet sure what is causing the desync with the Counter-Terrorist Operations mod. During the next test session, I can investigate it more closely at the code level and try to identify the exact point where the desync starts.

Attachments

desync-20260831-142338.zip — Counter-Terrorist Operations v1.1

desync-20260831-152828.zip — XComFiles v3.9.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions