CardStock is a General Game Playing engine for card games implemented in C#. Games are written in RECYCLE, a card game description language, and then simulations are run with random, simple, and complex AI players. CardStock can then analyze the games to determine heuristics about the games such as fairness, decisiveness, drama, or clarity, and generate transcripts of each simulation for further study.
We are currently abstracting and refactoring CardStock to allow for new game functionality and setting up a modular system for a tournament of AI players. Please post any issues you find.
There are currently 70+ games coded in RECYCLE, a mixture of classic and modern games, categorized by genre:
- Adding
- Caterpillar (2p)
- Cribbage (2p)
- Ninety Eight (4p)
- Poison (5p)
- Catch and Collect
- 6 Nimmt (5p)
- Enchère (3p)
- GOPS (2p)
- Go Fish (2-4p)
- Pico (2p)
- Pico 2
- Trio (4p)
- Turn the Tide (3p)
- Climbing
- Comet (2p)
- Escalation! (4p)
- LAMA (2-6p)
- President (4-5p)
- Deck Building
- Drafting
- Sushi Go! (4p)
- Draw and Discard (or Discard and Draw)
- Clocktowers (2p)
- Golf Six (2-4p)
- Lost Cities (2p)
- Love Letter (3-4p)
- Rummy (2p)
- Spite and Malice (2p)
- Exchange
- Fishing
- Escoba (2p)
- Scopa (2p)
- Stealing Bundles (2-4p)
- Poker
- Kuhn Poker (2p)
- Leduc Poker (2p)
- Push Your Luck
- Shedding
- Crazy Eights (4p)
- Sane Eights (4p)
- Page One (3p)
- Simon's Cat (4p)
- Skittgube (3p)
- Crazy Eights (4p)
- Trick Taking
- Ace-Ten
- Briscola (2p)
- Trifle (2p)
- Klaverjassen (4p)
- Sheepshead (5p)
- Cheesheads (5p)
- Sueca (4p)
- Briscola (2p)
- All Fours
- California Jack (2p)
- Pitch (4p)
- Shasta Sam (4p)
- Avoidance
- Hearts (3-5p)
- Omnibus Hearts (4p)
- Broken Hearts (4p)
- Pure Hearts (4p)
- Grey Lady (4p)
- Black Maria (4p)
- Spot Hearts (4p)
- Knaves (3-4p)
- Polignac (4p)
- Slobberhannes (4p)
- Hearts (3-5p)
- Whist
- German Whist (2p)
- Spades (4p)
- Whist (4p)
- Others
- Agram (2-5p)
- Duck Soup (2p)
- Euchre (4p)
- Scarto (3p)
- The Fox in the Forest (2p)
- The Bottle Imp (3-4p)
- Ace-Ten
- Unique
Please check the wishlist for games that we would love to have implemented in Recycle. Pull requests are welcome and encouraged!
- Install .NET Install Tool Extension
- Get .Net Core 10.0
- Install C# Dev Kit Extension
- Open
CardStockfolder in the project using Visual Studio Code.
- Open the CardStock subdirectory
- Write up your game in RECYCLE in the
gamessubdirectory. Name it with the name of the game, followed by the number of players, with the .rcy extension, likeScopa2.rcy. - Run the program in the terminal by typing
dotnet run --configuration Release.- Command line arguments specify the name of the game, player count, and other parameters show below.
- Analyse your results (found in the
outputsubdirectory) with the Jupyter Notebooks in theAnalysisdirectory.
| Argument | Parameter | Options | Default |
|---|---|---|---|
| 0 | Game | any game in the games directory | Agram |
| 1 | Player Count | 1-9 | 2 |
| 2 | Number of Games | 1-1000 | 1 |
| 3 | AI Players | one letter for each player denoting the AI strategy used: M for Monte Carlo Tree Search, P for Pure Monte Carlo, R for Random | all players use Random |
| 4 | Logging | true/false | false |
| 5 | Number of Tests | 1-1000 | 1000 |
| 6 | Number of Samples | 1-100 | 10 |
| 7 | Level of Imperfection | NONE, BACK, HIDDEN, PRIVATE, OTHERS, TAKEN, PASSED, ATTRIBUTE | PRIVATE |
For example "dotnet run --configuration Release Scopa 2 100 MP true" would run 100 simulations of Scopa for 2 players, with the first player using Monte Carlo Tree Search, and the second player using Pure Monte Carlo. The individual choices and a transcript of each simulation would be logged.
- The Shape of Card Games Blog
- ReadTheDocs.io
- Automated Playtesting with RECYCLEd CardStock, Connor Bell and Mark Goadrich, Game & Puzzle Design Journal, Vol 2, Issue 1, July 2016
- Quantifying the Space of Hearts Variants, Mark Goadrich and Collin Shaddox, Advances in Computer Games 2021, November 2021
To cite this project, please use the following reference
@article{Bell_Goadrich_2016,
title={Automated Playtesting with RECYCLEd CardStock},
author={Bell, Connor and Goadrich, Mark},
journal={Game & Puzzle Design},
volume={2}, number={1},
year={2016}, pages={71–83}}
