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

Enhancement: Players can select teams & roles #44

Open
whois-jon-peterson opened this issue Jul 25, 2019 · 2 comments · May be fixed by #51
Open

Enhancement: Players can select teams & roles #44

whois-jon-peterson opened this issue Jul 25, 2019 · 2 comments · May be fixed by #51
Assignees
Labels
enhancement New feature or request Server Issues and PRs relating to the server application

Comments

@whois-jon-peterson
Copy link
Member

No description provided.

@whois-jon-peterson whois-jon-peterson added enhancement New feature or request Server Issues and PRs relating to the server application labels Jul 25, 2019
@whois-jon-peterson
Copy link
Member Author

whois-jon-peterson commented Aug 9, 2019

Proposed gameplay flow:
At any time after entering the lobby, a user may make a selection through the UI which would send a websocket message to the server like

cable.perform('select_team', payload)
// where payload is an object like
{
  team: "red" // "red" || "blue"
}

or

cable.perform('select_role', payload)
// where payload is an object like
{
  role: "spy" // "spy" || "intel"
}

Keeping these as distinct actions allows for users to assign themselves to a team without selecting a particular role, or to select a role without caring which team they're on.

If that team/role is available, the server would set it for the given Player and respond with a broadcast to all players indicating the updated info. (The player-joined message would also need to be updated to include the extra team/role metadata.)

{
  type: "player-update",
  data: {
    id: 0,
    name: "name",
    isBlueTeam: true, // boolean or null
    isIntel: true, // boolean or null
    playerRoster: [
      {
        id: 0,
        name: "name",
        isBlueTeam: true,
        isIntel: true
      },
      ...
    ]
  }
}

All selections would need to be made before starting the game. This would also mean that we'd want to postpone "establishing" the game and sending the game-setup message until all players have had a chance to make selections. @SiimonStark suggested having a countdown timer in the UI once all players have joined, which I think is a good idea.

Once the timer hits zero, the UI can send a separate message to request that the game start, at which point the server would run the appropriate logic to assign any players who had not selected their roles. This would be followed by the game-start broadcast, and then play would continue as usual.

Requesting feedback from @code-words/back-end @code-words/front-end on this, as it is a significant change to how the game setup flow works.

@rdren0
Copy link
Contributor

rdren0 commented Aug 10, 2019

I think this is an excellent idea

@whois-jon-peterson whois-jon-peterson self-assigned this Aug 12, 2019
@whois-jon-peterson whois-jon-peterson linked a pull request Aug 12, 2019 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Server Issues and PRs relating to the server application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants