alan-turing-institute / reg-peg

REG Hack Week 2024 Cribbage Agent Project
MIT License
0 stars 0 forks source link

Existing Libraries #1

Open edaub opened 4 weeks ago

edaub commented 4 weeks ago

There are a couple of existing open libraries on Github that we can build upon. Links and thoughts from me following a quick look-through:

  1. https://github.com/richard-moulton/Cribbage -- A RL course project implementing a few RL approaches. Does not use existing RL toolkits, but does explore a few approaches that fully takes game state into account and appears to be more sophisticated than other ones I have seen in terms of ability to handle strategy. Doesn't implement a human agent, though does have random and greedy players implemented.
  2. https://github.com/DubThink/cribbageksi -- Another course project, though not RL-based. Note that the game isn't implemented correctly due to an error in scoring pegging (I fixed the error in a local copy if we want to use this library). Also does not account for game state in the agent design. Implements a human agent, random and greedy agents, and an agent that can be set to have a certain level of risk tolerance in discarding. I played against this library's Greedy agent 20 times (alternating first deal), winning 15 times, so we do have a baseline for performance against a skilled human.
  3. https://github.com/dacarlin/cribbage -- Similar to previous library. Doesn't account for game state, but implements human, random, and greedy agents. ReadMe says it uses gym to train an agent, but it is unclear to me if this is actually implemented in the code.
  4. https://github.com/atremblay/gym-cribbage -- Set up for RL using gym, though uses points as rewards and doesn't account for game state so essentially implements a greedy agent. Doesn't include human agent or a random agent.
edaub commented 4 weeks ago

Re-posting from the Hut23 repo issue:

@alexeatscake found this library, which encapsulates the main rules and classes you would need to set up a cribbage game (e.g. ideas about a hand, scoring, etc): https://github.com/jonathanmcmahon/cribbage

There is also https://github.com/boardgameio/boardgame.io, which is a framework for online renditions of boardgames, with features such as multiplayer, AI and game state checkpoints.