Post news RSS Variety in AI Behavior I

A quick note on how we are adding a variety of behaviors to the AI in Kung Fu Kingdom.

Posted by on

Over the past month we (Read: Terry, KFK's lead programmer) has been working pretty hard on the AI for NPC Factions in Kung Fu Kingdom. One of our goals is to add enough variety to the AI that the player will encounter a variety of different behaviors in NPC factions, and will need to spend time to learn about the factions it encounters (assuming you do not want to crush them all beneath your IRON HEEL!). We want to make the AI SMRT! One of the ways we are doing this is through Risk Assessment and Risk Thresholds.

Ok, so the way the AI gets information is through heat maps. All the information the AI is going to need, resource position, dangerous units, dangerous terrain, areas influenced by other Factions, etc, is represented on various heat maps. When the AI needs to get something done, like gathering a resource, it checks the various heat maps for resources and picks the one in the least dangerous area to go harvest. But how they go about that analysis can vary greatly from Faction to Faction - here is how.

Let's make up a scenario where there are two different factions, Tiger Faction (Which has a high risk tolerance level) and Lilly Faction (Which has a low tolerance level). Both of these factions want a resource - lets assume that this resource is in a dangerous area. Both factions will look at the area around the resource and determine its Risk Level (How many enemies have been seen in the area, how many "neutral" units have been seen, how far it is from base, etc.). In this case, the Risk Level is lower than Tiger Faction's threshold, and so they send some units to go pick up the resources. However, it is higher than Lilly Faction's threshold, so they don't.

There are several ways to influence the Risk Level in an area, for example, Lilly faction could dispatch guards to the area, which would reduce the Risk Level. Cool! As a result, Lilly faction will seem much more cautious in their approach (Frequently bringing guards with them) in everything they do, and Tiger Faction will seem less cautious. This works out for Lilly Faction if the dangers actually materialize (they get attacked, etc.) as they will have guards with them, but will benefit Tiger faction if the dangers are absent (they get more stuff done faster because they don't bring guards).

There are more variables at work here, but this risk analysis is at the base of what we are trying to do with the Kung Fu Kingdom AI - add a lot of variety and personality to the AI's behavior with as few, low level variables as possible. Emergent behavior people, EMERGENT BEHAVIOR!

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.