Repository navigation
fix(coop): show a joining Separate player the difficulty screen only when a difficulty has its own starting base - #240
Merged
Conversation
…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
enabled auto-merge (squash)
November 9, 2026 16:30
auto-merge was automatically disabled
November 9, 2026 18:01
Pull request was closed
NonPolynomialTim
enabled auto-merge (squash)
November 9, 2026 18:01
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
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/xcom2got it. X-Com Files is a master mod (isMaster: true, idx-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
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.pynow checks for the new condition.test_separate_campaign_lobby_factionswith the real 40K + ROSIGMA mods: passes.tools/cilints: 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.