Skip to content

Adding/removing players from an active GameContext is unnecessarily complicated #25

@Fayti1703

Description

@Fayti1703

Currently, one needs to create a saved GameState, then modify that state's player list (by creating a new list as well as a new state, since everything is readonly/immutable), and then rehydrate that state into a GameContext just to mutate the player list.

Possible Solutions

  • An API that allows players to be added/removed from the GameContext dynamically
    • e.g. instance void AddPlayer(PlayerRole, PlayerActor)/instance void DropPlayer(PlayerID)

To Investigate

  • Does the in-game engine recycle IDs? e.g. 16 people on one side, one gets breached out/leaves, another tries to join
    • Yes, and you don't even need 16 people on one side: if e.g. a0 gets breached out, the next person to join becomes a0. (at least, in "game is empty" scenarios, needs some testing for when a1 still exists)

Additional Notes

We shouldn't worry about the case of "a player leaves, then comes back" -- in-game doesn't allow this. If you're dropped from the game, you're out of that game.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions