Poker-AI.org
http://poker-ai.org/phpbb/

http based php server for poker bots
http://poker-ai.org/phpbb/viewtopic.php?f=22&t=2657
Page 1 of 2

Author:  nefton [ Wed Dec 04, 2013 2:20 pm ]
Post subject:  http based php server for poker bots

The time has come and I need to try my bots in action.
What I need.
-Possibiliti to play several my bots together with each other.
-Possibiliti to play several my bots with me.
-Possibiliti to play several my bots with other people at antipodian side of the Eath.
-Possibiliti to play several my bots together with other bots.
-demonstrative graphs and data.
-....

I think http based protocol and php servers is the best solution for this problem.
welcome to discuss this option.

Author:  MrNice [ Wed Dec 04, 2013 2:37 pm ]
Post subject:  Re: http based php server for poker bots

Hi Nefton,


I have the same idea.... But for start I will use the I will use the server code of ACPC (http://www.computerpokercompetition.org/):

http://www.computerpokercompetition.org ... 34.tar.bz2

regards,

MrNice

Author:  nefton [ Wed Dec 04, 2013 3:35 pm ]
Post subject:  Re: http based php server for poker bots

I had read ACPC protocol. It`s wery pure on my mind. Cases:
1. server can not conect to client on http.
2. grammar of request is hard to process with php page. (variables must transmit like http post request)
3. Client MUST know what in server happen. For example the are a fsm on the server with curent state.
this state based on other player moves and rules. If I wish to write java application to operate human with the server I need write the same fsm in java :shock: It wil twice my work. Why not to transmit available moves throw protocol?

Author:  fraction [ Wed Dec 04, 2013 3:38 pm ]
Post subject:  Re: http based php server for poker bots

It's basically stateless. For interaction with other bots you can model each bot as a restful server and use a browser to co-ordinate the plays/bankroll etc. If you publish the REST endpoints, what they expect and what they return (POST a gamestate, return an action) then you could easily hook /any/ two bots up together without either party revealing their code. Plus JSON is easy to work with and it's easy to implement overal.

It'd also be really easy to set up so humans could play vs the bots via a webpage too.

Author:  nefton [ Wed Dec 04, 2013 3:59 pm ]
Post subject:  Re: http based php server for poker bots

fraction wrote:
you can model each bot as a restful server

Then other bots need external IP to configure its as a server. (why? )
And in general this decentral system is hard to install and support

Author:  fraction [ Wed Dec 04, 2013 5:48 pm ]
Post subject:  Re: http based php server for poker bots

nefton wrote:
fraction wrote:
you can model each bot as a restful server

Then other bots need external IP to configure its as a server. (why? )
And in general this decentral system is hard to install and support


Yes, each bot (or group of bots in the same installation) will require a web server, etc.

I thought you wanted to play remote bots vs each other. Is that not the case?

Regarding support, it's easy. You publish a specification for the rest (which is VERY simple) and anyone who wants to join in implements it (again, VERY simple in something like PHP, Java, Python or C#)

Quote:
I think http based protocol and php servers is the best solution for this problem.
welcome to discuss this option.


not sure how you expect to do this without a server. I think we're misunderstanding each other.

Author:  spears [ Wed Dec 04, 2013 6:02 pm ]
Post subject:  Re: http based php server for poker bots

Nefton's question is this: Why does the server not provide the client with a list of available actions?

If it doesn't, then every client has to figure this out for himself. That's horrible.

Author:  nefton [ Wed Dec 04, 2013 6:31 pm ]
Post subject:  Re: http based php server for poker bots

fraction wrote:
not sure how you expect to do this without a server.

Just one server. Example:

9 peoples with 7 bots want to play poker (tourney)
Do you think all of them need to rise there oun server? = 9 servers?
I think no. It must be one php server. And 9 clients. 2 from them are just html pages with java.

How setup 9 servers? 8 peoples will setup there servers and should wait (may be 1 month) when there 9th friend setup own?

And if there are 1 php server anybody can setup own client as long as he want at any time. And at the other end of the wire nobody should wait him.

Author:  fraction [ Wed Dec 04, 2013 10:53 pm ]
Post subject:  Re: http based php server for poker bots

spears wrote:
Nefton's question is this: Why does the server not provide the client with a list of available actions?

If it doesn't, then every client has to figure this out for himself. That's horrible.


Perhaps I'm not explaining this well, or misunderstanding the requirements.

I'm talking of a system whereby each bot is a server. A client application co-ordinates the two (or more) decision making servers. Think of it as the dealer. It posts the current game state to the server and the server replies with an action. In web terms this is a very common set-up. For example, a web page contains enough logic to interact with one or more servers and a user interface that allows someone to control that interaction.

Given the way in which strategies are constructed - linking gamestates to actions - it's simple for each server/bot to return the action their strategy dictates at a given gamestate/infoset. So the webpage holds the current gamestate and when it's a given bots turn to act it asks them for an action for that gamestate.

Again, maybe I'm not being clear or I've misunderstood what is required. But if I was going to design a system for multiple, disparate bots that had private logic to interact via a common, publicly available interface, that's what I'd build. (disclaimer - I design restful systems for a living)

[it could be that you mean every client has to figure out the list of possible interactions with the server, but thats' the good thing about this approach, there's only one. Each server has to do the following: translate a gamestate (in hold-em this is: board, action history, holecards, pot, possibly seating if more than HU) into an action. That's it.]

Author:  fraction [ Wed Dec 04, 2013 10:54 pm ]
Post subject:  Re: http based php server for poker bots

nefton wrote:
fraction wrote:
not sure how you expect to do this without a server.

Just one server. Example:

9 peoples with 7 bots want to play poker (tourney)
Do you think all of them need to rise there oun server? = 9 servers?
I think no. It must be one php server. And 9 clients. 2 from them are just html pages with java.

How setup 9 servers? 8 peoples will setup there servers and should wait (may be 1 month) when there 9th friend setup own?

And if there are 1 php server anybody can setup own client as long as he want at any time. And at the other end of the wire nobody should wait him.


I'm confused. How will these 9 people and seven bots interact? Will the server ask each client in turn to act? How?

It could be done this way round, sure, but it would be more work to build a client to work with that server than to build a server to work with the client I propose.

"I think no. It must be one php server. And 9 clients. 2 from them are just html pages with java" makes no sense, sorry.

Author:  fraction [ Wed Dec 04, 2013 11:03 pm ]
Post subject:  Re: http based php server for poker bots

In the end it makes no real difference. Essentially you have one co-ordinating entity (the dealer or whatever your want to call it) and many bots. Either the dealer pushes state to the bots and awaits a reply or the bots watch the dealer and push their actions when they think it's their turn to do so. It boils down to your use case, it boils down to What You Want To Do: Two things off the top of my head that the OP could be referring to:

1) A service that allows people to register bots for a game. When the game is full (or other criteria such as a human saying 'go') the game starts - much like humans using pokerstars but registering bots instead of themselves as players.

2) A service that allows people to pick bots to play each other and initiate games between them. - this is what I initally thought was required.

Author:  spears [ Thu Dec 05, 2013 9:55 am ]
Post subject:  Re: http based php server for poker bots

Quote:
Perhaps I'm not explaining this well, or misunderstanding the requirements.

I'm talking of a system whereby each bot is a server. A client application co-ordinates the two (or more) decision making servers. Think of it as the dealer. It posts the current game state to the server and the server replies with an action. In web terms this is a very common set-up. For example, a web page contains enough logic to interact with one or more servers and a user interface that allows someone to control that interaction.

Given the way in which strategies are constructed - linking gamestates to actions - it's simple for each server/bot to return the action their strategy dictates at a given gamestate/infoset. So the webpage holds the current gamestate and when it's a given bots turn to act it asks them for an action for that gamestate.

Again, maybe I'm not being clear or I've misunderstood what is required. But if I was going to design a system for multiple, disparate bots that had private logic to interact via a common, publicly available interface, that's what I'd build. (disclaimer - I design restful systems for a living)

[it could be that you mean every client has to figure out the list of possible interactions with the server, but thats' the good thing about this approach, there's only one. Each server has to do the following: translate a gamestate (in hold-em this is: board, action history, holecards, pot, possibly seating if more than HU) into an action. That's it.]


I get the feeling you are trying tell me something that might be quite interesting and useful. I don't understand what that is, and unfortunately I don't have the time to delve into it atm. Sorry.

Author:  fraction [ Thu Dec 05, 2013 11:07 am ]
Post subject:  Re: http based php server for poker bots

Put simply, if everyone exposed their bots via webservers using a simple rest API it would be easy-peasy to hook one up to another and make them play each other without anyone exposing their codebase or strategy.

Although I say "without exposing their strategy" I can imagine that some people won't want just anyone to play 100 million hands against their bot. If that's the case then they'd need authentication/authorisation policies or some kind of limiter.

Author:  MrNice [ Fri Dec 06, 2013 7:48 am ]
Post subject:  Re: http based php server for poker bots

nefton wrote:
I had read ACPC protocol. It`s wery pure on my mind. Cases:
1. server can not conect to client on http.
2. grammar of request is hard to process with php page. (variables must transmit like http post request)
3. Client MUST know what in server happen. For example the are a fsm on the server with curent state.
this state based on other player moves and rules. If I wish to write java application to operate human with the server I need write the same fsm in java :shock: It wil twice my work. Why not to transmit available moves throw protocol?



Hi Nefton,

The ACPC is just the poker server engine... You can easily mod it to send stats to a DB... On your PHP page, use these stats to display graphs (RRD or pchart : http://www.pchart.net/), player stats, game stats,... what ever....

And by the way, you can launch some processes via PHP... So easilly create a server with defined parameters via a web page, launch your bot and enjoy the fight :D

that's the way I will go as soon as I have finished my FLHU-NE bot...

The icing on the cake is that external bot can join your server to compete....

Regards

MrNice

Author:  bob101 [ Fri Dec 06, 2013 12:06 pm ]
Post subject:  Re: http based php server for poker bots

Is this the sort of thing you are looking for

http://www.cubeia.org/index.php/poker
http://www.cubeia.org/wiki/index.php?ti ... rebaseBots

bob

Author:  nefton [ Fri Dec 06, 2013 2:42 pm ]
Post subject:  Re: http based php server for poker bots

bob101 wrote:


nearly. but it is not php. Flaw of this option that i had rise poker serwer. So I need take computer, deal with my provider to get external static IP, turn on computer and rise poker bor server on it. Then (if I want anybody to connect) I need leave my computer turned on for a long time (years). So my apartment turn to the datacentr with many computers. (I need computer to).
But why should I do this? I can just write poker serwer on php, buy hosting (20$/year!) and that all.

Author:  spears [ Fri Dec 06, 2013 2:50 pm ]
Post subject:  Re: http based php server for poker bots

or just buy some java hosting service

Author:  nefton [ Fri Dec 06, 2013 3:01 pm ]
Post subject:  Re: http based php server for poker bots

spears wrote:
or just buy some java hosting service

ashamed. :oops: Did not know that such can be.

Author:  spears [ Sat Dec 07, 2013 12:20 pm ]
Post subject:  Re: http based php server for poker bots

- amazon micro instance free for a year http://aws.amazon.com/free/
- bitnami packages up tomcat (and java) on top of amazon free http://bitnami.com/stack/tomcat
- there are probably better deals if you look

Author:  fraction [ Sat Dec 07, 2013 11:33 pm ]
Post subject:  Re: http based php server for poker bots

You might want to check out https://www.heroku.com/ for java hosting (really basic is free). it'd be fine for hosting but not suitable for generating strategies.

Page 1 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/