Progress: AI can learn good!

I’m pretty happy with the progress this week. The AI observes the human player, constructs data points based on player actions and the state of the world when the player performs the actions, then builds a decision tree based on what the player does.

Between rounds I print out the decision tree. It’s pretty wordy and unreadable past a certain point in the tree, but I think it shows what’s going on.

After a number of rounds playing both sides, I find the AI pretty unbeatable. I still can sometimes find small things it could do better, like a better move + shoot strategy. I think I’ll put in actions “Move Laterally Relative to Opponent” and conditions “Opponent’s Arrow in the Air” to deal with this.

Also, sometimes the AI just sits there without doing anything. Sometimes this is just bad AI, but sometimes it will just wait until you get close with your sword and then turn around and wack you!

Some technical notes:
Some actions are instantaneous, like parrying or swinging your sword. Each time a player performs one of those actions the AI creates a datapoint which looks at the conditionals which were true when the player performed that action.

Other actions occur over time, like move towards player, and the AI has a timer which tells it when to take these datapoints. Then the AI looks at the current game state after the action has been completed and uses those conditionals as a datapoint. This could use some improvement. First of all, an instantaneous action interrupts the datapoint collection, so the AI misses out on what it should do right before a critical action. Secondly, the condition collection should be before the “action over time”, not after it.

Mubbasir (from the lab) suggested single player, and multiplayer modes. In single player, you train your AI and then can save your trained AI to disk. Then you can fight your trained AI against the player or against that player’s AI. Similarly, you could have two human players play each other and then watch the two AIs trained by that match fight. (He also suggested 2v2 play, but that would be significant extra work).

Here’s our latest progress:
http://www.cs.ucla.edu/~billyh/AIFighter.zip

2 Comments

  1. ActionMan
    Posted May 19, 2008 at 12:07 am | Permalink

    I downloaded your ZIP file, but I assume I need to install some additional frameworks as well?

    It crashes on start-up; if I hit ‘Debug’, MSVC gives me this:

    System.IO.FileNotFoundException was unhandled
    Message: Could not load file or assembly ‘Microsoft.Xna.Framework.Game, Version=2.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d’ or one of its dependencies. The system cannot find the file specified.

  2. Billy
    Posted May 20, 2008 at 2:08 pm | Permalink

    @ActionMan
    To run the game, you need to download the XNA framework from Microsoft

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*