"Introduction to Computational Game Theory" Learn more about Sam's work and reserach at: https://www.ganzfriedresearch.com/
Hey there! Welcome to our exciting poker bot competition repository! This is where the magic happens - we've got some seriously smart bots playing Texas Hold'em against each other. Let me walk you through what we've got here!
This repository is your one-stop shop for everything poker bot related! We've included:
- A super useful test engine to generate some action
- Notes, in case you get lost
- A beautiful PowerPoint presentation
- And of course, the star of the show - our poker bots!
All of our bots are built on the same solid foundation - the skeleton framework. It's like the rulebook of poker, but in code! You'll find these key files in both /skeleton directories:
actions.py: All the moves a bot can make (fold, call, check, raise)bot.py: The blueprint for creating a poker botrunner.py: The engine that keeps the game running smoothlystates.py: Keeps track of everything happening in the game
Think of it as the poker table, cards, and rules all rolled into one!
Meet our first bot - the mathematically-minded Player1_ABC! This bot is all about the numbers, using a sophisticated Expected Value (EV) calculation to make its decisions. It's like having a poker pro who's really good at math! The bot:
- Calculates hand strength with precision
- Makes decisions based on true EV calculations
- Considers pot odds and betting costs
- Has a simple but effective strategy for both pre-flop and post-flop play
It's like having a poker calculator that knows when to hold 'em and when to fold 'em!
Say hello to the All In Bot - a fearless poker bot that isn't afraid to push all its chips into the pot! This bot is designed to make bold moves when it likes its hand. Here's what makes the All In Bot tick:
- Preflop Aggression: Automatically goes all-in preflop with pairs or Ace-high combinations.
- Simplified Strategy: Focuses on maximizing aggression by capitalizing on players that are willing to gamble.
It's like having a poker player who knows when to go big or go home!
And here's our second bot - the AI-powered OpenAI bot! This one's super cool because it uses GPT-4 to make its decisions. It's like having a poker pro who's read every poker book ever written! The bot:
- Maintains a conversation with GPT-4
- Makes decisions based on natural language understanding
- Adapts its strategy based on the game context
- Has a fallback strategy if the AI needs a moment to think
It's like having a poker coach in your pocket, but one that's powered by cutting-edge AI!
Free version of the OpenAI Bot using Groq Cloud
- Sign up and generate an API key at: https://console.groq.com/home
- Add
GROQ_API_KEY=your-keyto your .env - Choose the model you want under Dashboard -> Limits (llama3-70b-8192 set by default)
- Prompt engineer yourself to victory 🏆
Want to see these bots in action? Just run the test engine and watch the magic happen!
Set the paths to your desired bots in config.py
Then run python test_engine.py or python3 test_engine.py to get the game going
You can create your own bot by following the skeleton framework - who knows, maybe your bot will be the next poker champion!
Remember, in poker as in life, it's not just about the cards you're dealt, but how you play them!
Happy coding! 💫
This is the environment you will implement your ideas and test them in Offline Self Play to then deploy your bot on the Scrimmage Server and climb the ranks.
Steps:
- Clone this repo:
git clone https://github.com/FIU-PokerBots/Lesson1.git - Create a virtual environment
python -m venv venvorpython3depending on your setup (if you don't have python installed go ahead and do that, also you might have to install the venv packagepip install virtualenvorpip3) - Activate the venv
source venv/bin/activate(mac or linux) - Install the dependencies to run local testing
pip install -r requirements.txt - Now you are ready to run your 1st game using
python test_engine.pyorpython3 - Check hands played
gamelog.txt - For debugging add print statements and see outputs for Player A and Player B in
A.txtandB.txtrespectively
- For windows specific instructions contact one of the admins
OpenAI Steps:
- Create a
.envfile (used to store secure environment variables) - Copy the contents of
.env.exampleinto that file - Go to OpenAI (paid) or Groq Cloud (free) pages, generate an api-key and replace the default values with it
Next Steps:
- Open
config.pyand update the paths to your chosen bots. - Copy one of the given bots rename them, change the strategy, and keep improving it until you are ready to DEPLOY it on the scrimmage server and climb the ranks!
P.S. focus on changing the logic in get_action() this function is given a state and decides whether to CALL, CHECK, FOLD, or RAISE based on the state. Optimizing these decisions will be the key to winning the competition.
Happy coding! 💫