Poker-AI.org

Poker AI and Botting Discussion Forum
It is currently Mon Nov 13, 2023 2:44 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Sun Jun 29, 2014 12:34 am 
Offline
Junior Member
User avatar

Joined: Tue Feb 25, 2014 3:19 pm
Posts: 23
Hi:

I coded my bot in Java and I've discovered Poker Academy later. I'd like to test my bot with Poker Academy.

For my bot I have my own structures (players, table,...) to store the information.
With this information the bot takes the actions to do. I use a expert system with rules, for example: If someone has betted and N number of players have called the bet then the bot has to do whatever.

Poker Academy uses its own classes (GameInfo, PlayerInfo) to store the table information.

I was trying to convert the GameInfo to my own game information. And pass this information to my expert system.

But I've realised that I can't convert all the information, because Poker Academy's API doesn't keep the amount that the players bet. I can only know the amount that I need to call (getAmountToCall()) because someone betted, but I can't know how much somebody has betted exactly.

I'm new with Poker Academy and maybe I'm missing something. Do you know a simple way to get the amount that a player has betted?

PlayerInfo has the following methods:


double getAmountCallable()

get the amount of the current bet that the player can call

double getAmountInPot()

Obtain the amount the player has invested in the pot.

double getAmountInPotThisRound()

Obtain the amount the player has invested in the pot this round

double getAmountRaiseable()

Get the maximum amount the player can raise

double getAmountToCall()

Determine the amount a player must pay to stay in the game

double getBankRoll()

Get the current bankroll

double getBankRollAtRisk()

The maximum we can risk in the hand.

double getBankRollAtStartOfHand()

Get the player's bankroll at the start of the hand (i.e., before any actions including antes and blinds).

double getBankRollInSmallBets()


Get the current bankroll as a multiple of the big blind

GameInfo getGameInfo()

Get the context of the last action made by this player.

int getLastAction()


A single integer code for the last action made

java.lang.String getName()

Obtain the player's name

double getNetGain()

Get the net amount won or lost since the start of the current hand

double getRaiseAmount(double amountToRaise)

Return the amount the player can raise, given the desired amount to raise.

Hand getRevealedHand()

Obtain the hand revealed by this player

int getSeat()

Get the player's seat number in the GameInfo

boolean hasActedThisRound()

Check if a player has made at least one action this round

boolean hasEnoughToRaise()

Check if the player has enough chips to complete a raise

boolean inGame()

See if the player is dealt into the current game

boolean isActive()


Return true if the player is still active in the hand

boolean isAllIn()


Determine if a player is All-In

boolean isButton()


Check if the player is currently the button

boolean isCommitted()


Test if a player has volunatrily committed yet in this round

boolean isFolded()

Return true if the player has folded

boolean isSittingOut()


Determine if a player is sitting out

java.lang.String toString()



I've tried to use getGameInfo:

GameInfo getGameInfo()
Get the context of the last action made by this player.

in combination with 'getBankroll' to get the chips that the player has betted. Subtracting the previous amount from the actual amount to get the amount that the player betted.

But unfortunately getGameInfo() returns the amount that the player has after the betting and not before as I imagined.

I've also tried to save the previous players' bankrolls that I get in getAction() by GamInfo.
But getAction() is only called when I have to talk and sometimes I can't get exactly the previous bankroll to the bet.

Do you, big brains, have some tip or idea about how I can get the amount that the players' bet in Poker Academy?

Thanks in advance.


Top
 Profile  
 
PostPosted: Mon Jun 30, 2014 10:49 am 
Offline
Site Admin
User avatar

Joined: Sun Feb 24, 2013 9:39 pm
Posts: 642
I don't have PA these days and it's a long time since I used it so I'm not sure.
- On gameStartEvent get a reference to GameInfo gi
- On gameStateChanged call gi.getBankRoll(seat)


Top
 Profile  
 
PostPosted: Tue Jul 01, 2014 8:42 am 
Offline
Junior Member
User avatar

Joined: Tue Feb 25, 2014 3:19 pm
Posts: 23
spears wrote:
I don't have PA these days and it's a long time since I used it so I'm not sure.
- On gameStartEvent get a reference to GameInfo gi
- On gameStateChanged call gi.getBankRoll(seat)


I followed these bots:

https://code.google.com/p/opentestbed/s ... /demobots/


Code:
private GameInfo gi; // general game information

 /**
 * A new game has been started.
 * @param gi the game stat information
 */
        public void gameStartEvent(GameInfo gInfo) {
                this.gi = gInfo;  --------------------------->Here I get a reference to GameInfo
        }

 /**
* Requests an Action from the player
* Called when it is the Player's turn to act.
 */
        public Action getAction() {
               gi. ----------------------------------------> I use it here
          ...
        }
/**
* The game info state has been updated
* Called after an action event has been fully processed
*/
        public void gameStateChanged() {  ---------->I don't do anything here
        }


I will try to use gi.getBankRoll(seat) in gameStateChanged() as you said.

I'll keep you inform.

Thanks.


Top
 Profile  
 
PostPosted: Mon Jul 07, 2014 9:35 am 
Offline
Junior Member
User avatar

Joined: Tue Feb 25, 2014 3:19 pm
Posts: 23
Hi

Thank spears, it works! ;)

I'm getting the game's information in gameStateChanged() and in this method I have all the information that I need to calculate the size of the bets.

The problem was that I was getting the game's information in getAction() where I only have the game's information for a concrete moment (when I have to talk).

I still don't understand how getGameInfo works:

GameInfo getGameInfo()
Get the context of the last action made by this player.


Because this should return past information and I get the same information as the present.


Top
 Profile  
 
PostPosted: Thu Aug 16, 2018 7:35 pm 
Offline
New Member

Joined: Thu Aug 16, 2018 7:01 pm
Posts: 2
Hi:

I'd like too to test my bot with Poker Academy. I downloaded meerkat api from here and then I followed instructions from readme:

Quote:
Drop both the .pd and .jar file into the Program's data/bots/ folder
The default location on windows is C:\Program Files\PokerAcademyPro\data\bots
On Mac OS X you must install it inside the application bundle, which is
in Contents\Resources\Java\data\bots\

* Load the Opponent Manager and create a new Opponent (your new bot type
should appear in the list of installed AI Engines)

* See the SimpleBot.java example for a basic bot.

I did it with SimpleBot.jar and simpleBot.pd that are attached to instructions.
It was also required to drop the SimpleBot.pd to
\Documents and Settings\%user%\Application Data\PokerAcademyPro2\logs\players\

Everything is working. But then I just wanted to compile SimpleBot.jar from original source code SimpleBot.java. I followed this instructions:

Quote:
javac SimpleBot.java -cp meerkat-api.jar
jar cvf SimpleBot.jar SimpleBot.class

(It's for java machine)

But now I can't load poker table in PA. I added Simple bot to table. Then I click on "load table" button and then cursor transform to sandglass. And nothing happens. What I'm doing wrong?

Could you please help me? Both forums (Poker Academy and Poker Genius) are closed for registration, so I can't even ask a question.


Top
 Profile  
 
PostPosted: Thu Aug 16, 2018 8:34 pm 
Offline
Site Admin
User avatar

Joined: Sun Feb 24, 2013 9:39 pm
Posts: 642
It might be that PA requires on old version of javac. Check the version used to create the supplied jar. Then see if compiling *.java with that solves the problem.


Top
 Profile  
 
PostPosted: Fri Aug 17, 2018 4:45 pm 
Offline
New Member

Joined: Thu Aug 16, 2018 7:01 pm
Posts: 2
Quote:
It might be that PA requires on old version of javac. Check the version used to create the supplied jar. Then see if compiling *.java with that solves the problem.


Ok, it start working! At first I used jdk1.7.0_80 - to my mind, it is the last version, that run on win xp. But now I have checked in manifest the version used to create the supplied jar - it is 1.5.0_06-b05. I set up jdk1.5.0_06 (the best I could find on oracle site (in archive)) , and now it's working. Thank you very much!


Top
 Profile  
 
PostPosted: Fri Aug 17, 2018 6:46 pm 
Offline
Site Admin
User avatar

Joined: Sun Feb 24, 2013 9:39 pm
Posts: 642
A happy customer! A rare thing these days.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group