How to build a backgammon bot

How to build a decent backgammon bot:

  1. Build a backgammon framework. This should define things like: strategies, which take boards and return values (larger values are "better boards"); games, which take a strategy for each player and can evolve until the end of the game; matches, which hold games and represent tournament play; and doubling strategies, which take a strategy & board & doubling cube details and determine when to double and when to take vs pass.
  2. Build a strategy that uses neural networks to estimate game probabilities: probability of any win; probability of any gammon win; probability of backgammon win; probability of any gammon loss; and probability of backgammon loss. Inputs should be the standard Tesauro inputs, plus a few extended inputs that encode more complex game features. One exception: you don't need an input noting whose turn it is; just always evaluate the network from the perspective of the current player. You can use different neural networks for different game phases: at least contact and race, and perhaps others. Use a standard neural network package like FANN, or roll your own if you like.
  3. Build one-sided bearoff databases for cubeless play to handle end games. You can use two-sided databases if you like, but one-sided databases perform almost as well and are much smaller (or equivalently, for the same database size you can cover a much larger fraction of the end game).
  4. Train your neural networks for cubeless play. Start training with TD training on self-play; once that's converged, switch to supervised learning based on the GNUbg training databases. Benchmark the performance of your bot with the GNUbg benchmark databases, possibly also with self-play against standard players like PubEval.
  5. Implement the Janowski doubling strategy for cubeful money play. Use a constant cube life index of 0.70, or try to come up with more state-specific cube life indexes.
  6. Get a match equity table. Either build your own or use one of the standard published tables.
  7. Implement the Janowski doubling strategy for match play, hooked into your match equity table. Use the same constant cube life index of 0.70, or try to do better with a state-dependent cube life index.
  8. Implement multiple-ply strategies, taking the regular neural net-based strategies and digging into those.
And then you're done! At that point you'll have a fairly strong player which you can wrap a UI around or hook into online backgammon servers like FIBS.