AI strategies

Hi all, not much going on this week. I’ve been out of town all weekend and have a busy week.

I’ve started experimenting with implementing a simple minmax strategy for an AI. It’s much harder than I thought to implement in the context of MTG, mainly because the game flow is very diverse. The classic example used in all minmax explanations is chess, where one player invariantly plays after the other. But in MTG, the choices each player make and the order in which they must make it are various and actually depend on the said choices, making the minmax tree much more complex. Basically, from my experience, the difficulties arise because you have very different “game” structures competing:

  • The game flow, i.e. the sequence of choices/actions that make up the game, is very stack-like. For example, a player will be given priority, lots of things can happen, but eventually control comes back to the caller (much like normal code).
  • The minmax algorithm, on the other side, is tree-like. It is composed of all the possible choices players can make given the current state of the game. This is in contrast with the above game flow, because then control always flows deeper into the tree as the game flows.

So I must find a way to reconcile those two flow structures.

I’m not sure I make much sense with this 🙂 For now, I’m trying to wrap my head around the details through a simpler implementation (Tic Tac Toe). After that, I’ll invent some dummy rules for Tic Tac Toe so I can experiment with more complex cases, in preparation for MTG. I might have to refactor a lot of the sequencing code I already have so that it integrates nicely with this AI code. You gotta do what you gotta do.


About fparadis2

Lead Game programmer
This entry was posted in Mox. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s