Bug 473 - Multiplayer: Loading from saved session scrambles character ownership
Summary: Multiplayer: Loading from saved session scrambles character ownership
Status: UNCONFIRMED
Alias: None
Product: The Genesis Project
Classification: Unclassified
Component: General (show other bugs)
Version: 0.5.1-1
Hardware: PC Windows
: Normal normal
Assignee: MightyButtonMasher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-30 19:29 CEST by narniankartalion@gmail.com
Modified: 2023-08-30 19:29 CEST (History)
1 user (show)

See Also:
Discord Author:
Discord Author ID:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.