Learning from an AI

I’ve recently been on another Prismata kick and, because it’s a game of perfect strategy, it got me thinking about a couple of things.  First, I started to wonder if I could build an AI to play Prismata effectively (and, by effectively, I mean defeat the other AI), and then, I started to wonder if I could learn to get better at Prismata by doing so.

When I think of an AI for a pure strategy game, I tend to think of it in terms of a state measurement function and an alpha/beta search (with a capped lookahead.)  Of course, this is extremely primitive, but if you have a sufficiently rich state measurement function, and it is cheap enough to allow significant lookahead, it should be able to make good strategic decisions.  What, then, can we learn from it?

I think, in this case, a lot of what we can learn is in the creation of the state measurement function.  What do we measure?  How highly do we value resources, units, attack or defense  relative to each other?  In figuring out which weights work well, it seems likely a human would be able to develop short-lookahead heuristics to help understand the game state and which trade-offs are better.  Another method might be to play with/against this AI, and if it makes a surprising move, to be able to examine the state tree to understand why.  This might allow us to create heuristics about deeper lookahead options with high-value payoff.

In looking at the weights in the state measurement function, I can’t help but notice that these would be exceptionally fiddly, and trying to build them by hand would introduce a (potentially incorrect) bias into our AI.  In this case, it seems more natural to train the AI to build those weights and then examine them to learn something more about the game.  The idea of doing this by genetic programming seems like it would be pretty efficient, and probably pretty easy to implement.  Additionally, this would allow us to examine the resulting “best” weights and learn what things are useful to think about at a high level.

The limiting factor in all of this though, is tracking all the things that can be done on a turn in Prismata, but noting that some combinations of those things are strictly better than others (I’m thinking about clicking one drone on turn 1 vs clicking all your drones).  This clutters the game space, and so some good ways of pruning are going to be very necessary.

After going through all of that, I wonder if the existing Prismata AI already have something to teach.  Whether the designers could add additional instruction to the existing AI so that they could respond to questions like, “why did you do that?” to show its projected future turns/game state or “what are your goals” to show how it prioritizes different things that could happen.