ShrimpCryptid / Secret-Hitler-Online

An online version of Secret Hitler, a social deduction board game.
71 stars 13 forks source link

đź“Ś Bots Feedback Thread! #44

Open ShrimpCryptid opened 1 year ago

ShrimpCryptid commented 1 year ago

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.

pwclark12 commented 11 months ago

Bots seem to be automatically getting added to a 7-player game making it an 8-player game. This ruined a handful of games my Discord was playing since they play so poorly, especially in large groups. There was no way to remove the bot. Additionally, it may have been bad rng, but the bot was fascist 3 games in a row.

ShrimpCryptid commented 11 months ago

Bots seem to be automatically getting added to a 7-player game making it an 8-player game. This ruined a handful of games my Discord was playing since they play so poorly, especially in large groups. There was no way to remove the bot. Additionally, it may have been bad rng, but the bot was fascist 3 games in a row.

Thanks for the feedback, I'll look into this. Bots should only be added to lobby sizes of four or less so it's strange that one was getting added. I can also confirm that Bot roles are assigned randomly, though it's unfortunate that it got assigned the same role three times in a row.

Could you also verify that it was a bot and not a player pretending to be one? Bots should have no player icon and will make decisions instantaneously.

ShrimpCryptid commented 11 months ago

Okay, I think I see the issue, actually. I wrote part of the code when I had assumed that bots would be added to lobbies of any size, rather than to just reach the minimum. Someone might have connected and disconnected, causing the lobby to set its size to 8 players and backfill with bots.

I'll issue a fix when I have time to sit down with the code in the next day or two. Thank you again for leaving a note!

sharkavx commented 5 months ago

Love the game and your design is very fluid and easy to use. As well the art is great, unique, while still reflecting the original game.

I've attached a screenshot from me trying the game, me and some friends are going to play tonight and I was curious how the bots behaved, we won't need them but still thought I'd try.

There were 2 issues, one was with the bot behaviour and the other was with roles assignment.

Only 1 Fascist policy got passed, which seemed fine at this low of player count. But then when the game ended it showed that all 4 of the bots were Fascists, and none of them was Hitler. Also this means that the Fascist bots won the game by themselves. The last 2 policies passed were done entirely by bots.

Screenshot 2024-02-08 131713

After that I played a couple more times and did not have any of the behaviour issues or roles assignment, it was just that first one.

ShrimpCryptid commented 5 months ago

Love the game and your design is very fluid and easy to use. As well the art is great, unique, while still reflecting the original game.

I've attached a screenshot from me trying the game, me and some friends are going to play tonight and I was curious how the bots behaved, we won't need them but still thought I'd try.

There were 2 issues, one was with the bot behaviour and the other was with roles assignment.

Only 1 Fascist policy got passed, which seemed fine at this low of player count. But then when the game ended it showed that all 4 of the bots were Fascists, and none of them was Hitler. Also this means that the Fascist bots won the game by themselves. The last 2 policies passed were done entirely by bots.

Screenshot 2024-02-08 131713

After that I played a couple more times and did not have any of the behaviour issues or roles assignment, it was just that first one.

That's super weird, thank you for the bug report! My guess is that the issue was the server revealing roles incorrectly, rather than the bots having all-Fascist roles assigned. I'll take a look and update here if I find a fix.

JamesGames7 commented 3 months ago

About bot behaviours…I was playing a “solo” 5 person game, with me as a fascist. Hitler obviously knew who I was (as a bot, bc it’s 5 players). However, they decided to execute me for some reason. I don’t know what the logic is…I think I’d enacted 1 fascist policy total at that point with the others by them?

ShrimpCryptid commented 3 months ago

About bot behaviours…I was playing a “solo” 5 person game, with me as a fascist. Hitler obviously knew who I was (as a bot, bc it’s 5 players). However, they decided to execute me for some reason. I don’t know what the logic is…I think I’d enacted 1 fascist policy total at that point with the others by them?

BETRAYAL.... I'll take a look at the logic when I get the chance. Some of the Hitler bot's logic tries to copy Liberal roles in order to "pass" as one more effectively, so it's possible that I let that slip into the code that decides targeting for the execution action. Thanks for the feedback!

ShrimpCryptid commented 3 months ago

About bot behaviours…I was playing a “solo” 5 person game, with me as a fascist. Hitler obviously knew who I was (as a bot, bc it’s 5 players). However, they decided to execute me for some reason. I don’t know what the logic is…I think I’d enacted 1 fascist policy total at that point with the others by them?

Okay, update! I found where this is happening in the code. Here's the statement that bots with the fascist/hitler role are using to choose players:

selectedPlayer = chooseRandomPlayerWeighted(playerList, 0.5f, 0, 1f, 0);

So what this statement does is choose a player for the execution action with weighting for different roles. In this case, fascist roles are given a weight of 0.5, the hitler role is given a weight of 0, and liberal players are given a weight of 1.0. (The last 0 means that no particular weight is given to players vs. bots.)

I'll adjust this a bit so fascist roles are given less weight (and thus will be less likely to be chosen), though I do intend that bots with the fascist roles can turn on each other for sheer unpredictability/to gain player trust.