Closed gsiems closed 1 year ago
This looks great, thanks! I should be able to add it for the next release. Or if you send a PR I'd be happy to merge it.
Go ahead and just add it (I don't have any forks that are available for doing a pull from.)
(Finally) added in https://github.com/dozingcat/CardsWithCats/pull/26. Thanks again!
I would like to propose an enhancement to the way the computer players bid nil, the goal being for the players to be more intentional about bidding nil.
The idea is to first determine if a nil bid would be a sane thing to do. If a player can reasonably expect to succeed in a nil bid then they should bid nil.
In testing the addition of the "can bid nil" functionality, 1,000 AI vs AI games were played where team 0 used the new functionality and team 1 did not.
Team 0 won 57.4% of the games and team 1 won 42.6% of the games.
The summary of the results are as follows:
Where the actions are defined as:
chose 1: (team 0) These hands would have normally been bid nil except that they had one or more courtly spades and therefore bid 1
chose nil: (team 0) These hands bid nil based on the results of the "can bid nil" functions returning true
normal: These hands resulted in a normal non-nil bid
normal nil: These hands did not pass the new "can bid nil" checks but were bid nil based on the expected points calculation
high spade nil: (team 1) These hands were bid nil while having one or more spades that were a jack or higher
For the "chose 1" hands, the player enjoyed a 79% success rate so there was little penalty for bidding 1 in those instances. For the rounds where the player did not take any tricks their partner often took extra so the success rate for the team was even higher.
For the "chose nil" hands, the player enjoyed an 80% success rate.
For the "normal nil" hands, the player enjoyed an 79% success rate.
For the "high spade nil" hands, the success rate was only 52.8%.
From the above results it can be argued that:
Refraining from bidding nil when a player has a jack and/or queen of spades is more successful (or at least less annoying) than bidding nil in those instances.
Being more assertive about bidding nil, even when the hand could possibly take one or more tricks, is a more successful strategy than not doing so.
The proposed change involves adding a couple of functions to the lib/spades/spades_ai.dart file and updating the chooseBid function as follows:.