dbravender / tricksterstable-rs

Rust implementations of game engines featured in Trickster's Table
Other
4 stars 0 forks source link

Kansas City: Bots sometimes throw hands by converting cards to trump when they already have won 3 tricks #25

Closed dbravender closed 1 month ago

dbravender commented 1 month ago

Bots have been observed converting cards to trump when they already have won 3 tricks even on the last trick. A human player in this position would not convert a card to trump in this situation because it increases the likelihood that you would win and you do not want to win more than 3 tricks since it decreases your score.

dbravender commented 1 month ago

I can set this scenario up, run some simulations, and inspect the graph to see why this is happening this weekend.

dbravender commented 1 month ago

Another scenario from a user report: "There was another time where P2 had 2 tricks won and could have turned his last remaining card into trump. P3 was at 5 tricks and won the most recent trick. There were no trumps on the table. P3 ended up winning the last hand and had 6 tricks total, p4 had 3, I had 3, and p2 ended up with 2. If p2 made there card trump they would have got 3 tricks and max score."

This could be a good one to turn into a test case. I suspect there's a bug in the value function or that scores aren't being reset for the current hand (perhaps the bot is only looking at overall score instead of per-hand scores and thinks it can't win the hand so it makes random plays).

dbravender commented 1 month ago

I think this was fixed in cc7dd03021909945297eb1c67a2c6702177432ff.

dbravender commented 1 month ago

Should be fixed in 1.0.75 and above:

git tag --contains cc7dd03 
tricksters-table-1.0.75
dbravender commented 1 month ago

Related blog post: https://www.patreon.com/posts/new-1-0-75-beta-114400292

Did you feel like the bots were teaming up on you in Kansas City in the beta build? You weren't wrong! I got some very helpful and thorough bug reports and discovered that the reward function was subtly wrong. I use a variable to track the "winner" in games and in Kansas City there can be ties. Even for ties I want to show that the user "won" so the default winner is 0. Unfortunately, I used the "winner" variable in the reward function so bots treated getting a high score with the human player as a losing condition which led to some very strange throwing behavior.

The list of work remaining is here. Please let me know if you have found any other issues. I'll add a comment here when Google and Apple have approved the release of the builds I just uploaded.

Thanks again for all of your support!