Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MonteCarlo evBot #25

Closed
tostercx opened this issue Sep 26, 2016 · 2 comments
Closed

MonteCarlo evBot #25

tostercx opened this issue Sep 26, 2016 · 2 comments

Comments

@tostercx
Copy link

tostercx commented Sep 26, 2016

I have discovered a truly marvelous solution for this, which this margin is too narrow to contain! :D

Seriously tho, I don't think I can/should get it running on Travis as it eats a lot of resources, but my winning algorithm was incredibly simple:

wager = pot * odds * aggression;

// where:
// pot = sum(current wagers),
// odds = odds of winning (0.0-1.0),
// aggression = tweakable constant (1.5 seems stable)

So basically pot*odds = EV, or what I expect to win, surprisingly betting more than that was A LOT more effective (aggression 1.1-4) than betting under (0.5-0.9).

The hard part was calculating the odds. Got the 2+2 evaluator running from:
https://web.archive.org/web/20140625212722/http://codingthewheel.com/archives/poker-hand-evaluator-roundup/#2p2
https://github.com/christophschmalhofer/poker/tree/master/XPokerEval/XPokerEval.TwoPlusTwo

Then I did a bunch of Monte-Carlo simulations - basically dealt every player and the community random cards (except the cards I know ofc) over and over again and counted the win/loose ratio (1k iterations per move seem to be enough). And ta-dah!

Player Standings

1. evBot $161249
2. Wittgenstein $72170
3. edi9999 $39935
4. status3Bot $35575
5. SneakyCharlie $27337
6. FlopASetBot $10068
7. whistle_tips $3666

But, yeah, multiple problems to submit it

  • the lookup table for the evaluator is ~130 megs, Travis could probably still pull this tho
  • it eats a lot of CPU as it needs ~1k simulations each move
  • the Monte-Carlo simulator is currently written in C++ and acts as a TCP server to communicate with the bot, would require some work to compile/run on Travis in the background... also it has windows sockets.
  • it obviously breaks the "no-modules" and "one file edit per pull" rules atm

Just wanted to share my solution. Someone might be able to do a similar/simpler version in just JS. Feel free to close this if needed.

@tostercx
Copy link
Author

I managed to port it with horrible speed and accuracy! #26
Now I'm just not sure if I'm breaking the rules or not since:

  • it still loads a module - hoyle, which is already in the game engine
  • I wasn't sure how to get require working properly on the outdated version of node it's running, so I ended up making a tweak in the Travis config

@tostercx tostercx changed the title MonteCarlo bot MonteCarlo evBot Sep 28, 2016
@tostercx
Copy link
Author

tostercx commented Sep 28, 2016

Did some hackery do get it running on node 0.10. The only remaining problem is if the submission counts although it requires hoyle or should I just copy-paste hoyle's code within my bot to get it submitted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant