-
Notifications
You must be signed in to change notification settings - Fork 0
/
write-up.txt
69 lines (53 loc) · 3.27 KB
/
write-up.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
> The Project
For this project, we have decided to implement a 2-player, 5-card version of
Cribbage playing to 61. This is the simplest version of Cribbage and is
preferred by beginners. There are 6-card versions, as well as 3-player and
4-player versions.
We have refactored the Monte Carlo Tree Search algorithm to work with our
implementation of Cribbage. We will compare the performance of a perfect
information version, an imperfect information version, and a random player.
> The Game
Cribbage requires a 52-card standard playing deck. The current and previous
scores of each player are tracked by a board which counts up to 121 for full
games, but this simplified version will terminate after 61 points. The royal
card values are all worth 10 points. Aces count as 1 point.
Cribbage is divided into three segments: Deal, Play, and Show.
The Deal happens at the beginning of each round. Typically, the players will
draw for lowest card to determine who begins as the dealer. We will forego this
process and just designate one player as the dealer.Then each player is dealt
their hand (5 cards). From these five cards, each player selects
The Play happens each round w/ a new hand. This segment starts w/ the
non-dealer player (the pone) laying a card down. The dealer follows, announcing
the cumulative amount. This continues until the value reaches 31, or a player
can't place a card down without going over 31. Then a new card pile is started.
Same rules apply until the players' hands are empty. There are many
opportunities to score points during the Play (these will be covered in the
Scoring Opportunities section).
The Show starts after the Play has finished. The players take back their cards
and calculate all the different card combinations (covered in Scoring
Opportunities). It is important to note that cards can be reused when creating
scoring combos. First, the non-dealer's hand is evaluated, next the dealer's,
and finally the crib. The points scored by the crib are given to the dealer.
This creates an advantage for the first dealer (made even larger by our shorter
game).
> Scoring Opportunities
Rules from https://cardgames.io/Cribbage/#rules
> Challenges
Implementing Cribbage was made difficult by the two distinct choice points and
the three different segments of the game. These all required different data
structure fields. Additionally, there were many scoring functions which
happened in one form during the PLAY and in another during the SHOW. This
meant that as we built up the game implementation, we added more structure
fields than we would have liked.
Much of our time was spent in automating the game-play; building up from manual,
to playing a full round, and then a full game. We found many edge cases that
required careful manipulation. As an example, the PLAY ends when neither player
can make a legal move. But the PLAY can can continue while one of the players
has legal moves.
Adapting MCTS for Cribbage was challenging due to the player and dealer fields.
We weren't sure which to keep track of in the algorithm, and were consistently
getting results worse than the random player, but we have arrived at an
algorithm that works quite well for Player One.
> Testing
We tested our MCTS algorithm implementation against a random player over the
course of 50 games.