Friday, 18 January 2013

Artificial Neural Network

 After completing the MatLab tutorial and looking at some of the included reference text I used the O'Reilly "AI for Game Developers" book to research the topic of neural networks in games. 
The book talks about the benefits of using neural networks in games, the most intriguing of which is the idea that they can learn so as to adapt the game as you play. They discuss four ways that they can be used effectively;
Control
Used for controlling machines in particular to games racing cars. An example the book gives is Colin McRae Rally as the network was trained by observing game developers race around the courses.
Threat Assessment
Training a neural network in game using validation mainly, but in certain games such as strategy simulations they can be attuned to a players particular style of play.
Attack or Flee
You can also use them to control how certain NPCs behave towards others, such as attack or flee. They can learn by positive and negative reinforcement, an example of which they are told to attack and they die they have then learnt not to attack in that situation.
Anticipation
An example of anticipating the next move of your opponent in a fighting game, they discuss the fact that training for this type of gameplay would happen dynamically in game as each game can greatly differ.
The book goes in to greater detail about teaching neural networks but the above ways of using them seem to be the most common.

Intelligent Agents

 Intelligent agents try to achieve goals by using sensors to calculate their reaction to the environment. Nikola Kasabov defines intelligent agents with certain characteristics; 
  • accommodate new problem solving rules incrementally
  • adapt online and in real time
  • be able to analyze itself in terms of behavior, error and success.
  • learn and improve through interaction with the environment
  • learn quickly from large amounts of data
  • have memory-based exemplar storage and retrieval capacities
  • have parameters to represent short and long term memory, age, forgetting, etc.
Russel and Norvig groups intelligent agents into five classes that represent their intelligence and capability. These range from simple reflex agents, where they act on if condition then action, to learning agentswhich can expand their basic knowledge due to feedback and from that they can make informed decisions. There are other agents apart from the five classes defined by Russel and Norvig.
An common example of intelligent agents in games is Wumpus World(Hunt the Wumpus). It is a simple block world that can be used to represent reason and knowledge. The goal is to get the gold without dying and the wumpus has a set of rules to follow.