AI Module – Week Four

This article relates to work performed within lectures and lab sessions of an AI module as part of the Games Technology undergraduate course at Coventry University (2016/2017).

Part of this week’s coverage is written up in the post on assessing the needs of an AI in a shooter game and can be found below

Link to AI Design

This week’s topics cover the understanding of Tactical AI and Knowledge Representation.

Tactical AI

AI are able to operate either just to themselves or with groups of other AI, such as boid behaviour. However, for methods such as pathfinding, the AI needs to know how to deal with that. For example, an objective for the AI could be to defend a room. How would the AI know what room they need to defend and where it is in the world as well as where the room stops? What would constrain it to just that room so it doesn’t end up on the other side of the level? This is where the introduction of Waypoints come in. They work as graphical nodes that pathfinding can work with. Thee points can be thought of as weighted indices to travel, with longer distances meaning a larger weight. A larger weight = more travel time. They can also be used as a beacon to say where to go or what to have spawn here with their own constraints. The waypoint could also represent a place for a specific action, such as to defend a room or to snipe safely at a far away target.

How would this be good for an arena game? It would say where pickups in the environment would be, such as health pickups or ammo or a power-up. A waypoint can also say to all entities, including human player ones, where to spawn at the start of a game. So for team based modes, this would be very useful and can be made to determine where to go if an AI needs to heal using a pickup for example. It could also add a flag in a Capture the Flag mode and say where it will be every single time which will also tell the AI where to go to pick it up.

Knowledge Representation

In previously covered topics, there has been reference the sorts of data that an AI entity would need to know in order to perform effectively as functional and realistic opponent. The idea of determining how to find this out however has not been covered. The data can be conveyed to the AI through the use of multiple inputs: current world state, previously obtained knowledge and communication between allied entities. If the AI knows that the player has fired enough bullets to reload, it know it can safely attempt to move closer or attack without problems or it could hear an ally say they have wounded the player and devise a suitable strategy around that. In order to do this though, an AI must store the information in memory. There are four ways in which this can be achieved: Working, Short Term, Long Term and Episodic. Working Memory stores information only during the time the current action(s) is/are being performed. Short Term stores recent memory such as last known player position. Long Term stores rarely unchanged, constant information about the world and other permanent fixtures. Episodic Memory is memory that is called upon only for specific actions. There is no need to call something relating to flag position if the AI is not in a Capture the Flag match.

This information can also be understood as a set of nodes, much like the waypoints, having strength weights put to them this time, in the form of a Semantic Network. This could become cumbersome but does go about making logical rulings on the actions that the AI will perform. An alternative method is the use of Production Rules, where any knowledge is stored as a fact; the AI will believe this to be true which can make it be misled and confused if this isn’t true. Framing is a method f storing knowledge about a specific entity or event in the environment that works in a similar fashion to Object Oriented Programming but this can lead to very high storage bearing and become cumbersome in real time. As such, there are a variety of ways in which knowledge can be both represented and stored. For a fast paced arena shooter, this means finding the method of knowledge storage that works the quickest (as close to an O time of n as possible) whilst also being able to store enough relevant knowledge to provide realistic results and further research into this will need to be performed and taken into account.

Leave a comment