write a custom HH converter

General discussion of PokerTracker 3.

Moderator: Moderators

Re: write a custom HH converter

Postby sfinktah » Sat Jan 09, 2010 6:49 am

White: that's just truistic rhetoric, and helps no-one.

I think we can safely assume that PT3 will read a HH if it's *identical* to the format of an accepted casino.

However, as developers, we would like to know which parts of the HH are used, and how how stringent the parsing is. I wouldn't hurt to know which casino had the simplest histories either.

Hand histories are design to be human readable, and contain a lot of redundant information and pleasantries that we don't want to have to recreate in order to have PT3 parse a data file and put it into a database.

Here's how simple it could be (and might be - we don't know unless we ask):


Here's what I would like to write in my ideal HH format:

Game: Flinstones Family, Hardrock Table, 2500 BC.
Seat 1: Fred
Seat 2: Jane
Seat 3: Wilma
Seat 4: Barney
Button: Seat 4
Dealt: [Cards] to 1
3 bets $2
4 bet $4
1 folds
2 calls
Flop: [Cards]
2 bets $2
3 bets $4
4 calls
1 calls
[..]
3 shows [CARDS]
3 wins $20
<END>


Here is an made-up example of pokerstars hand - I'd like to know how much of it I need. This will affect my decision to buy your product.

Table 'Carlova' 9-max Seat #6 is the button
Seat 1: hotMccoffee ($51.20 in chips)
...
Seat 9: dudetristen ($50 in chips)
Quad2x2: is sitting out
Quad2x2 leaves the table
Tobsen: is sitting out
Tobsen leaves the table

loxster: posts small blind $0.25
Foldarz: posts big blind $0.50


Do I need to include the worth of every player?
Do I need to include players that are sitting out.
Do I need to re-impress upon PT3 the cost of the small and big blind?

...
pepero64: folds
samsemilia: bets $1
samsemilia: raises $1 to $2


Do I really have to differentiate between a bet and a raise, and then tell PT3 that 1 + 1 = 2?

*** FLOP *** [7c 6c 3c]
biff4968: calls $3
samsemilia: raises $20 to $23 and is all-in
biff4968: folds
Uncalled bet ($22) returned to samsemilia


Again, why am I doing math here... if PT3 is using the initial worth of each player, then is it really taking any notice of the "all-in"?

Must I explain to it that uncalled bets are returned to players?

*** SHOW DOWN ***
samsemilia: shows [Qc Qs] (a flush, Queen high)
biff4968: mucks hand
samsemilia collected $14.05 from pot
*** SUMMARY ***


I'm fairly sure that PT3 isn't actually processing the description "a flush, Queen high"... Maybe I could write "A brown flushed turd" instead.

I don't really want to have to write translations for every type of hand, to perfectly match the HH format.
    a full house, Kings over Queens
    a full house, Queens full of Kings
    Kings full over Queens
    a set
    a set of 3's
    a set of 3's with an Ace kicker
    Aces and Kings
    2 pair, Aces and Kings
    Straight, ace high.
    Straight Flush, ace high
    Royal Flush
    5 Kings
    Full house, Kings over kings
    Quads, kings with a king kicker.
    two pair, KK and KK with a green leprechaun kicker


Total pot $14.75 | Rake $0.70


I like this line. Definately good to make sure that the bets as written = the pot.

Board [7c 6c 3c 9c Qd]
Seat 1: hotMccoffee folded before Flop (didn't bet)
Seat 2: canaans folded before Flop (didn't bet)
Seat 3: pepero64 folded before Flop (didn't bet)
Seat 4: samsemilia showed [Qc Qs] and won ($14.05) with a flush, Queen high
Seat 5: biff4968 mucked
Seat 6: lydiasboy84 (button) folded before Flop (didn't bet)
Seat 7: loxster (small blind) folded before Flop
Seat 8: Foldarz (big blind) folded before Flop
Seat 9: dudetristen folded before Flop (didn't bet)


10 lines of useless, painful to recreate, duplicate data. How many times does PT3 really need to see the common hands. Does it need to be reminded who folded, and what the winning hand was? Does it have Alzheimers?

I could probably live with the stars format, if I could just skip the summary line. However I fear that PT3 actually reads in some of those fields for cross checking.

I would like to know which ones - or be pointed to an easier history file.
sfinktah
 
Posts: 15
Joined: Sat Jan 09, 2010 5:44 am

Re: write a custom HH converter

Postby sfinktah » Sat Jan 09, 2010 7:09 am

Going to answer a bit of my own question now...

Assuming the PT3 supports it - the simplest HH files appear to be Everest. No summaries, no extra math, no crap.

Code: Select all
EverestPoker Game #3528940933: Table Zaysan-8 - $1/$2 - No Limit Hold'em - 11:08:10 - 2008/07/29
Seat 1: RiseOf-era ($379.85)
Seat 2: MarcusAS ($193.35)
Seat 3: iL_MnK ($307.15)
Seat 4: Hero ($92.00)
Seat 5: maimuni ($223.00)
Seat 6: Matti ($220.05)
maimuni posts the small blind of $1.00
Matti posts the big blind of $2.00
The button is in seat #4
*** HOLE CARDS ***
Dealt to Hero [3h 3c]
RiseOf-era raises to $7.00
MarcusAS folds
iL_MnK folds
Hero raises to $24.00
maimuni folds
Matti folds
RiseOf-era calls $17.00
*** FLOP *** [6c 8s 10c]
RiseOf-era checks
Hero bets $35.00
RiseOf-era raises to $156.00
Hero calls $33.00, and is all-in
RiseOf-era shows [Ts 9s]
Hero shows [3h 3c]
*** TURN *** [Ah]
*** RIVER *** [10d]
RiseOf-era shows [Ts 9s]
Hero shows [3h 3c]
*** SUMMARY ***
RiseOf-era shows [Ts 9s]
Hero shows [3h 3c]
RiseOf-era collects $184.00


And if you swing the other way - IPN uses XML, which I have tidied up a bit to make it semi-legible.

Code: Select all
<history id="1212101070" session="session213301035.xml" table="table th 946" game="game_thm" gametype="gametype_real" gamekind="gamekind_cash" tablecurrency="eur" limit="nl" stakes="3.00/6.00" date="1219784029" win="0.00" loss="27.00">
  <player name="wuptidupti" seat="1" amount="526.20"></player>
  <player name="rex mundi." seat="2" amount="614.25"></player>
  <player name="tobi270" seat="3" amount="552.30"></player>
  <player name="hero" seat="4" amount="721.75"></player>
  <player name="drunksanta" seat="5" amount="659.75"></player>
  <action type="hand_blinds" player="wuptidupti" kind="hand_bb" value="6.00"></action>
  <action type="hand_blinds" player="drunksanta" kind="hand_sb" value="3.00"></action>
  <action type="hand_deal" player="drunksanta">
    <card link="b"></card>
    <card link="b"></card>
  </action>
  <action type="hand_deal" player="wuptidupti">
    <card link="b"></card>
    <card link="b"></card>
  </action>
  <action type="hand_deal" player="rex mundi.">
    <card link="b"></card>
    <card link="b"></card>
  </action>
  <action type="hand_deal" player="tobi270">
    <card link="b"></card>
    <card link="b"></card>
  </action>
  <action type="hand_deal" player="hero">
    <card link="32"></card>
    <card link="37"></card>
  </action>
  <action type="action_fold" player="rex mundi."></action>
  <action type="action_call" player="tobi270" value="6.00"></action>
  <action type="action_raise" player="hero" value="27.00"></action>
  <action type="action_fold" player="drunksanta"></action>
  <action type="action_call" player="wuptidupti" value="27.00"></action>
  <action type="action_call" player="tobi270" value="27.00"></action>
  <action type="hand_board" value="board_flop" pot="84.00">
    <card link="3"></card>
    <card link="23"></card>
    <card link="47"></card>
  </action>
  <action type="action_check" player="wuptidupti"></action>
  <action type="action_bet" player="tobi270" value="12.00"></action>
  <action type="action_fold" player="hero"></action>
  <action type="action_call" player="wuptidupti" value="12.00"></action>
  <action type="hand_board" value="board_turn" pot="105.00">
    <card link="3"></card>
    <card link="23"></card>
    <card link="47"></card>
    <card link="39"></card>
  </action>
  <action type="action_check" player="wuptidupti"></action>
  <action type="action_check" player="tobi270"></action>
  <action type="hand_board" value="board_river" pot="105.00">
    <card link="3"></card>
    <card link="23"></card>
    <card link="47"></card>
    <card link="39"></card>
    <card link="33"></card>
  </action>
  <action type="action_check" player="wuptidupti"></action>
  <action type="action_check" player="tobi270"></action>
  <showdown name="hand_showdown" pot="105.00" rake="3.00">
    <result player="wuptidupti" win="0.00" hand="$(str_g_win_pair) $(str_g_cards_eights)">
      <card link="20"></card>
      <card link="22"></card>
    </result>
    <result player="rex mundi." win="0.00" hand="$(str_g_fold)"></result>
    <result player="tobi270" win="105.00" hand="$(str_g_win_pair) $(str_g_cards_jacks)">
      <card link="51"></card>
      <card link="36"></card>
    </result>
    <result player="hero" win="0.00" hand="$(str_g_fold)"></result>
    <result player="drunksanta" win="0.00" hand="$(str_g_fold)"></result>
  </showdown>
</history>



Both examples were taken from http://poker-tools.flopturnriver.com/Ha ... er-FAQ.php
sfinktah
 
Posts: 15
Joined: Sat Jan 09, 2010 5:44 am

Re: write a custom HH converter

Postby kraada » Sat Jan 09, 2010 9:48 am

I will try to get a developer to comment in this thread for you.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: write a custom HH converter

Postby zubs1aa » Sun Jan 10, 2010 10:41 pm

kraada wrote:I will try to get a developer to comment in this thread for you.


I'd appreciate that as well.
zubs1aa
 
Posts: 2219
Joined: Fri Feb 08, 2008 1:52 pm

Re: write a custom HH converter

Postby kraada » Mon Jan 11, 2010 10:27 am

Everest is a fairly simple hand history as you can see from the above.

I spoke with a developer about this thread; he told me that all of the information needed to write the converter is available in this thread (and the database schema), and should be possible with the information you have now. If you have any questions about the schema and how certain fields are populated I'd be glad to answer them.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: write a custom HH converter

Postby sfinktah » Sun Jan 24, 2010 2:39 am

With all due respect, RTFM is an acceptable answer. "Read the fracking schema" is not. It's not only unacceptable, it's nonsensical. How is a database schema going to answer this question?

I've read the forum. And I found this post.

Since support is not forthcoming I will post what I have learned about the "bare minimum" requirements of hand history writing through trial and error.

Which is quite a lot actually.

I have code that works for 85% of hands (PHP), and will post when it's working the remaining 15%. I think the majority of the 15% failure rate is a basic misunderstanding between myself and Everest... or perhaps I just misunderstand :)

Here is an example of both my 15% issue, and a bare minimum hand.

Invalid pot size/winnings for hand #12211125344801 (calculated pot: $2,000; reported winnings: $3,000) (Line #12)

Code: Select all
EverestPoker Game #12211125344801: Table Phoenix - $1000/$2000 - No Limit Hold'em - 16:25:34 - 2010/01/23
Seat 6: Hero ($13,000)
Seat 9: Villian ($112,000)
Hero posts the small blind of $1,000
Villian posts the big blind of $2,000
The button is in seat #6
*** HOLE CARDS ***
Dealt to Hero [7c Ts]
Hero folds
*** SUMMARY ***
Villian collects $3,000


I know this is most likely my stupidity... but if the small blind ($1) folds to the big blind ($2), then the big blind has collected a pot comprising of his blind and your blind, or $3. That (in my mind) should be the size of the pot, and the amount the Villian collects,

However, I guess I'm wrong... the only explanation being that since the small blind failed to call the bet, the difference is being returned to the winner.

Ergo, that history should probably read:

Code: Select all
Hero posts the small blind of $1,000
Villian posts the big blind of $2,000
...
Hero folds
Uncalled bet of $1,000 returned to Villian
*** SUMMARY ***
Villian collects $2,000


The "Uncalled bet" line probably being optional.

It doesn't feel right to me - but I can't argue with history file format. Is this practice "standard" ?

For the true minimalists, it equally as possible to express this (or any hand) in an even more compact fashion:

Code: Select all
EverestPoker Game #12211125344801: Table Phoenix - $1000/$2000 - No Limit Hold'em - 16:25:34 - 2010/01/23
Seat 6: Hero ($0)
Seat 9: Villian ($0)
Hero posts the small blind of $1000
Villian posts the big blind of $2000
The button is in seat #6
*** HOLE CARDS ***
Dealt to Hero [7c Ts]
Hero folds
*** SUMMARY ***
Villian collects $3000


There's no need to establish starting balances, or supply commas or decimal points in the numbers.

Here is a (hopefully) working hand, demonstrating pretty much everything. I've included some nominal formatting of the numbers for readability.

Code: Select all
EverestPoker Game #12283955294970: Table SanAntonio - $1000/$2000 - No Limit Hold'em - 16:24:50 - 2010/01/23
Seat 1: Joe ($24,000.00)
Seat 2: Fred ($16,000.00)
Seat 3: Hero ($62,000.00)
Seat 4: Traci ($6,000.00)
Seat 5: James ($50,000.00)
Seat 6: Mocha ($33,000.00)
Seat 7: Flasher ($28,000.00)
Seat 8: Prancer ($18,000.00)
Seat 9: Gabe ($32,550.00)
Joe posts the small blind of $1,000.00
Fred posts the big blind of $2,000.00
Prancer posts the big blind of $2,000.00
The button is in seat #9
*** HOLE CARDS ***
Dealt to Hero [Qh Th]
Hero calls $2,000.00
Traci raises to $6,000.00, and is all-in
James folds
Mocha calls $6,000.00
Flasher calls $6,000.00
Prancer calls $4,000.00
Gabe folds
Joe folds
Fred calls $4,000.00
Hero folds
*** FLOP *** [9s 9d 4c]
Fred checks
Mocha checks
Flasher raises to $22,000.00, and is all-in
Prancer folds
Fred folds
Mocha folds
Traci shows [3h 8h]
Flasher shows [7s 7c]
*** TURN *** [4h]
*** RIVER *** [7d]
Uncalled bet of $22,000.00 returned to Flasher
*** SUMMARY ***
Traci shows [3h 8h]
Flasher shows [7s 7c]
Flasher collects $33,000.00


    Raises are expressed as the total amount of bet that must be matched, regardless of previous betting.
    Calling is expressed as the number of extra chips require to match the current bet.
    As per above statement, if a player has put in a $1,000 small blind, and the bet is $10,000, the history will show "Player calls $9,000"
    If the raising player does not have his bet matched, he must have it returned as uncalled.

I think that is pretty darned simple, and I'm fairly happy. I'd be happier if I could express calls as total amounts, rather than differences... but obviously PT3 isn't responsible for the the format of the Everest history file.

I'm also quite appreciate that PT3 ignores the many lines of comments and errors and notes I output in the hand history, and simply takes what it needs whilst still kicking up a stink if things don't add up.

I have now purchased my PT3 license, and look forward to seeing how the OS X version progresses. It won't import Everest hands, but I'm hoping it will still display the data that I'm importing using the Windows version.
sfinktah
 
Posts: 15
Joined: Sat Jan 09, 2010 5:44 am

Re: write a custom HH converter

Postby sfinktah » Sun Jan 24, 2010 2:48 am

Here's that hand converted in FTR format (which I don't really like) .. but it's useful to test with. Obviously there is a small issue with the rake.

Everest No-Limit Hold'em, $2000.00 BB (9 handed) - Everest Converter Tool from FlopTurnRiver.com

SB ($24000)
BB ($16000)
Hero (UTG) ($62000)
UTG+1 ($6000)
MP1 ($50000)
MP2 ($33000)
MP3 ($28000)
CO ($18000)
Button ($32550)

Preflop: Hero is UTG with QImage, 10Image
Hero calls $2000, UTG+1 bets $6000 (All-In), 1 fold, MP2 calls $6000, MP3 calls $6000, CO (poster) calls $4000, 2 folds, BB calls $4000, 1 fold

Flop: ($33000) 9Image, 9Image, 4Image (5 players, 1 all-in)
BB checks, MP2 checks, MP3 bets $22000 (All-In), 3 folds

Turn: ($33000) 4Image (2 players, 2 all-in)

River: ($33000) 7Image (2 players, 2 all-in)

Total pot: $33000 | Rake: $32967
sfinktah
 
Posts: 15
Joined: Sat Jan 09, 2010 5:44 am

Re: write a custom HH converter

Postby sfinktah » Sun Jan 24, 2010 3:19 am

Addendum:

Although I have not tested this extensively, it does seem possible to express a hand almost entirely with the verb "raises to"... which means you don't have to keep track of as much data...

I like this a lot, because it means that the first round betting of players in the blinds is less confusing:

Correct way:
Code: Select all
Joe posts the small blind of $1,000.00
Fred posts the big blind of $2,000.00
Prancer posts the big blind of $2,000.00
...
Hero raises to $2,000.00
Traci raises to $6,000.00, and is all-in
Mocha raises to $6,000.00
Flasher raises to $6,000.00
Prancer raises to $4,000.00
Fred calls $4,000.00


Incorrect, but functionally equivalent and IMHO much neater.
Code: Select all
...
Hero raises to $2,000.00
Traci raises to $6,000.00, and is all-in
Mocha raises to $6,000.00
Flasher raises to $6,000.00
Prancer raises to $6,000.00
Fred raises to $6,000.00


It is likewise unnecessary to use the verb "bet", and as my latest test has just shown, even checking can be expressed as a raise. The uncalled bets didn't seem to be missed, nor did any pretense at establishing starting balances or "all-in" statuses.... although this hand is not complex enough to fully confirm this...

Without any further delay - here is the worlds laziest hand history format. I encourage you never to use it.

Code: Select all
EverestPoker Game #4975: Table SanAntonio - $1000/$2000 - No Limit Hold'em - 16:24:50 - 2010/01/23
Seat 1: Joe ()
Seat 2: Fred ()
Seat 3: Hero ()
Seat 4: Traci ()
Seat 5: James ()
Seat 6: Mocha ()
Seat 7: Flasher ()
Seat 8: Prancer ()
Seat 9: Gabe ()
Joe posts the small blind of $1000
Fred posts the big blind of $2000
Prancer posts the big blind of $2000
The button is in seat #9
*** HOLE CARDS ***
Dealt to Hero [Qh Th]
Hero raises to $2000
Traci raises to $6000
Mocha raises to $6000
Flasher raises to $6000
Prancer raises to $6000
Fred raises to $6000
Hero folds
*** FLOP *** [9s 9d 4c]
Fred raises to $0
Mocha raises to $0
Flasher raises to $22000
Prancer folds
Fred folds
Mocha folds
*** TURN *** [4h]
*** RIVER *** [7d]
*** SUMMARY ***
Traci shows [3h 8h]
Flasher shows [7s 7c]
Flasher collects $33000
sfinktah
 
Posts: 15
Joined: Sat Jan 09, 2010 5:44 am

Re: write a custom HH converter

Postby WhiteRider » Sun Jan 24, 2010 5:18 am

When everyone folds to the BB the part of his "bet" that wasn't called by the SB is returned, so isn't part of the pot.
Similarly if someone raises to 3BB and everyone else folds the "extra" 2BB is returned, he doesn't "win" it.
WhiteRider
Moderator
 
Posts: 54017
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: write a custom HH converter

Postby tarix » Sun Jan 24, 2010 9:58 am

sfinktah wrote:Since support is not forthcoming I will post what I have learned about the "bare minimum" requirements of hand history writing through trial and error.


This is extremely unfair to our support staff who do an outstanding job. I've written two of the hand history importers since starting here and fixed many bugs with the others, but because we parse completed hand histories we never really think about what we actually use and don't use. Also we do our parsing in three stages since the back-end is obviously reused for every site.

Furthermore almost every site has generated bad hand histories at some point in the sites lifetime. That accounts for a lot of the information we ignore or calculate ourselves.

There is no minimal format for any of the sites. We try to take all of the information and use it for cross-checking. However when we detect errors we generally trust our calculations over the hand history ones. When we find discrepancies that can't be accounted for then we throw errors.

The simple answer to all of your questions is that you must provide all of the information that any sites provides because our parsers are expecting that information. We would be extremely happy if sites used hand histories that were easy to parse and were always correct and consistent. Unfortunately that is not the case and we've had to adjust our software to compensate.
tarix
Developer
 
Posts: 3760
Joined: Tue May 20, 2008 2:49 pm

PreviousNext

Return to General [Read Only]

Who is online

Users browsing this forum: No registered users and 30 guests

cron
highfalutin