Skip to content

fix(coop): show a joining Separate player the difficulty screen only when a difficulty has its own starting base - #240

Merged
NonPolynomialTim merged 1 commit into
mainfrom
fix/separate-client-faction-pick
Nov 9, 2026
Merged

NonPolynomialTim merged 1 commit into
mainfrom
fix/separate-client-faction-pick

Conversation

@NonPolynomialTim

Copy link
Copy Markdown
Collaborator

Problem

A player reported that in a new SEPARATE campaign the joining player gets a second "Select difficulty level" screen while the host places its base. The game chose that screen by the master mod's id: any master other than xcom1 / xcom2 got it. X-Com Files is a master mod (isMaster: true, id x-com-files), so its players got a screen meant for 40K / ROSIGMA faction choice.

Reproduced on b13b27538 (Nightly 2.0.70) with X-Com Files 3.9 and 4.2. Vanilla does not show it.

Fix

Decide from the loaded rules instead of the master's id. Mod::hasDifficultyStartingBases() reports whether any of the engine's per-difficulty starting-base keys (startingBaseBeginner ... startingBaseSuperhuman) is defined. 40K defines four of them and uses the difficulty screen as a faction screen, so 40K / ROSIGMA players still choose their own faction. Every other campaign, X-Com Files included, starts the joining player on the host's difficulty with no extra screen.

Tests

  • New test_separate_client_difficulty_choice.py, with two small test mods:
    • Coop_MasterOneBase_Test: a master mod with one starting base, like X-Com Files. The joining player must never open the difficulty screen. Before the fix: opened 1 time and the campaign never started. After: 0 times, and the campaign started.
    • Coop_FactionBases_Test: gives Veteran its own starting base. The joining player must choose. Before: 0 times. After: 1 time, and the campaign started.
  • test_separate_campaign_client_faction_contract.py now checks for the new condition.
  • Local runs on the fix:
    • X-Com Files 3.9 SEPARATE bring-up: both players reach the geoscape.
    • test_separate_campaign_lobby_factions with the real 40K + ROSIGMA mods: passes.
    • Vanilla SEPARATE bring-up: passes.
    • All four tools/ci lints: pass.

Not in this change

The same report says the joining player then stays on "Waiting for all players to place their bases...". That did not reproduce in 9 local runs: X-Com Files 3.9 and 4.2, either player placing first, a slow joining player, UDP, and different difficulties. In every run the wait ended about a second after the host pressed BEGIN.

…when a difficulty has its own starting base

A new SEPARATE campaign showed the joining player a second difficulty screen
whenever the active master mod was not xcom1 or xcom2. X-Com Files is a master
mod, so its players got that screen while the host placed its base, and the
joining player started on a difficulty of its own.

Decide from the loaded rules instead. Mods such as 40K give a difficulty level
its own starting base (startingBaseBeginner ... startingBaseSuperhuman) and use
the difficulty screen to pick a faction, so each player still chooses there.
Every other campaign, X-Com Files included, starts the joining player on the
host's difficulty with no extra screen.

test_separate_client_difficulty_choice boots one pair per test mod: a master
mod with one starting base (the joining player never sees the screen) and a
mod that gives Veteran its own starting base (the joining player chooses).
@NonPolynomialTim
NonPolynomialTim enabled auto-merge (squash) November 9, 2026 16:30
auto-merge was automatically disabled November 9, 2026 18:01

Pull request was closed

@NonPolynomialTim
NonPolynomialTim enabled auto-merge (squash) November 9, 2026 18:01
@NonPolynomialTim
NonPolynomialTim merged commit a04a9f3 into main Nov 9, 2026
10 checks passed
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