Welcome to Sprint 3! This sprint, we will be learning to build simple board game bots, using the auction-style card game Megagem, produced by Richard Garfield and Jane Street. You will learn about the game itself, the role of harnesses is, and common techniques for designing intelligent bots. At the end of the sprint, you will submit up to 3 bots to the megagem-harness repository, which will then be entered into a tournament against everyone else’s! Hopefully, by the end of it, we will have some better insight into what simple strategies prevail over others in this game. Below, find workshop schedules, slides, recordings and notes for the first week.
Questions? Email ryan.fernandes@yale.edu
Assignment:
For this sprint, your job will be to create intelligent bots capable of playing the game Megagem (rules). To do this, you must follow these steps:
- Read the rules and reason about simple strategies
- Fork the harness repo here and read through the code/comments
- Implement your bots in the bot_definitions subdirectory
- Test your bots in simulated games and iterate
- Open a pull request to
Ryfernandes/megagem-harness to submit
Below are some rules/guidelines that you must follow when creating your bots:
- You may work individually or in teams
- You can submit 1-3 bots per team
- Each bot must be defined in the
src/bot_definitions subdirectory
- Each bot must be imported/added to the public API of
src/custom_bots.py (the line with __all__)
- Each bot must provide a response to function calls within a maximum timeout of 2 seconds. This timeout may increase, but it will not decrease
- Each bot definition must be accompanied by some documentation (such as a multi-line comment at the top of the file) explaining the basic strategy of the bot and listing its contributors
- (Optional) Write a blog about your bots and get featured on the y/cs website/LinkedIn!
At the end of the sprint, we will run some sort of simulation/tournament of the bots, depending on how many are submitted, and post the results. Catalyst points will be awarded for performance of the bots, as well as bot quality, which will be informed by the results of the simulation
Workshop 1: Introducing the Game
- When: Tuesday, November 3, 7-9pm
- Where: WLH 209
- Slides: Here!
- Recording: NA
Summary: In this workshop, we reviewed the rules for Megagem, focusing on the points at which players need to make decisions and what information is relevant to them when they do. A good online manual for Megagem can be found here, and check out this interesting blog about Megagem strategy and a reinforcement-learning approach (likely more complicated than what you will do for your project).
Workshop 2: The Harness
- When: Wednesday, November 4, 5-6:30pm
- Where: WLH 207
- Slides: Here!
- Recording: Here!
Summary: In this workshop, we walked through the harness that has been created for Megagem bot development. We traced through code segments, reviewed important data structures, and showed some example bot implementations. In addition, we learned how to simulate games with the harness, run robust experiments, and collect data. The link to the repository is here.
Practice: (15-30 min) Try implementing a bot that “rations” its coins! The bot should only bid when gems are up for auction and bid proportionally based on the number of gems up for auction compared to the total number of auctionable gems remaining. For example, if the bot has 10 coins left, 2 gems are up for auction, and there are 5 gems total left, it should bid 10 * 2 / 5 = 4 gems. Implement this bot and test it against the SmallBidBot! How does it perform?
If you have any requests for the harness or find any bugs, please let me know! (ryan.fernandes@yale.edu)
Workshop 3: Building Smart Bots
- When: Thursday, November 5, 5-6pm
- Where: WLH 117
- Slides: Here!
- Recording: Here!
Summary: In this workshop, we dived a bit deeper into theory and walked through an important expected value calculation for designing smart Megagem bots. In addition, we outlined other, more advanced techniques that may be useful to research/implement when building your bots.