stream of consciousness

The best place to find out what we have been up to: in the lab, on the streets, or out in the wild.  

media flow


want to collaborate?

follow my


Powered by Squarespace

Entries in fuzzy logic (1)

Sunday
Mar062011

AI for games 

In Robin Burke's "AI for games" course in my graduate studies at DePaul we learned about many common core systems used in creating "Artificial Intelligence" for video games.  I should probably chime in now and make my overall commentary that while these methodologies are involved in creating "AI" characters for video games I would suggest that this is not "AI" in the strict sense of the term.  As an introductory survey we are not investigating machine learning or neural networks which would begin to move us in the true direction.  That said, the programming exercises were good insight into the practice as it relates to game development.

In the soccer team development project we individually created strategic and tactical team game play using a combination of state machines, messaging systems, and steering behaviors.  The core framework for the game, graphics, etc was provided as part of the text we were using for the course and it was our responsibility to refactor an existing team, adding behavior and increasing computational performance.  The success of the assignment was then evaluated through a class tournament, pitting students and instructor teams against each other, with match scores and a computational performance rating determining the winner.

AI Soccer Team from Thomas Kearns on Vimeo.

To achieve a winning team my primary goal was to implement a man-on-man defensive strategy. In this strategy a player within a defined proximity would attempt to remain “on” the offensive opponent while positioning themselves between the player and their defending goal. To achieve this and other tactical performance increases I increased the granularity of both the team and individual states and I tracked more than the original single closest player to the ball. I also added a defensive support positioning grid similar to the existing offensive support grid. From this grid defensive players were provided with cues as to optimal positioning. Among simple code optimizations I added a kind of persistence of state or delay mechanism which attempted to reduce the processor usage by reducing the number of phase transitions, which also added to the tactical performance of the teams gameplay.

Ultimately my team came out on top of the class of 20 some students and our instructor, undefeated in points scored and computational performance. Goooooooo Team.

DeathMatch AI from Thomas Kearns on Vimeo.

Unfortunately I did not fare as well in the second project of the term. A 2d deathmatch game played similarly as an in class tournament. In this second project, we built upon ideas explored in the first project. Adding to it systems of sensory memory for sight, sound, and touch which allowed the ai player to respond to current and past events. Seeing an opponent, hearing a weapon attack, taking fire, etc. With the memory, we utilized goal driven behavior which allowed the ai player to switch objectives or strategies given particular conditions, attack, retreat, find health, etc. In addition, we utilized fuzzy logic systems to make determinations about which weapon and which target a player would would focused on.  Sadly, my pacifist strategy did not work and I got pwned. On a related note, this project was also my introduction to using LUA as a scritping language for games.

In the end, I really enjoyed the coursework, focusing my precedent research assignments on a specific areas of AI in the game industry which I am particularly interested in, spatial perception and awareness, and the procedural narrative of the AI director used in Valve's Left 4 Dead franchise.  I am very interested in pursuing these and other aspects of computional decision making in projects in the future.