Project Six CSE 397/497 AI and Computer Games

10
Project Six CSE 397/497 AI and Computer Games

description

Project Six CSE 397/497 AI and Computer Games. Introduction to Poker Academy. Bots for the Poker Academy software are written in Java We will use the Meerkat API to interact with the Poker Academy Software Links to everything you need are provided on the Project Web Page. - PowerPoint PPT Presentation

Transcript of Project Six CSE 397/497 AI and Computer Games

Page 1: Project Six CSE 397/497 AI and Computer Games

Project SixCSE 397/497AI and Computer Games

Page 2: Project Six CSE 397/497 AI and Computer Games

Introduction to Poker Academy

Bots for the Poker Academy software are written in Java

We will use the Meerkat API to interact with the Poker Academy Software

Links to everything you need are provided on the Project Web Page

Page 3: Project Six CSE 397/497 AI and Computer Games

Programming Your AI Implement the poker.Player interface, and

over-ride the required methods.

Build against the provided meerkat-api.jar library

Create a jar file with your bot's classes.

Create a player definition file

Page 4: Project Six CSE 397/497 AI and Computer Games

Some Classes You Should Know

Player Your AI will inherit from Player It has three methods:

getAction() holeCards() init()

Page 5: Project Six CSE 397/497 AI and Computer Games

Player

init(Preferences prefs) Loads preferences from .pd file

getAction() When it’s your turn to act, this method is

called. Think of it as your main body holeCards(Card c1, Card c2, int seat)

Returns your two hole cards, and your location at the table

Page 6: Project Six CSE 397/497 AI and Computer Games

Card Contains functions such as getRank() and

getSuit() for manipulating cards Defines a constants for every value and

suit, such as TWO, SEVEN, KING, or SPADES Ex: if (c1.getRank() >= Card.TEN && c2.getRank() >= Card.TEN) { if (c1.getSuit() == c2.getSuit()) { return Action.raiseAction(toCall, gi.getBetSize()); } return Action.callAction(toCall); }

Page 7: Project Six CSE 397/497 AI and Computer Games

Action

Think of actions returned by getAction() as nodes in your FSM

From SimpleBot.java: if (gi.getStage() == Holdem.PREFLOP) { return preFlopAction(); } else { return postFlopAction(); }

Page 8: Project Six CSE 397/497 AI and Computer Games

Some More Classes to Know GameInfo

Contains information about the current game, such as pot size, stage of the game (pre-flop, flop, river, etc), and info about the other players

Hand Stores up to 7 Card elements Once your cards are in a Hand, you can use the

HandEvaluator class to do lots of statistical functions on them, such as getNumBetter(), which returns the number of hands better than your current hand

Page 9: Project Six CSE 397/497 AI and Computer Games

Creating Your .pd File The .pd file stores information about your bot. We use

SimpleBot.pd as a guide:

# All plug-ins must run through the following class:PLAYER_CLASS=com.biotools.poker.opponent.PlugInOpponent

# put your bot's full class name here:BOT_PLAYER_CLASS=SimpleBot

# put the path to your jar file here (relative to PokiPoker.exe)PLAYER_JAR_FILE=data/bots/simpleBot.jar

# Your Bot's name:PLAYER_NAME=SimpleBot

# Your bot engine name:AI_NAME=SimpleBot

Page 10: Project Six CSE 397/497 AI and Computer Games

Creating Your .pd File (cont)# Options for your Bot:DEBUG=trueRANDOM_SEED=31313ALWAYS_CALL_MODE=false