Coder Social home page Coder Social logo

Comments (9)

khimaros avatar khimaros commented on May 18, 2024 1

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.

from codewords.

MirSob avatar MirSob commented on May 18, 2024 1

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.

from codewords.

jporter-dev avatar jporter-dev commented on May 18, 2024

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.

from codewords.

jporter-dev avatar jporter-dev commented on May 18, 2024

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

from codewords.

serknor avatar serknor commented on May 18, 2024

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.

from codewords.

jporter-dev avatar jporter-dev commented on May 18, 2024

@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.

from codewords.

serknor avatar serknor commented on May 18, 2024

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.

from codewords.

jporter-dev avatar jporter-dev commented on May 18, 2024

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?

from codewords.

serknor avatar serknor commented on May 18, 2024

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.

from codewords.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.