Multiplayer campaigns: clients never get campaign-persistent variable values
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- game-dev, networking
Direzione di ricerca
Start at send_variable_update_packet and the Campaign.persistent_variables mission-loading path, then trace multi_campaign_send_start during mission startup. Reproduce with two missions whose save-on-mission-progress variable changes from 0 to 7 and is read through mn.SEXPVariables["pv"].Value in mission 2. Done means every client receives the server’s carried persistent-variable values before client-side mission content is evaluated.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
In a multiplayer campaign, players other than the server never get the values of campaign-persistent ("save on mission progress") variables. The server starts each mission with the carried values, but every client starts with the defaults from the mission file. Anything the server evaluates is fine; anything a client evaluates on its own, like briefing text or messages that show a variable, or a client-side script, sees the wrong value.
Each client parses the mission itself and fills in persistent variables from its own Campaign.persistent_variables, which only the server ever updates. Nothing sends the carried values over afterwards: send_variable_update_packet only goes out when a variable is modified, and only for network variables.
Steps to reproduce
- Make a multiplayer coop campaign of two missions that both declare a number variable
pvas save-on-mission-progress, default 0. - In mission 1, set
pvto 7 (an event is fine), then end the mission. - Host it on a standalone server with two players and continue to mission 2.
- In mission 2's briefing, read
pvon a player's machine (for examplemn.SEXPVariables["pv"].Valuein Lua), and compare it with the server's value (for example an event that sets a ship's hull frompv, which every player can see).
Master at 12a36dc1a, Linux Debug build, retail data: the server starts mission 2 with pv = 7, while the player's own copy reads 0.
Expected vs. actual behavior
Expected: every player's copy of a campaign-persistent variable matches the server's at the start of each mission.
Actual: only the server has the carried value; every other player has the mission file's default.
Proposed fixes
Ranked by simplicity, then maintainability, then thoroughness.
- After the server loads a campaign mission, send a variable update for each persistent variable whose value differs from the default. Reuses the existing update packet; it needs to go out for persistent variables, not only network ones.
- Send the campaign's persistent variables and containers to clients with the rest of the campaign data (alongside
multi_campaign_send_start), so each client's own mission parse fills them in the same way the server's does. - Treat the server as the source of truth for all variable and container state at mission start and sync it in full, which would also cover containers and any other place a client and server can drift.
Found while working on #4989, which makes player-hosted games carry these values on the server too, so this gap now shows up there as well.
- Lingua principale
- C++
- Stelle
- 488
- Fork
- 184
- Merge medio
- 2g 9h
- PR unite (30g)
- 40
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di scp-fs2open/fs2open.github.com
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
scp-fs2open/fs2open.github.com#7918 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scp-fs2open/fs2open.github.com#7917 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scp-fs2open/fs2open.github.com#7916 ·
I maintainer di solito rispondono entro 1 giorno
-
P2: A timed rotation maneuver does nothing on a ship that had an earlier timed lateral maneuverForse già presa @vovosta l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
scp-fs2open/fs2open.github.com#7914 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scp-fs2open/fs2open.github.com#7901 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di scp-fs2open/fs2open.github.com
Issue simili
-
(S1 - Need confirmation)
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CleverRaven/Cataclysm-DDA#89212 ·
I maintainer di solito rispondono entro 1 giorno
-
Status: Needs confirmation Status: Needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
ai_p2 comp-dictionary
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ClickHouse/ClickHouse#127261 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NVIDIA-Omniverse/usd-brep#23 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
qbittorrent/qBittorrent#25121 ·
I maintainer di solito rispondono entro 2 giorni