Poker2x W.i.p.


DaveN

Digger
Joined
Jun 7, 2006
Messages
335
Website
Visit site
[Edit: Released!]

Poker2x_1.png


Go to the archive for the download ( if there isn't the HotFix version avaible, remember to download this one later to get rid of the flickering ).

Go to the news section for the thread.
 
Last edited by a moderator:
DaveN posted on Jul 17 2006 at 06:21 PM said:
So, since there are already 4 threads asking about a poker game and because I'm also into poker, I decided to give it a go. It's my first real game coding attempt in C++, I already coded in some Basic languages, a little Jave, Flash and some scripting engines for game engines. I'm pretty surprised since all the guys are talking about c++ like it's a fucking hard language to do, but it isn't to different compared with other languages and not too hard to learn.

Anyway, at the moment you're able to play a round of poker ( against yourself ) in a text-terminal. I'm debugging it now, and also I'm rewriting some parts of the code to make it more re-usable.

The most important things that are on the to-do list are an a.i. and a gui. The latter one isn't too hard, it's the a.i. that is hard to code. I'm really into coding a.i.'s, but I'm not too awesome at poker and poker a.i.'s are pretty hard to do. So I'm asking about some input on this topic. I've wrote a small document containing some thougts and all the things that should be viewed by the a.i. before it's betting or folding, but I'm sure there are some thigns left. I'd be really happy if some poker players here could give me some advice in that. Like some links about the topic or even a list with ratings of the possible starting hands. Something like this would be really helpful:

Ass + Ten of same kind -> Should raise in 68% of the games.
Ass + Ten of different kind -> Should raise in 40% of the games.

And also, if you've got some advices on how the menu, the in-game menu etc. should look, please post them. Or if you're just happy that someone's finally doing that,

Oh, and for a beta-data; I haven't got any idea by now. It could be in three days or in five weeks.

Cheers, David

Darse Billings leads a group which is working on Poker at the University of Alberta: Poker at Alberta. I don't know anything about their work, but there should be something useful there.

I've been working on a 5-card draw "video poker" game, but that is like those slot-machine things and it doesn't have any AI at all. You're welcome to the code if you want it. It might be useful for displaying cards etc.
 
Last edited by a moderator:
evening2005 posted on Jul 17 2006 at 08:15 PM said:
Darse Billings leads a group which is working on Poker at the University of Alberta: Poker at Alberta. I don't know anything about their work, but there should be something useful there.

I've been working on a 5-card draw "video poker" game, but that is like those slot-machine things and it doesn't have any AI at all. You're welcome to the code if you want it. It might be useful for displaying cards etc.

I've found this link on the page you linked, seems to be quite useful: http://spaz.ca/poker/. Thanks for the link.

Displaying things on the screen really isn't too hard :) I've done a lot of small demos with multiple topics, even if this is my first 'real' game, I've got some experience in c++. And also I've coded a Spy Vs. Spy clone in flash, but the fucking drive crashed and was unusuable. I also lost all of the c++ demos.
But thanks a lot for the offer, I'm sure I could learn something out of your code. I'm interested in the way you've managed rating the hands and how your card class ( if there is one ) is build ( build or built? ) up.

@ryleh:
I'm thinking about it, but there's enough of it right here. But Thanks :)

Cheers, David.

PS: One question, I'm using srand(SDL_GetTicks()); to get a new random value everytime. Does the GP2X also support the ctime library? I'm not sure about that since the gp2x hasn't got a built-in clock. I'd prefer to use 'time' to get completly random values all the times. With SDL_GetTicks() there could be the same values.
I know it's a small chance that this happens, but I'd prefer it to put this chance down to zero.
 
Last edited by a moderator:
rlyeh posted on Jul 17 2006 at 01:16 PM said:
if you need to photo a dirty top model for your game, just drop me a mail ;-)
Dude, it's ryleh!!!!!!! :D Hey dude hows your work on fday going? :huh: :)
 
Last edited by a moderator:
Quiest posted on Jul 17 2006 at 11:02 PM said:
Woah nice :D Texas Hold`em? I hope :D
Yes :)

Just rewrote a big part the bedding class and completly commented the whole code in the smallest details. Just in case I'll loose interest in this and somebody else wants to continue this or if I'll pick this up again. But in the moment it looks like this won't happen. I'm now taking a break of coding and I'll do some basic graphics. NoidZ hopefully will do the final one's.

After reading a bit about poker ai's, It looks like I'll have to write a completly new one, but since the gp2x isn't too fast, it can't analyze too much. Could be nice but also the ai may be bad, but I think I'll be able to get one that plays on a 'saturday evening men's round' level or something a little higher than that.

Oh, and..
PS: One question, I'm using srand(SDL_GetTicks()); to get a new random value everytime. Does the GP2X also support the ctime library? I'm not sure about that since the gp2x hasn't got a built-in clock. I'd prefer to use 'time' to get completly random values all the times. With SDL_GetTicks() there could be the same values.
I know it's a small chance that this happens, but I'd prefer it to put this chance down to zero.

Cheers, David
 
Last edited by a moderator:
UPDDATE: The AI is working! It isn't on world class niveau, but it plays on a hobby stage, where the players usually just look at their own cards and then take a decision depending on this. It is around 1000 lines ( not so much for an ai ) and it for sure isn't finished now, but I think it plays as well as most of the people here on the forums. And it is cusomisable for every different enemy with factors like the 'riskyness' and so on.

The code aspects for the game are now temporarily finished, so I'll go working on the gui now. I've already drawed some graphics that will be in a beta version. The final product is themable and likely will have another default graphics set.

The cards sprite sheet:

[Edit: Klick on the picture to see it in a better resolution]

[Edit: Menu changed, link removed ]

Cheers, David
 
Cool! I'd love to play holdem on my gp2x! How will the game mechanics work (eg. tournament style/rebuys, # of AI players, blinds/anti, limit/no limit, etc.)?
 
dsd28 posted on Jul 18 2006 at 10:15 PM said:
Cool! I'd love to play holdem on my gp2x! How will the game mechanics work (eg. tournament style/rebuys, # of AI players, blinds/anti, limit/no limit, etc.)?
Now there are the rules of our poker round, that's tournament style with no limit and 5 players.

But these are things that are really easy to change. For the most of them it's just like changing one variable, so I'll go for an option menu.

@Magnulus:
Exactly the reaction I hoped for :) Thanks.


At the moment I'm drawing some other card sheets, I'm not in the mood for coding right now. Will start tomorrow with the gui.
 
Last edited by a moderator:
Magnulus posted on Jul 19 2006 at 12:00 AM said:
On another note, are the tilemaps saved in an easily exchanged manner? Would it be easy for you to incorporate custom decks? That'd be rockin'.

They will be .png or .gif files stored in a folder in the same directory as the .gpe file. So they will be easily exchangeable. A in-game deck-chooser wouldn't be too hard, it would just have to browse the directory, find the files, list them, and then change one line in the image loading code to load the selected one.
I've got no idea how file browsing on the gp2x works from inside an application, but that isn't the first priority as well. Until this will be implented, you'll have to replace the file with your custom deck. That isn't too hard either.

By the way, I've devided to change the default rules to a limit 10/20 table. My favourite one to play, and also a popular one in online poker. I'm also thinking about adding more players, what do you all think about that?
 
Last edited by a moderator:
DaveN posted on Jul 18 2006 at 07:08 PM said:
Magnulus posted on Jul 19 2006 at 12:00 AM said:
On another note, are the tilemaps saved in an easily exchanged manner? Would it be easy for you to incorporate custom decks? That'd be rockin'.

They will be .png or .gif files stored in a folder in the same directory as the .gpe file. So they will be easily exchangeable. A in-game deck-chooser wouldn't be too hard, it would just have to browse the directory, find the files, list them, and then change one line in the image loading code to load the selected one.
I've got no idea how file browsing on the gp2x works from inside an application, but that isn't the first priority as well. Until this will be implented, you'll have to replace the file with your custom deck. That isn't too hard either.

By the way, I've devided to change the default rules to a limit 10/20 table. My favourite one to play, and also a popular one in online poker. I'm also thinking about adding more players, what do you all think about that?

I like no limit better (if that is what you meant by "change the default rules to a limit 10/20 table" - I'm a noob at online poker). Maybe you could make it selectable?
 
Last edited by a moderator:
dsd28 posted on Jul 19 2006 at 02:39 AM said:
I like no limit better (if that is what you meant by "change the default rules to a limit 10/20 table" - I'm a noob at online poker). Maybe you could make it selectable?

I made it default at the moment. Or better said, No Limit is disabled now, since coding an ai for no limit is much harder that coding one for limit. My ai plays really well at limit, but it's got some problems with no limit, so it will be disabled until I make the ai better. At the moment I'm changing the players from 5 to 8 and somehow got a problem with the compiler. A function that doesn't even use the changed variable now is bugging around. :huh:

Nya, I'll get that soon or later.. *gets a cup of coffee*

Edit: After nearly one and a half hour of reading code, compiling, seeing error messages, adding new debugging code, etc. I finally found the bug:
'ai ai_list[4];' IS NOT 'ai ai_list[6];'
And somehow the code ran like 200 lines after the first use of ai_list[5] and then he gave me a completly different error message that said it has got a problem with assigning two string. And finally I've thrown my coffee pot at my bed because I was pissed off, and now I'll have to clean that. God damn, that's exactly what I hate about coding.
 
Last edited by a moderator:
hitbyambulance posted on Jul 19 2006 at 09:33 AM said:
i believe that should be the title (or subtitle) of your game. "Saturday Evening Men's Round Poker"
Hmm.. Maybe as a subtitle. Or as the title. I'll think about it.

So, I've made multiple basic layouts that show different ways how the in-game screen could look like. The colors aren't the important thing here, I'd just like to hear your thoughts about the best one, or some other ways to do it. This part will be themable as well, but the positions of the cards can't be changed by the user ( at least not in the first versions ).

The important thing here is which way should be choosed ( graphic or text ) and where the should cards be on the screen.

[Edit: Layouts removed, thanks for the input :) ]
 
Last edited by a moderator:
DaveN posted on Jul 18 2006 at 10:23 PM said:
Now there are the rules of our poker round, that's tournament style with no limit and 5 players.

God thanks, n/l :D

I`ll bow before you for even attempting to make this game, thx! :)
 
Last edited by a moderator:
Back
Top