Tuesday, September 16, 2014

What the heck is the A.I. doing?

Cookie Walk
    Sorry for the disturbing cookie man walk, but I find it oddly hypnotic and funny.  It does appear to be knowing where it is going in a hurry.  It walks with purpose and fairly smooth if a bit repetitive.  As we all know now, this is just a series of images that are repeated in a loop.  Each 'cycle' of the loop  the program determines the next picture to show.  If you were to add some alternative pictures, like say a jumping action sequence, then Ginger would start to jump occasionally.  The key word here is 'occasionally'.  What determines the occasional hitch in his step?  Picking that decision to walk or hop at certain times is the Artificial Intelligence or AI of the program.  Granted it is pretty simple, but it does give the illusion of decision.
    Why am I explaining this?  Well yesterday, I got the flow lines working correctly.  (Drag to create.  Drag over on them to replace.  Deleting lines TBD)  In order to get this rework done, I had to disable the AI routines.  So its pretty easy to beat the opponent that just sits there.  Now seemed like a good time to revise the AI to stop picking the next square to attack and start using flow lines.  Hmm.  This means I have to change 'Larry' and 'Oscar', my AI routines.  They each attack the board in different ways based on the timestamp or cycle.   Since I need to change these characters to use flow lines instead of attacking squares, it seemed a good day for readdressing the AI problem.
    Today I put some more design into the AI of the flow puzzle/game we are building.  I like what Larry, Oscar, and all their future buddies do at various cycles.  Changing this behavior to work with the flow lines should not be too difficult.  After this, I will need to create a few more characters to join the merry band of AI opponents.  They won't do much or be complicated, but I figure I can add some more variability by switching characters depending on the situation or time.   This sounds like a good game plan for this week to get the game back to playing levels again.
    For example, run the AI as Larry 25% of time, and as Oscar the other 75%.  We can call this new player 'Joe', but his real identity is the percentage of decision time he has allotted to each of this personalities.  Joe is normally acting like Oscar, but occasionally he lets his inner Larry out.
    Joe now is really just a mix, but really, who are we to judge?  Aren't we all a bit mixed up?

No comments:

Post a Comment