Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task done
Fayti1703 opened this issue Jul 7, 2024 · 0 comments
Open
1 task done
Labels
help wanted something you can help with usability ux/devx problem z-project: engine something in the engine itself

Comments

@Fayti1703
Copy link
Owner

Fayti1703 commented Jul 7, 2024

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.

@Fayti1703 Fayti1703 added usability ux/devx problem z-project: engine something in the engine itself help wanted something you can help with labels Jul 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted something you can help with usability ux/devx problem z-project: engine something in the engine itself
Projects
None yet
Development

No branches or pull requests

1 participant