Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Lock “reveal” once spymaster is chosen #11

Open
natelapp opened this issue Apr 1, 2018 · 9 comments
Open

Lock “reveal” once spymaster is chosen #11

natelapp opened this issue Apr 1, 2018 · 9 comments
Assignees
Labels
enhancement javascript Pull requests that update Javascript code python Pull requests that update Python code

Comments

@natelapp
Copy link

natelapp commented Apr 1, 2018

Once someone has clicked “reveal” as the spymaster, no one else should be able to reveal the map

@jporter-dev
Copy link
Owner

Thanks for the suggestion! I'll have to think about this one some more. I get the reasoning, but there's also usually two spymasters, so perhaps locking it to two could work? Other edge cases include refreshing the page/exiting and rejoining the game. I currently don't track connected clients, so I think having a mechanism to do that and use that for tracking the current "spymasters" could work.

@jporter-dev
Copy link
Owner

Revisiting this as it's been requested by other users, plus with the game being played virtually it would make sense to have something for tracking spymasters.

My initial idea: generate client_ids on each connected client prior to joining the room (or on connect, could assign it server-side). Pass client_id with all requests, and add a channel/method for toggling spymaster. Pass a message on the toggle_spymaster channel when entering/leaving the spymaster view. On message, call Game.Info#toggle_spymaster which adds/removes the client_id from a spymasters dict/list. Add spymasters to to_json.

Client-side, I envision a "spymaster count" badge on the spymaster button to show how many active spymasters there are. Also would add an additional layer of "are you sure?" buttons before switching if spymasters.count > 2. Prefer not to fully "lock" the view just in case something errors and we lose track.

Additional possibilities with this method of client_id tracking:

  • Verify user is a spymaster before flipping card (on the fence about letting agents flip cards too)
  • Allow users to enter names for identification and add ability to show a player list
  • Add chat-like features for sending hints virtually

@jporter-dev jporter-dev added javascript Pull requests that update Javascript code python Pull requests that update Python code labels Apr 7, 2020
@jporter-dev jporter-dev self-assigned this Apr 7, 2020
@jporter-dev jporter-dev added this to To do in Codewords.tv v2.0 Apr 7, 2020
@khimaros
Copy link

khimaros commented Apr 7, 2020

Another possibility would be similar to http://syeedibnfaiz.com/codenames/

Generate a unique code for the spymaster link and only provide that link to other spymasters. Everyone else gets the non-spymaster link.

The caveat is that the spymaster links are not one-time-use, so you need to at least trust the other spymasters not to give the link to their team mates.

@jporter-dev jporter-dev moved this from To do to In progress in Codewords.tv v2.0 Apr 7, 2020
@jporter-dev jporter-dev moved this from In progress to To do in Codewords.tv v2.0 Apr 7, 2020
@MirSob
Copy link

MirSob commented Apr 14, 2020

I've discovered simple solution. After game is regenerate button is clicked set all player into Agent mode and reset global Spymaster counter. Display this counter on bottom row. After any one goes to Spymaster mode increment counter. Every one will know about number of SpyMasters in game.

@jporter-dev jporter-dev moved this from To do to In progress in Codewords.tv v2.0 Apr 15, 2020
@serknor
Copy link

serknor commented May 12, 2020

My suggestions for solving this:

  1. Advanced option for setting the max amount of spymasters possible in the game. For example, if I set that option to "2", when that number is reached, nobody can turn itself to spymaster.
    1a) If the spymaster disconnects by error, he can re-join, since the spymaster count is at "1".
    1b) If the spymaster has to leave the game, he can disconnect, the spymaster count is at "1" and another player of his team can be the spymaster.
    If the option is turned off, there's no limit to the amount of spymasters.
  2. Advanced option "spymasters can't become agents again in the same game". If a user goes into spymaster mode, I don't see any reason for him to go back to agent mode in the same game, since he already knows all the answers. If he went by mistake, they should create a new game anyway.

@jporter-dev
Copy link
Owner

@serknor - I think this is a viable strategy. When new games are created, the spymasters are reset to agents so new games should work fine in that sense. I can implement this soon, I just wanted to ensure that the spymaster toggling was working well before locking user out of it just in case.

Thoughts on using the # of teams as the spymaster count? There should only be one spymaster per team so it seems fine to me.

@serknor
Copy link

serknor commented May 12, 2020

Regarding the last sentence. Since I noticed you where taking a cautious approach to modifications, I thought that an option to set the limit manually would be less strict than having the site define it.
For example, if someone is learning how to play, you will have: 1 spymaster for team red, 1 spymaster for team blue and 1 person that is just watching how to play as a spymaster (without actually playing).
BUT the cases where this will happen are really exceptional AND they can also be solved by just having the toggle say: "Limit 1 spymaster per team: Yes / No". If for any reason they need more than 1 spymaster per team, they can disable that option.
Your approach is cleaner and makes the options easier to understand.

@jporter-dev
Copy link
Owner

That's a fair point - there are so many different situations that arise in this game that I never even think about, such as having a "spectator" watching the spymaster view.

Perhaps a solution that allows the user to input the # of spymasters, but it will default to the # of teams and will be hidden behind the "advanced options" section?

@serknor
Copy link

serknor commented May 12, 2020

As you prefer.
For me, since having more than 1 spymaster per team is an exception to the rule, just having a toggle in the advanced options "Limit 1 spymaster per team: On / Off" is enough, without making it complicated.
99% of the time people will play with this option turned on. If someone wants to have a spectator, or want to play with 2 spymaster per team, etc, they turn that option off.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement javascript Pull requests that update Javascript code python Pull requests that update Python code
Projects
Codewords.tv v2.0
  
In progress
Development

No branches or pull requests

5 participants