Bug 473

Summary: Multiplayer: Loading from saved session scrambles character ownership
Product: The Genesis Project Reporter: narniankartalion <narniankartalion>
Component: GeneralAssignee: MightyButtonMasher <Mightybuttonmasher>
Status: UNCONFIRMED ---    
Severity: normal CC: jean
Priority: Normal    
Version: 0.5.1-1   
Hardware: PC   
OS: Windows   
Discord Author: Discord Author ID:

Description narniankartalion@gmail.com 2023-08-30 19:29:14 CEST
Characters are assigned based on the order of players joining the lobby; so if player B joined the lobby first, they would be assigned the first character created, even if a different player (say player A) created that character. 

Example: 

* During session creation, Player A creates character Alice, then Player B creates character Bob, then Player C creates character Charlie.
* Character Alice is saved as 0.pls; character Bob is saved as 1.pls; character Charlie is saved as 2.pls
* When loading the session from save, Player A joins the lobby first (they have to host the lobby after all) and is assigned Alice
* If Player C joins the lobby second, they are assigned Bob, even though Bob belongs to someone else
* And when the game starts, Player C controls character Bob

Workaround: Have everyone join the lobby in the same order they created characters. 

Fix: I believe this is because the .pls files are assigned based purely on join order (the 1st person to join gets 0.pls, the 2nd person to join gets 1.pls); it may be better to include the players' Steam IDs somewhere, either in the filename or as an attribute.