• Advertisement
Sign in to follow this  

AI Poker Contest

This topic is 4792 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey Guys, I have been doing some brainstorming about writing a program to play poker, and was wondering how many people would be willing to participate in a little tournament. Participants would create code which would play poker with other bots. I could write a simple wrapper class which would act as a dealer and would keep score. I could provide a simple interface for you to use. I would most likely write everything in C++. However, we can tlak about it, I am up for ideas. Since I am just a normal person, I can not give out a prize to the winner, but we might be able to figure something out later if everything gets going. So I guess I would like to know who would participate, and if a C++ interface would be ecceptable. I havn't decided on a format yet, but if enough people sound interested I'll whip something up and we can go from there. Dwiel [Edited by - Dwiel on January 7, 2005 9:08:08 PM]

Share this post


Link to post
Share on other sites
Advertisement
How bout this.

We each hand up sources, which compile up to an executable.

Your program executes each in turn, with arguments which correspond to the input file and the output file.

Each program takes the game state from the input file, and puts its decision into the output file. It then promptly exits.

This would allow you to use other programming languages, making it a bit farer, don't you think?

From,
Nice coder

Share this post


Link to post
Share on other sites
sounds good. I can do that.

I guess the other thing that needs to be decided is which poker game to play.

I would say probably something simple to start, such as 5 card draw, 5 card stud, texas holdem, etc.

any suggestions?

Dwiel

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Nice Coder wrote:
> Each program takes the game state from the input file, and puts its decision
> into the output file. It then promptly exits.
>
> This would allow you to use other programming languages, making it a bit farer,
> don't you think?

A big downside to doing things this way is that the AI would not be able to look at trends in it's opponents actions. Maybe it would be better to take in a log of all of the actions taken in the game so far as well as the current state.

Texas holdem would probably be the hardest to program since it seems to involve more strategy with the shared cards. Probably a five card variant would be easiest but maybe less interesting.

Either way it sounds like an interesting idea. On slashdot a while back there was an article about online gambling sites becoming afraid of poker AIs. In the article they refrenced the University of Albetra's research project http://www.cs.ualberta.ca/~games/poker/ In general it seems like poker is just as hard if not harder than things like chess.

Share this post


Link to post
Share on other sites
How about a variety of game types? Some types are more about betting than actual prediction though, so why not make betting part of the game too? This makes types such as texas holdem worth it.

Share this post


Link to post
Share on other sites
I think this is a cool idea...

Hold em' is deffinatly more about betting than prediction.

I think the best way to do it is just have a provided front end, and fill in the interface. Then on the ui you could just set a bot to use a set function. (i.e. through a function pointer)

The interface may look something like this: (note very basic, not thought out to well)

struct Action
{
BetType typeOfAction; //check, call, bet, raise
unsigned int iBetAmount; //amount of chips
};

struct Player
{
int bankroll; //total bank roll in front of them
char seatNumber; //what seat are they sitting at
void * otherPlyrsTraits; //history of hands played... used to hold
//strong/weak player etc.
}
struct Table
{
int pot; //total amount of pot
Card flop[3]; //three cards
Card turn; //fourth card
Card river; //fifth card

Player * playerList; //people involved in the hand could hold history of
//hands etc...

Action curPositionAction; //current action on table
};

Decision HoldEmBotAI(const Table & table, Player * pMyself);

Maybe something like that?

Share this post


Link to post
Share on other sites
I also think that would be a good way to do it, only that makes it so that only one language can be used. Although, I do think it would be much easier to do it this way. I assume that everyone who would be interested wouldn't mind coding in C/C++? Maybe if it my UI simply calls a function out of a dll, any language that compiles to a dll would then also be available.

I'll start work on a generic card game and probably make a few simple ones, then let people dive in.

I should have a working prototype in a couple of days. I like how holdem in that it is more about the betting than pure odds. Although this might make it harder...

well, keep letting me know what you guys think and I'll try to get something going soon.

More ideas are very welcome. (I'm gonna use something similar to CompileTime's suggestion probably in C)

Dwiel

Share this post


Link to post
Share on other sites
why not code the players as plug-ins (shared libs) and have an app to load them, deal and exchange the data between them? This could end up being a nice game.-

Share this post


Link to post
Share on other sites
meh one language who cares... I don't think it's that big of a deal...

Owl's idea is intriguing. Depends on how much work you want to put in it.

Good luck, on the font end!

Share this post


Link to post
Share on other sites
Look, if its on C/C++, I'm out.

I don't know poker, but i should at least be able to make a half-desent bot. Given enough time.

Perhaps we could use that suggestion. Just make an easy to use spec, please!

Draw poker doesn't seem that hard..... Definitly be nice to make tho, either way...

Texus hold em, is also nice.

From,
Nice coder

[Edited by - Nice Coder on January 8, 2005 1:38:09 AM]

Share this post


Link to post
Share on other sites
I've been thinking about this a little.

One thing everyone is going to need to consider, is the ai needs to be scalable. What I mean is, the ai for a heads up game plays a bit looser than a half table (5 people) or a full table (10 people) just a tidbit for all those who plan to make a competitive ai need to think about.

Dwiel if you have any questions/need suggestions feel free to ask, as I'm a huge poker fan and consider myself a fairly decent player. Hopefully I have time to be apart of this, although things are becomming hectic. If not I'd love to write up some quick pseudo code as to how I'd implment it for anyone that wants to go ahead and implment a more complete version.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Standard input and output streams can be used to allow all languages and still have the bots running all the time (they can keep logs or whatever).

The dealer program opens a pipe to all the bots and sends them input and waits for output. The bots themselves can just use iostreams, printf/scanf, or any other standard io avaliable in the language.

Share this post


Link to post
Share on other sites
That sounds great AP, only I am going to need to have one 'dealer' program with many players or bots. I'm not sure how I would send info from the dealer to the player back to the dealer to the next player, back to the dealer, etc. Could you use an example?

Thanks.

I simple C interface shouldbe up soon.

Dwiel

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
http://www.rt.com/man/popen.3.html

Open each program as a FILE* resource, and then use fscanf and fprintf to send text to and from it. All the bot programs will just use scanf and fprintf (or System.out.println or whatever is avaliable) to send text as well.

The commands would be simple text lines telling about the moves and visible cards of other players or sending your own moves to the server. The pipe calls (and scanf in the bots) will block until there is input, so the thing can be run in a simple loop (print other moves, both wait and read the move from bot with fscanf). The same applies to the bots.

Share this post


Link to post
Share on other sites
The lang i'm using (VB6, a RAD language makes short work of problems like this :)) dosn't have any handling of Input/output streams. Arguments yes, not streams. (Windose GUI only, but i'm probably not going to need to open a window [grin]).

Hence why i asked for my approach, it makes sure that i can play too :p
It'll compile into an activex dll, tho.

From,
Nice coder

Share this post


Link to post
Share on other sites
I will do both. First dll support, then I will get the piping to work. I didn't realize it was that easy.

Thanks for the info!

Although from what the article says, you can only open a file for reading OR writing, not both. would I need to open the file twice? That seems like it would invoke the program twice...

Sorry if I am missing something simple.

Will have a dll version available soon

Dwiel

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
From this tutorial: http://www.tldp.org/LDP/lpg/node9.html
Quote:
Two way pipes can be created by opening up two pipes, and properly reassigning the file descriptors in the child process.


I'm not sure how that would be done exactly, but it is possible.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement