Game Designer & Programmer

Blog

AI Build 1

Last week I made the first prototype for my AI project. I'm really interested in creating an AI that "learns" and makes decisions based off of the actions the player makes during game play, similar to a fighting game bot. I'm scoping down bit and want to tackle an AI that makes decisions through input analysis though one of two ways: 

  1.  Linear Analysis - Assigning a probability of occurrence to all actions a player could potentially make thought frequentist inference and Markov Chains. i.e. if a player chooses to punch, the AI will increase the probability value of the punch action and, on the next turn, will choose to block.
  2. Bayesian Decision Theory - Similar to frequentist inference, this implementation assigns probabilities to player actions, but rather than starting from nothing and increasing the probability as turns go on, Bayesian Probability assumes that an action will happen and assigns probability values as degrees of certainty. The Bayesian Decision Theory also assigns a weight to the actions and takes that into consideration. For example, if an action has a scenario where it wins, but two scenarios where it loses, the AI might choose to take a different action that has fewer losing scenarios even if the first action has a higher probability of happening. There is a great blog post and demo explaining Bayesian probability in much more depth here.

This week a created a demo that was a bit simpler than full sequence analysis -- Rock, Paper, Scissors! The decision making implementation is about as linear as it gets right now with each action (rock, paper, scissors) having a probability int starting at 0. After each round, the AI will evaluate what the players choice was and increment the probability value of that choice by one. The AI then evaluates the probability of each choice during the next round and chooses it's action based off of the highest probability. 

This implantation is very easy to beat, as long as the player keeps a mental note of what actions they chose in the past. This implementation also doesn't show any real increase in wins as the game goes on, at least not when the player keeps that in mind. In my next iteration, I want to try assigning weights to the actions before I attempt a full implementation of Bayesian Probability.

Below you can see my current AI demo.

-Cole