Giter Club home page Giter Club logo

secret-hitler-online's Introduction

Secret-Hitler-Online

A fan-made web adaptation of Secret Hitler, a social deduction board game for up to 10 players by Goat, Wolf & Cabbage. You can play it with friends at secret-hitler.online!

The Game

In the game, players are divided into Liberals, Fascists, and one secret Hitler. The Liberals must work together (or not) to discover the secret Hitler hiding in their midst, all while the Fascists try to elevate the secret Hitler to power. Pass policies to achieve victory and unlock presidential powers to investigate your friends.

Can you find and stop the Secret Hitler?

How to Play:

Go to secret-hitler.online and open a new lobby! Use the lobby's code or the provided link to invite your friends. You can play with up to 10 players at once!

There are instructions on how to play the game provided on the website, and plenty of helpful tips are provided for first-time players. The game takes care of rules for you, making it easy to pick up and play.

For more information, read the official rulebook here.

About this project

Technical Details

The Java server is divided into the game simulation and the REST API. Communication between the server and client is done via websocket and HTTP requests, using the Javalin library.

The webpage is written in React, and features animations created with CSS. Assets were either adapted from the original board game or created using Inkscape.

Creative Commons License and Credit

Secret Hitler Online is licensed under Creative Commons BY-NC-SA 4.0, and is adapted from the original board game released by Goat, Wolf & Cabbage (© 2016-2020).

(This project is not affiliated with or endorsed by Goat, Wolf & Cabbage.)

What's changed from the original?

  • Artwork for the boards, policy deck, identity cards, party cards, and liberal/fascist icons were adapted for the website with some minor modifications (rounding corners, adding depth, shadows).
  • Custom assets (made in Inkscape) were added based on the style of the original, most notably for the election tracker, policy reveal popup windows, and the player icons and tiles.
  • Where possible, fonts were replaced with ones licensed under the Open Font License, namely Germania One and Montserrat.
  • The web interface, animations, and server are new additions that use the same rules from the original game.

Report problems or suggest features on the Issues page.

secret-hitler-online's People

Contributors

dependabot[bot] avatar etse avatar shrimpcryptid avatar sticks-stuff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

secret-hitler-online's Issues

Auto-end term timer

Hi,
could the "End Term" button be removed?
It doesn't really have a function, so we think the game would be more smooth if it just would continue without
waiting to press "End Term".
We often have to remind players to press "End Term" and we would sometimes feel a bit annoyed to keep reminding each other to press "End Term" :)

Event History

Not so much a bug, more of a suggestion, why not add a history of who placed what on the board and a way to input people's claims onto the history board? This would allow people to keep track of the game as it goes and this would be togglable.

Donation?

Sorry, I didn’t know where else to put this. Could I make a donation to your project? I just really appreciate you making this for everyone and would love to buy you a cup of coffee!

I’m playing this with a large group of friends on Wednesday and am so excited.

Reduce logging

Reduce frequency of logging for production server to minimize chance of an out-of-memory error.

Should use some Java logging library and filter by log level.

Call Special Election

Hi there! We played with a large group tonight and it worked so incredibly well. That was so much fun! We noticed a small thing with the Call Special Election presidential power. The current president was able to choose themselves as the president, but in the rules it says that the president chooses any other player, specifically. Here's the official rule.

Call Special Election
The President chooses any other
player at the table to be the next
Presidential Candidate by passing
that player the President placard.
Any player can become President—even
players that are term-limited. The
new President nominates an eligible
player as Chancellor Candidate and
the Election proceeds as usual.

Seriously thank you SO MUCH for creating such a polished version of the game online. Everyone was so surprised and impressed by the quality.

Execution results don't disappear

President in our game reported being unable to close the execution results.
If a player attempts to leave during/after the execution results, they are locked in the lobby with 0 players and unable to return back to the main game. Is the server not sending packets to them?

Special Power should not be active on random policy

Hi,

whenever the election failed 3 times and a random policy comes up, currently the president gets to use the power if it's a fascist policy.
In the rulebook it says that on random policy, the president doesn't get to use the power:

If the group rejects three governments in a row, the country is thrown into chaos. Immediately reveal the Policy on top of the Policy deck and enact it. Any power granted by this Policy is ignored, but the Election Tracker resets, and existing term-limits are forgotten.

Player list has too much information

Actual behavior: Websocket sends all players the roles of every player
Expected behavior: Websocket sends liberals and hitler roles only their own role by default, with some provision for in game events that might reveal more information where an investigating player can see the role of the investigated player (but only the investigating player is sent this info)

Debug flag should be an environment variable

  • Remove the hard-coded debug flags and pass into frontend and backend as environment variables/arguments
  • Remove debug server ports/addresses and pass as environment variables
  • Add dev target to npm targets
  • Add dev or equivalent target to gradle

Languages?

Im playing this game with my friends but new players are having hard times to get used to the game, can you give more languages? also i can help for the turkish language. This game is kinda popular in turkey so it would be good.

Significant Lag and Timeouts

Was trying this evening in advance of a group game tomorrow - site is lagging when creating a lobby, long period of nothing, then suddenly jumps to life. Then added a player, player joined and the room then timed out and booted out the first player. 3rd player added and connected very quickly. Seems very variable. Not stable enough to use at the moment. Thanks!

President Peek shows wrong loyalty

When the president gets the ability to peek at the loyalty of a player, in three seperate events, all liberal players have shown the fascist loyalty. I currently don't know, if the fascist are shown their correct loyalty.

Investigation Results Missing/Wrong

Presidents who unlocked the investigation power either didn't get the investigation results or reported incorrect results from the investigation.

Killed player becomes president

When the player on the right of the president gets killed, the very next turn the president token moves on to the killed player
and the game hangs and can't be continued anymore. Instead it should ignore the recently killed player and move to the following player who comes afterwards.
The game logic doesn't recognize that the player was just killed if it's the player on the right side of the president.

Update Twitter share buttons

Moved from #132.

Use Case

Currently, the Twitter share buttons ask users to make a canned tweet ("I'm playing Secret Hitler Online"). I'd rather use that as an opportunity to get feedback and fun interaction from users instead.

I've made a new account for this project, @SecretHitlerOn. (I ran into the twitter username character link, don't judge).

Completion Criteria

  • Update the description text on the profile pictures.
  • Replace the current Twitter button component library or add fallbacks for browsers that block the component, like Brave.
  • Update the Twitter button component to open a blank tweet with @SecretHitlerOn tagged.

Additional Notes

May also be a good opportunity to include other feedback methods.

Say something nice! -> Twitter, and Google form links
Give feedback -> Google form link

Also, check if there's a way to confirm if users actually sent a tweet without paying for the Twitter API?

kicking after one hour

We have had several games with hour where we've got kicked out of the session after one hour.
That's annoying. Maybe is it a better idea to only kick sessions if they really are afk.

"Veto loop" possible

When the Chancelor chooses to do a veto, the president can decide. If the president says no, the same screen goes back to the chancelor.
The chancelor should then not have the possibility to do veto again. Otherwise it is possible, that they get caught in a loop.
He/she should instead be only able to chose the policies.

The original rules say, that the veto failed when one of them is against it.

Unable to use names with diacritics.

Joining game while using name that includes diacritics (characters such as š,ř,ž,á,í etc.) creates giberrish in the name. Furthermore, starting the game while having such a name makes you unable to join the game at all.

📌 Bots Feedback Thread!

Hello! I've had more free time than usual lately (read: I was laid off 🥲), so I've been able to dedicate more time to fixing up Secret Hitler Online between job applications. Besides some stability and maintenance improvements, I added bot players to the game!

image

They can now sub in when lobbies have 1-4 players, and you can test it out by creating a lobby and pressing 'Start Game' with less than five players.

This is an experimental feature, so any feedback is appreciated!

I'm specifically looking for feedback on:

  1. Are bots stable? (does the game stall or crash?)
  2. Do the bots behave predictably? (do they help or hinder your team significantly?)
  3. Does anything else behave strangely when bots are enabled? (animation jitter, etc.)

If providing feedback on bot behavior, please also describe 1) what was happening in the game up until that point, 2) what the role of the bot was (if known), and 3) what the bot did that was unexpected.

Thanks so much, and happy playing!
-Shrimp


Quick Q&A:

Can we add more than 4 bots to a lobby? (games of 5+ bots)
Not currently! This is because the bots are, frankly, not very good at the game, and Secret Hitler is the most fun when you can read into player actions. If this is a popular feature request, I may reconsider it :)

How good are the bots at the game?
I need to collect more statistics on the backend to really analyze this in depth. From simulated games I've run with just bots, liberals win about 28% of the time and fascists the other 72%. (This is largely due to Hitler winning chancellor elections.) I'm not sure yet how they'll do in lobbies with players, though.

How do the bots work?
The bots assign every other player a reputation score. It goes up and down in response to player actions, like passing legislation, or by abilities, like the Investigation presidential power. This score is used to weight a random number generator for other actions, like selecting chancellor nominees or investigation targets. This decision-making changes based on the game progression and the role of the bot.

This means that a bot with the Liberal role will be less likely to nominate a player that has repeatedly passed fascist policies ((and more likely to use the Execution power on them instead lol)). Bots are also slightly more likely to choose users (you!) as chancellor or for other active roles, to prevent them from monopolizing game actions.

Make development-branch the default branch

If you want to help out with the project it can be helpfull that the default branch is set to the main development-branch that you want us to fork from and create pull-requests to.

Game crashes on custom president

After custom president tour, if the next president is just executed, dead player becomes president but he cant play the game and game stucks on the same screen.

Secret Hitler XL

there is a new community made version out, and it's pretty awesome. We've been playing that instead ever since it came out. It would be great if you can add that to your web. Here's the Reddit post about Secret Hitler XL:

https://www.reddit.com/r/SecretHitler/comments/qhj8fr/ive_made_secret_hitler_xl_expansion_with_a_bunch/

as a side note, it would be nice to let the host choose the number of policies, number of players for each faction, presidential powers boards, and etc... to enable balancing out the game for users.

"Winning" title missing

We've had to rounds in a row were the game ended after Hitler got choosen as chancelor.
There have not been a "winning"-screen, but the game ended immediately

Heroku Free Tier Expiring

Hi, everyone!

Heroku's free tier is expiring on November 28th, which means that Secret Hitler Online's backend will need a new host.

I'll be working to port the backend to another service (currently looking into Fly.io!) but it involves quite a bit of work. I hope that I can keep the project running, but I can't make any guarantees yet.

Fingers crossed!

Misc. bugs from typing

  • Mystery black screen (after voting, goes away when Policy enacted popup appears.)
  • Everyone is host except for the actual host
  • Occasional disconnects >:(
    • Disconnects also cause bad sequencing

Player roles are shown too early during victory sequence (or not shown at all).

Moved from #132.

The roles of all players are shown too early during the final action (execution/policy/chancellor voting) instead of only during the final victory screen.

Also, on testing with multiple windows at the same time, I found that one (Liberal) player was not shown the roles of other players at the end of the game at all.

Reproduction:

  1. Open five windows/tabs with the dev build: https://secret-hitler-online-dev0.web.app/
  2. Create a lobby and join it with all five users.
  3. Click through the game and reach any of the victory states.
  4. During the final action, the player roles will be visible.

Notes

Could be solved by adding conditional in PlayerDisplay.tsx so it only shows roles that the player should know about, unless a flag is set that enables all player roles to be seen at the victory stage?

Memory Leak

The SHO server has a set amount of RAM available to it. However, the amount of RAM used by the program seems to slowly creep upwards over the lifetime of the server, until it eventually hits the upper limit and the hosting service terminates it.

The cause of the memory leak should be profiled (dump Java memory log, etc.) and fixed. Another solution would be restarting the server on a set interval.

Players are randomly disconnected from the server and returned to the lobby

Moved from #132.

Description

Users occasionally disconnect from the server and are returned to the lobby page.

Repro:

  1. Open the development build here: https://secret-hitler-online-dev0.web.app/
  2. Create a lobby and start the game.
  3. After a few minutes, the player may be returned to the lobby page. Opening the console will show that the client attempted to reconnect but could not.

Notes:

The server delays deleting player connection records for a few seconds after disconnection. This was originally added to reserve player names + ordering in the lobby in case a player temporarily disconnected. Something about the way this is handled likely prevents the server from registering the new connection, causing every connection attempt to fail. See Lobby.java.

There are also likely other race conditions in the web socket handling code in App.tsx-- see note in #132 about hot reload keeping background websocket connections. It needs DEEP refactoring and would benefit from being turned into a functional component.

Server crash + no backups

I've been receiving notifications that the server is running out of memory and crashing. This normally wouldn't be an issue, but it seems like the database I normally use to track saved game data wasn't configured correctly, so game progress is lost.

I'm going to try and get it working sometime today, and I'll upgrade the RAM allocated to the server if crashing continues to be an issue.

My apologies if you've been affected while playing!

Bots added to lobbies of 5+

A bug in the lobby initialization code causes bots to be added to lobbies of five or more players with no way to remove them. This should be a pretty quick fix once I sit down with it, but I should also check how the lobbySize variable is getting updated.

Thanks to @pwclark12 for the initial report!

Convert project to TypeScript

In the process of converting core elements of the frontend from JavaScript to TypeScript to make future development easier.

TODOs:

  • Add a warning note on the front page about the new changes, requesting that players be vigilant for bugs
  • [ ] Delete the Twitter buttons and elements; they don't work on certain browsers, like Brave moved to #136

Known bugs:

  • Player roles are not shown on victory screen for liberal players
  • In developer mode, hot reload will cause the websocket connection to stay open in the background, blocking logins and causing other strange behavior.
  • PlayerDisplay does not show roles during final victory screen.
    • PlayerDisplay now shows all roles too early #140
  • During victory sequence, the last action (execution/voting) should be shown for more suspense! (not a bug introduced here but a general sentiment)
  • PlayerDisplay shows all roles for fascist players. (maybe ok?)
  • Initial Role display shows incorrect card for Liberals

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.