Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #71  
Old 08-01-2007, 05:21 PM
MuppetBingo MuppetBingo is offline
Member
 
Join Date: Apr 2007
Posts: 31
Default Re: Poker Hand XML

Thanks for your comment, there's 4 ways to handle antes I think:

1) Have an ante-attribute on <rounds>, it would then be implicit that every player that is not sitting out will pay the ante before the first round.

2) We could assume that ante was taken out before we started the hand (as you suggest), but then we should have a "initialPotsize" somewhere to say how much was taken out in ante

3) The way I have done above, with an <antes> block

4) put antes into the first round as forced actions before small and big blinds.

I initially went with 4), but I think that becomes a bit t cumbersome and I think option 1) is probably the best solution, ie. to remove the <antes>-block and add an optional "ante" attribute on <rounds>.

Having ante taken out of the stack sizes before the hand begins is not as good, because I think paying ante is something that happens during a hand of poker, not before.

---
Version 1.2

* removed <antes> block
* added optional ante attribute on rounds
* changed attribute sittingout to active in <players> block. We now don't distinguish between those that were sitting out before we began the hand, and those who chooses not to pay blinds or antes and "active" is a more generic term.

<font class="small">Code:</font><hr /><pre>
&lt;?xml version="1.0"?&gt;
&lt;pokerhand id="11082740019" timestamp="2007-07-31 11:21:43"&gt;
&lt;context&gt;
&lt;location online="true"&gt;
&lt;room name="Absolute Poker" /&gt;
&lt;table id="562102981" name="Denmark Dr." seats="10"/&gt;
&lt;/location&gt;
&lt;!-- betting-types=nolimit, potlimit or limit --&gt;
&lt;game type="texasholdem" format="tournament" bettingtype="nolimit"&gt;
&lt;!-- only use either tournament or cashgame tag --&gt;
&lt;tournament buyin="10" vig="1" id="56210298" currency="USD"/&gt;
&lt;!-- we need both stakes and max buyin I guess? --&gt;
&lt;cashgame maxbuyin="400" bigblind="2" currency=""/&gt;
&lt;/game&gt;
&lt;players&gt;
&lt;player id="MuppetBingo" stack="1500" seat="1" active="true"/&gt;
&lt;player id="KermitIsGreen" stack="1500" seat="4" active="true"/&gt;
&lt;player id="Animal" stack="1500" seat="5" active="true"/&gt;
&lt;/players&gt;
&lt;/context&gt;
&lt;!-- ante is an optional attribute, which is put into the pot by every player that is not sittingout --&gt;
&lt;rounds ante="2"&gt;
&lt;!-- a round is a deal of cards followed by a sequence of player actions --&gt;
&lt;!-- possible round types are "preflop", "flop","turn", "river" --&gt;
&lt;round id="preflop"&gt;
&lt;!-- in 7 card stud deal will be a sequence of &lt;cards&gt; for each player, in texas-style games it will only contain 1 element --&gt;
&lt;deal&gt;
&lt;!-- open means whether the cards are visible to all. In stud there can be open non-community cards --&gt;
&lt;cards playerId="MuppetBingo" open="false" value="Ac Ad"/&gt;
&lt;/deal&gt;
&lt;!-- actions can be &lt;bet&gt; &lt;call&gt; , &lt;fold&gt; --&gt;
&lt;actions&gt;
&lt;!-- amount is optional, --&gt;
&lt;!-- forced is optional and if omitted, will default to "false" --&gt;
&lt;!-- possible types=bet, call, check or fold. --&gt;
&lt;!-- name is optional, possible values = straddle, smallblind and bigblind --&gt;
&lt;action type="bet" playerId="MuppetBingo" forced="true" name="smallblind" amount="10"/&gt;
&lt;action type="bet" playerId="KermitIsGreen" forced="true" name="bigblind" amount="20"/&gt;
&lt;action type="bet" playerId="Animal" forced="false" name="straddle" amount="40"/&gt;
&lt;action type="bet" playerId="MuppetBingo" amount="10"/&gt;
&lt;action type="bet" playerId="KermitIsGreen" amount="30"/&gt;
&lt;action type="call" playerId="Animal" amount="30"/&gt;
&lt;action type="call" playerId="MuppetBIngo" amount="20"/&gt;
&lt;/actions&gt;
&lt;/round&gt;
&lt;round id="flop"&gt;
&lt;deal&gt;
&lt;!-- playerId is optional, and if not present it means the cards are community cards --&gt;
&lt;cards open="true" value="7c 2s Qh"/&gt;
&lt;/deal&gt;
&lt;actions&gt;
&lt;action type="check" playerId="MuppetBingo" /&gt;
&lt;action type="bet" playerId="KermitIsGreen" amount="50"/&gt;
&lt;action type="fold" playerId="Animal"/&gt;
&lt;action type="call" playerId="MuppetBIngo" amount="50"/&gt;
&lt;/actions&gt;
&lt;/round&gt;
&lt;round id="turn"&gt;
&lt;deal&gt;
&lt;cards open="true" value="9h"/&gt;
&lt;/deal&gt;
&lt;actions&gt;
&lt;action type="check" playerId="MuppetBingo"/&gt;
&lt;action type="check" playerId="KermitIsGreen"/&gt;
&lt;/actions&gt;
&lt;/round&gt;
&lt;round id="river"&gt;
&lt;deal&gt;
&lt;cards open="true" value="Kc"/&gt;
&lt;/deal&gt;
&lt;actions&gt;
&lt;action type="check" playerId="MuppetBingo" /&gt;
&lt;action type="check" playerId="KermitIsGreen" /&gt;
&lt;/actions&gt;
&lt;/round&gt;
&lt;/rounds&gt;
&lt;result&gt;
&lt;hands&gt;
&lt;!-- mucked attribute is optional and has default value="false", cards is optional --&gt;
&lt;hand playerId="MuppetBingo" mucked="false" cards="Ac Ad"/&gt;
&lt;hand playerId="KermitIsGreen" mucked="false" cards="As Ks"/&gt;
&lt;hand playerId="Animal" mucked="true"/&gt;
&lt;/hands&gt;
&lt;pots value="278.5" rake="1.5"&gt;
&lt;pot number="1" value="278.5"&gt;
&lt;winners&gt;
&lt;!-- for split pots, this will contain multiple winners --&gt;
&lt;winner playerId="MuppetBingo" amount="278.5" winningHand="Ac Ad Qh Kc 9h"/&gt;
&lt;/winners&gt;
&lt;/pot&gt;
&lt;/pots&gt;
&lt;/result&gt;
&lt;/pokerhand&gt;
</pre><hr />
Reply With Quote
  #72  
Old 08-01-2007, 05:24 PM
MuppetBingo MuppetBingo is offline
Member
 
Join Date: Apr 2007
Posts: 31
Default Re: Poker Hand XML

btw. I agree with someone who wrote that we shouldn't try to nail the spec completely before implementing anything, though we're still in the early stages.

But when we agree on some pokerhand-xml-definition, people should try to implement a couple of converters to see if everything can be captured properly, and then revisit the spec.
Reply With Quote
  #73  
Old 08-01-2007, 05:28 PM
OrcaDK OrcaDK is offline
Senior Member
 
Join Date: Nov 2004
Location: MTH
Posts: 1,496
Default Re: Poker Hand XML

[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
I still think I'd prefer cards coactenated. It's trivial to parse them, it takes up much less space and makes the hand a little easier on the eye. But whatever...

[/ QUOTE ]

But they are each a seperate piece of data

[/ QUOTE ]

I've given two advantages of combining them. And the advantage of separating them is?

[/ QUOTE ]

Concatenating them is illogical as each card is a logical unit, not the two (or more) cards together.

Concatenating the cards makes it tough to write proper value validation. Keeping the separate would enable validation through a very simple regexp, concatenating them makes this more difficuelt as there could potentially be an unlimited number of cards, making it nonderterministic (making it impossible to validate through DTD for instance).

Concatenating them makes XPath expressions tougher, most XPath engines don't have a "LIKE" operator so it would be cumbersome to simple make a //card[@value='Ac'] lookup to find all aces of clubs.

The space saving of concatenating the cards is neglectable imho. It also makes it simpler to determine the amount of cards simply by the amount of elements, instead of having to parse an attribute.

Imagine we were to save this XML document in a database (take SQL Server 2005 that supports the XML datatype and inline XPath in SQL), if we were to make a query like "how many cards does the average showdown hand include, combining all games), then we'd have to write complex inline SQL code to count the number of delimiting chars to determine the amount of cards - and this is per hand. It would be a lot easier to just count the number of card elements inline.
Reply With Quote
  #74  
Old 08-01-2007, 05:35 PM
OrcaDK OrcaDK is offline
Senior Member
 
Join Date: Nov 2004
Location: MTH
Posts: 1,496
Default Re: Poker Hand XML

The XML should never contain any textual descriptions of hands. Following are a couple of examples:

&lt;position="3" hand="[Kd Qd] Td 3d 2d (King-high Flush)" result="win"&gt;
&lt;position="4" hand="[3c 3h] 3d Kh Jc (Three of a kind)" result="muck"&gt;

&lt;player _name="player3" showed_hand="true" ALLIN="1" stack="381" cards="3d4h5h7h6c8h5s" hi_hand="HI: a straight, Four to Eight" lo_hand: LO: 7,6,5,4,3" seat="3"/&gt;

It should be up to the application to determine the hand description. We can have a descriptor that - in a standardized way - says the hand strength, just not using descriptions like "HI: a straight, Four to Eight".

It's going to be a hell to write a validator if we have these inline descriptions, and that's just one more thing that'd have to be standardized for this to be working.
Reply With Quote
  #75  
Old 08-01-2007, 05:37 PM
Triggerle Triggerle is offline
Senior Member
 
Join Date: Oct 2005
Location: What\'s a matter with you, rock?
Posts: 1,439
Default Re: Poker Hand XML

The problem with excluding the ante block is that some games require sitting out players to post an ante, for example tournaments.

It takes some reverse tracking/logic to see if that is the case with the ante as an attribute.
Reply With Quote
  #76  
Old 08-01-2007, 05:41 PM
Shoe Lace Shoe Lace is offline
Senior Member
 
Join Date: Sep 2004
Posts: 585
Default Re: Poker Hand XML

[ QUOTE ]
2) We could assume that ante was taken out before we started the hand (as you suggest), but then we should have a "initialPotsize" somewhere to say how much was taken out in ante

[/ QUOTE ]

We wouldn't need any extra fields. The ante's value is what tells us how much was taken out.

Ex.

&lt;hand date="00/00/0000 00:00:00pm" site="Poker Stars" table="Blah" number="#0000000000" currency="$" type="Cash" seats="6" game="Texas Holdem" mode="No Limit" sb="5" bb="10" ante="2"&gt;

Here we are being told the ante is 2, and it is assumed everyone who is not sitting out is paying this price every time a new hand is dealt.

During an evaluation of the hand (in PT/HM/web parser/etc) it only has to check who is not sitting out (players who do NOT post any action are sitting out) and multiply this number by the ante to figure out how much the pot size should be.

Small mathematical calculations take up practically no CPU cycles at all. If this was a serious concern we could simply have a "pot" attribute for each "street" element which tracks the pot size.
Reply With Quote
  #77  
Old 08-01-2007, 05:43 PM
MuppetBingo MuppetBingo is offline
Member
 
Join Date: Apr 2007
Posts: 31
Default Re: Poker Hand XML

@Triggerle

Hmm, I didn't think of that. Then the ante block should probably be reintroduced.


@OrcaDK
The choice to express card values as a string which may contain more than one card, is makes the xml easier to read for humans, and when parsing the xml is also fairly trivial.

But you do have a point with regards to XPath expressions, so, and to satisfy that I think every card should be expressed like so

&lt;cards (other attributes...)&gt;
&lt;card value="a" suit="h" &gt;
&lt;card value="9" suit="c" &gt;
&lt;/cards&gt;
Reply With Quote
  #78  
Old 08-01-2007, 05:48 PM
Shoe Lace Shoe Lace is offline
Senior Member
 
Join Date: Sep 2004
Posts: 585
Default Re: Poker Hand XML

[ QUOTE ]
It takes some reverse tracking/logic to see if that is the case with the ante as an attribute.

[/ QUOTE ]

Not really.

Here's a copy/paste of my earlier layout's header with the addition of antes.

<font class="small">Code:</font><hr /><pre>
&lt;players&gt;
&lt;seat position="1" name="Jack" stack="998" ante="2"&gt;
&lt;seat position="2" name="Jill" stack="998" ante="2"&gt;
&lt;seat position="3" name="Jim" stack="998" ante="2" holecards="Kd Qd"&gt;
&lt;seat position="4" name="Jane" stack="998" ante="2"&gt;
&lt;seat position="5" name="Joe" stack="998" ante="2"&gt;
&lt;seat position="6" name="Julie" stack="998" ante="2"&gt;
&lt;/players&gt;
</pre><hr />

This would subtract the ante from their stack regardless if they're sitting out or not (it's up to the hand history itself to see if everyone is effected or not, but either way it wouldn't effect the end result). This shouldn't need any extra code too because the ante is either 0 or x.
Reply With Quote
  #79  
Old 08-01-2007, 05:49 PM
MuppetBingo MuppetBingo is offline
Member
 
Join Date: Apr 2007
Posts: 31
Default Re: Poker Hand XML

@Shoe Lace

We should try to make everything that is going on in a hand as explicit as possible. Having implicit rules that you have to know, but can't read out of the xml itself, is bad.

And having a running potsize attribute on every round doesn't sound like an improvement on an antes-block.

@Everybody

Can't we use the ISO 4217 codes for currencies instead of "$"? (you can see them at http://www.xe.com/iso4217.php)

Dollars is "USD", British Pounds is "GBP", etc.
Reply With Quote
  #80  
Old 08-01-2007, 05:52 PM
Shoe Lace Shoe Lace is offline
Senior Member
 
Join Date: Sep 2004
Posts: 585
Default Re: Poker Hand XML

[ QUOTE ]
And having a running potsize attribute on every round doesn't sound like an improvement on an antes-block.

[/ QUOTE ]

It has nothing to do with the ante. You said there might be a need for something like "initialPotSize" somewhere. This is unnecessary because the antes are going into the same pot that is being played for in the hand.

Adding the pot size for each street was just an idea that would bloat the xml file and in return the script parsing the file wouldn't have to calc the pot size on each street.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.