Repository navigation
Store multiplayer campaign variables when the campaign moves on - #7892
Open
dustinspace217 wants to merge 1 commit into
Open
dustinspace217 wants to merge 1 commit into
dustinspace217 wants to merge 1 commit into
Conversation
Since campaign-persistent variables were split from goals and events (only stored when a mission is accepted), the multiplayer paths no longer matched single player: a player-hosted game never stored them, so they reset every mission, and a standalone stored them as soon as the mission ended, so a replayed or retried mission kept its changes. Store variables and containers in multi_campaign_do_debrief when the players continue to a different mission or take a loop, which both kinds of server go through, and have the standalone's postgame store only goals and events, like debrief_init does for a player host. Fixes scp-fs2open#4989
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.
Fixes #4989
What?
Multiplayer campaigns now save their campaign variables and containers the way single player does: when the players continue to the next mission or take an optional loop, and not when they replay a mission or the campaign sends them back to retry it.
Why?
Two things were wrong, depending on how the game is hosted:
Both go back to the 2014 change that made single player save these only on accept. The multiplayer paths weren't updated to match.
How?
multi_campaign_do_debriefis where both kinds of server go when everyone continues, so the save moved there. It's skipped when the next mission is the same one (a campaign-forced retry), unless the host picked an optional loop back to that mission, which single player also saves for. The standalone's post-game step now saves only goals and events, likedebrief_initalready does for a player host.Testing?
Linux Debug builds, master against this branch, in a private loopback match with retail data and a small three-mission coop test campaign. At the start of each mission an event sets a corvette's hull from the server's variable and list container, so every player can read what the server started with. On both a player host and a standalone:
The one-player cases ran two or three times each; the two-player and loop cases once or twice. Not covered: eternal variables, red-alert missions in multiplayer, Windows and macOS.
Anything Else?
Two things this doesn't change:
Written with Claude Code; the investigation and testing ran on my machine.