mardi 23 avril 2019

Poker game loop , what is the appropriate approach?

I am trying to create a test environment for my algorithm(Poker AI and using Java). State transitions really boggles my mind. This is not something like "init()-update()-draw()-repeat" cycle , or i can't simplify like that.Basically my pseudo code will be something like this:

Create players deck etc etc
Load/Create AI memory from file

Loop 1)Play 100000 hand or 100 games (example)
Loop 2))Game_Loop (unless one of players gone bankrupt)
Loop 3)))Hand_Loop (unless terminal state)
      )))pre-flop(deal cards)
      )))betting state (players can fold therefore hand will be over)
      )))flop
      )))betting state (same logic applies)
      ))).....
      ))).....
      )))showdown (this is where we reach end game, whoever has better hand
         wins)
      )))for the sake of example lets say we reach 'p1_won' state 
      )))anytime you reach a terminal state update value-regret by 
         backtracking visited state-action pairs.



Thing is, i need to also implement a GUI for this. I am trying to find a way to implement all this states? So i can both render , update without a problem and get the required action with communicating with my algorithm at betting round.

States and Transitions Illustrated: https://imgur.com/a/VSd58vE

Aucun commentaire:

Enregistrer un commentaire