We have long been used to numbers in games. Thousands of years ago, when people first started playing games, the simple act of keeping score was dealt with in terms of numbers. Even before games, when people had to simply scratch by for food, numbers were an integral part. From how many rabbits the hunter killed to how many sling stones he had left in his pouch, numbers have been a part of competitive activity for all of history.
âHeâs only mostly dead.â
Coming back to the present, numbers are everywhere for the game player. Some are concrete values that have analogs in real life: How much ammo do we have? How many resources will this take to build? What is the range of that weapon? Some are a little more nebulousâif not contrived altogether: What level am I? What condition are my gloves in? What armor bonus does this magic ring afford? And, although the medical community might be a bit startled by the simplicity, games often parade a single number in front of us to tell us how much âlifeâ we have. (âHeâs only mostly dead.â) Suffice to say that we have educated our gaming clientele to forgive this intentional shredding of the coveted suspension of disbelief. Even though some games have attempted to obscure this relationship by removing some of the observable references to this numeric fixation, gamers still recognize that the numbers are still there, churning away behind the Wizardâs curtain.
Numbers in Games
As programmers, our fixation with numbers is not coincidental. After all, along with logic, mathematics is the language of our medium. Computers excel in their capacity to crunch all these numbers. Theyâre in their element, so to speak. This capacity is a primary reason that the pen-and-paper RPGs of the 70s and 80s computers so energetically made the transition to the computer RPGs of the 80s and beyond. Resolving combat in Ultima (1980) and Wizardry (1981) was far swifter that shuffling through charts, tables, and scribbles on scratch paper in D&D.
So numbers in games arenât going away any time soonâwhether in overt use or under the hood. The interesting, and sometimes even disconcerting thing, is that they arenât used more often. Even with all of the advances and slick architectures that artificial intelligence programmers use, we too often fall back on the most simple of logical constructs to make our decision code. The most obvious example is the venerable if/then statement. Testing for the existence of a criterion is one of the core building blocks of computational logic. âIf I see the player, attack the player.â Certainly, this sort of binary simplicity has its place. Left to itself, however, it can fall woefully short of even being adequate.
The answer lies not in the existence of numbers in our world, but what those numbers represent and, ultimately, how we use them.
We could extend the above example by putting a number in the equation such as âIf the player is < 30 [units of distance] away from me, attack him.â But really what have we gained? We are still testing for the existence of a criterion â albeit one that is defined elsewhere in the statement or in the program. After all, âsee the playerâ and âplayer < 30â are simply functions. There is still a razor edge separating the two potential states of âidleâ and âattackâ. All subtlety is lost.
So how might we do things differently? The answer lies not in the existence of numbers in our world, but what those numbers represent and, ultimately, how we use them.
Looking Inward
Stop for a moment and do a self-inventory. Right now, as you sit reading this column, are you hungry? Sure, for the sake of simplicity, you may answer âyesâ or ânoâ. However, there is usually more to it than that. When my daughter was younger, she tended to cease using âhungryâ when she was no longer empty. (This usually meant that she ate two or three bites only to come back wanting more about 20 minutes later.) I, on the other hand, could easily see myself defining âhungryâ as âno longer fullâ. My wife has the penchant for answering somewhat cryptically, âI could be.â (This is usually less convenient than it sounds.)
All of this makes sense to us on an intuitive level. âHungerâ is a continuum. We donât just transition from âcompletely fullâ to âfamishedââit is a gradient descent. What we do with that information may change, however, depending on where we are in that scale. For example, we can make judgment decisions such as âIâm not hungry enough to bother eating right now⊠I want to finish writing this column.â We can also make comparative judgments such as âIâm a little hungry, but not as much as I am tired.â We can even go so far as use this information to make estimates on our future state: âIâm only a little hungry now, but if I donât eat before I get on this flight, my abdomen will implode somewhere over Wyoming. Maybe I better grab a snack while I can.â
The subtlety of the differences in value seems to be lost on game characters.
Compare this to how the AI for game characters is often written. The subtlety of the differences in value seems to be lost on them. Soldiers may only reload when they are completely out of ammunition in their gun despite being in the proverbial calm before the storm. Sidekicks may elect to waste a large, valuable health kit on something that amounts to a cosmetically unfortunate skin abrasion. The coded rules that would guide the behaviors above are easy for us to infer:
if (MyAmmo == 0)
{
Reload;
}
if (MyHealth < 100)
{
UseHealthKit;
}
Certainly we could have changed the threshold for reloading to MyAmmo <= 5, but that only kicks the can down the road a bit. We could just have easily found our agent in a situation where he had 6 remaining bullets and, to co-opt a movie title, all was quiet on the western front. Dude⊠seriouslyâyouâre not doing anything else right now, might as well shove some bullets into that gun. However, an agent built to only pay homage to the Single Guiding Rule of Reloading would stubbornly wait until he had 5 before reaching for his ammo belt.
Additionally, there are other times when a rule like the above could backfire (so to speak) with the agent reloading too soon. If you are faced with one final enemy who needs one final shot to be dispatched, you donât automatically reach for your reload when you have 5 bullets. You finish off your aggressor so as to get some peace and quiet for a change.
Very rarely do we humans, make a decision based solely on a single criteria.
Needless to say, these are extraordinarily simplistic examples, and yet most of us have seen behavior similar to this in games. The fault doesn’t rest in the lack of informationâas we discussed, often the information that we need is already in the game engine. The problem is that AI developers donât leverage this information in creative ways that are more indicative of the way real people make decisions. Very rarely do we humans, make a decision based solely on a single criteria. As reasonable facsimiles of the hypothetical Homo economicus, we are wired to compare and contrast the inputs from our environment in a complex dance of multivariate assessments leading us to conclusions and, ultimately, to the decisions we make. The trick, then, is to endow our AI creations with the ability to make these comparisons of relative merit on their own.
Leveling the Field
So how do we do this? The first step is to homogenize our data in such a way as to make comparisons not only possible, but simple. Even when dealing with concrete numbers, it is difficult to align disparate scales.
Consider a sample agent that may have maximums of 138 health points and 40 shots in a fully-loaded gun. If at a particular moment had 51 health and 23 bullets in the gun, we wouldnât necessarily know at first glance which of the two conditions is more dire. Most of us would instinctively convert this information to a percentageâeven at a simple level. E.g. âHe has less than half health but more than half ammo.â Therein lays our first solution⊠normalization of data.
My gentle readers should be familiar with the term normalization in principle, if not the exact usage in this case. Put simply, it is restating data as a percentâa value from 0 to 1. In the case above, our agentâs health was 0.369 and his ammo status 0.575. Not only does viewing the data this way allow for more direct comparisonsâe.g. 0.575 > 0.369âbut it has the built-in flexibility to handle changing conditions. If our agent levels up, for example and now has 147 health points, we do not have to take this change into consideration into our comparison formula. Our 51 health above is now 0.347 (51 Ă· 147) rather than 0.369. We have detached the comparison code from any tweaking we do with the actual construction of the values themselves.
But What Does It Mean?
Value expresses a concrete number. Utility expresses a concept.
Normalization, however, only sets the state for the actual fun stuff. Simply comparing percentages between statuses like âhealthâ and âammoâ usually isnât sufficient to determine the relative importance of their values. For example, I posit that being at 1% health is measurably more urgent than being down to 1% ammo. Enter the concept of utility.
Utility is generally a different measure than simply value. Value, such as our normalized examples above, expresses a concrete number. Utility, on the other hand, expresses a concept. In this case, the concept we are concerned with is âurgencyâ. While it is related to the concrete values of health and ammo, urgency is its own animal.
âWhat does this value mean to me?â
The easiest way of doing this is by creating a âresponse curveâ. Think of passing the actual numbers through a filter of âwhat does this value mean to me?â That is what converting value to utility is like. This filter is usually some sort of formula that we use to massage the raw data. Unlike a lookup table of ranges (such as âammo †5â), we have the benefit of continuous conversion of data. We will see how this benefits us later.
The selection of the formula needs to take into consideration specific contour of the translation from value to utility. There are innumerable functions that we can use, but they are all built out of a few simple building blocks. Each of these blocks can be stretched and squished in and of themselves, and combining them together results in myriad combinations.
The first filter that we can run our numbers through is simply a linear conversion. (For these examples, I will simply use the standard x and y axis. Iâll occasionally through in an example of what they could represent.) Consider the formula:
y = 0.8x + 2
This results in a line running from our co-maximum values of (1.0, 1.0) and arrives at y = 0 when x = .2. (See Figure 1.) Put another way, we want a steady descent in our utility (y) at a somewhat quicker rate than the decent of the actual value (x). We could have done something similar by changing the formula to:
y = 0.8x
As this point, the line extends from (1.0, 0.8) to (0, 0).
Figure 1
Obviously changing the slope of the lineâin this case, 0.8âwould change the rate that the utility changes along with the value (x). If we were to change it to 1.2, for example, the rate of descent would increase significantly. (See Figure 2.)
y – 1.2x â .2
Itâs worth noting here that these formulas are best served by being combined with a clamping function that ensures that 0.0 †y †1.0. When we take that into consideration, we have another feature to identify here: when x < 0.2, y is always equal to 0.
On the other hand, consider the similar formula:
y = 1.2x
This exhibits the same effect with the exception that now the âno effectâ zone is when x > 0.8. That is, the utility doesnât start changing until our value < 0.8.
These effects are useful for expressing the situations where we simply do not care about changes in the utility at that point.
Figure 2
Enter the Exponent
The simple formulas above merely set the stage for more advanced manipulations. For example, imagine a scenario where the meaning of something starts out as âno big dealâ, yet becomes important at an increasing rate. The state of the ammo in our gun that we illustrated above makes an excellent example. In this case, the value is simply the number of shots remaining whereas the utility value is our urgency to reload.
Analyzing this outside the realm of the mathâthat is, how would we behaveâgives us clues as to how we should approach this. Imagine that our gun is full (letâs assume 40 shots for convenience)⊠and we fire a single shot. All other things being equal, we arenât likely to get too twitchy about reloading. However, firing the last shot in our gun is pretty alarming. After all, even having 1 shot left was a heckuva lot better than having none at all. At this point, it is helpful to start from those two endpoints and move toward the center. How would we feel about having 35 shots compared to 5? 30 compared to 10? Eventually, we will start to see that we only really become concerned with reloading when we our ammo drops gets down to around 20 shotsâat that below that, things get urgent very quickly!
In a simple manner, this can be represented by the following formula:
y = (x â 1)2
As we use up the ammo in our gun (x), there is still an increase in the utility of reloading, but the rate that the utility increases is accelerating. (See Figure 3.) This is even more apparent when we change the exponent to higher values such as 3 or 4. This serves to deepen the curve significantly. Note that a version of the formula with odd exponents would require an absolute value function so as to avoid negative values.
Figure 3
Another quick note about manipulating these formulas. We could turn the above curves âupside downâ by arranging it as follows:
y =Â (1 â x)2
Looking at the chart (Figure 4) shows that this version provides a significantly different behaviorâan agent who has a very low tolerance for having an empty gun, for example!
Figure 4
By manipulating how the function is arranged, we can achieve many different arrangements to suit our needs. We can shift the function on either axis much as we did the linear equations above, for example. (See Figure 5.)
Figure 5
We can specify where we want the maximum utility to occurâit doesnât have to be at either end of the scale. For example, we might want to express a utility for the optimal distance to be away from an enemy based on our weapon choice. (See Figure 6.)
y = 2(1Â â |(x â 0.3)|2)
Figure 6
Soft Thresholds
While we can certainly get a lot of mileage out of simple linear and exponential equations, one final class of formulas is very useful. Sigmoid functions, particularly the logistic function, can be used to define âsoft thresholdsâ between values. In fact, logistic functions are often used as activation functions in neural networks. Their use here, however, is much less esoteric.
The base logistic function is:
y = 1 / (1 + e-x)
While the base of the natural logarithm, e, is conspicuous in the denominator of the fraction, it is really optional. We can certainly use the approximation of 2.718 in that space, 2, 3, or any other number. In fact, by changing the value for e, we can achieve a variety of different slopes to the center portion of the resulting curve. As stated, however, the formula graphs out as shown in Figure 7.
Figure 7
Notice that, unfortunately, the graphâs natural range is not 0â1 as with our other examples. In fact, the range of the graph is infinite in that it asymptotically approaches both y=0 and y=1. We can apply some shifting to get it to fit the 0â1 range, however, so that we can use it with normalized values of x. We can also change the area of the graph where the threshold occurs by changing what we are adding to the exponent.
y = 1 / (1 +Â eâ(10x â 5))
Comparing and Contrasting
We can line up dozens â or even hundreds â of utilities for various feelings or potential actions.
The end result of all of this is that we can create very sophisticated response curves that translate our raw values into meaningful utility values. Also, because these end products are normalized, we can now easily compare and contrast them with other results. Going back to the examples I cited early on, we can decide how hungry we are in relation to other feelings such as tired (or too busy finishing a last-minute column for a magazine). In fact, we can line up dozensâor even hundredsâof utilities for various feelings or potential actions and select from among them using techniques as simple as âpick the highestâ to seeding weight-based randoms.
Compare this to what we would have to do were we not to use the normalized utility values. In our hungry/tired/busy example, we normally would have had to construct a multi-part condition to define each portion of our decision. For example:
If ( (Hungry > 5) && (Tired < 3) && (Busy < 7) ) then
{
Eat();
}
Even if the above values were normalized (i.e. between 0 and 1), the complexity explosion in simply comparing the different possible ranges and mapping them to the appropriate outcome would get out of hand quickly. And thatâs just with 3 inputs and 3 outputs! By converting from value to utility, we massage what the data âmeans to usâ inside each response curve. We now can feel comfortable that a direct comparison of the utilities will yield which item is truly the most important to us.
The system is extensible to grand lengths as well. If we want to include a new piece of information or a new action to take into account, we simply need to add it to a list. Because all the potential actions scored and sorted by their relative benefit, we will automatically take newcomers into stride without much (if any) adjustment to the existing items.
The Sims is an excellent example of how complex utility-based functions can be used.
If calculating and measuring all of these feelings and desires is starting to sound a lot like The Sims, it is not a coincidence. The Sims is an excellent (but not the only) example of how complex utility-based functions can be used to simulate fairly reasonable, context-dependent, decision processes in agents. Richard Evans has spoken numerous times at GDC on this very subject. I wholeheartedly recommend reading his papers and viewing his slides on the subject.
The uses of these methods arenât limited to that genre, however. Strategy games, in particular, lend themselves to more nuanced calculation. Even in modern shooters and RPGs, agents are expected to make increasingly more believable decisions in environments that contain significantly more information. Our AI no longer has the luxury of simply leaning on âif I see the player, shoot him!â as its sole guideline and building static rulesets that address all the possible permutations of world state gets brittle at an exponential pace.
However, as Iâve illustrated (ever so briefly) the inclusion of some very simple techniques lets us step away from these complicated, often contrived, and sometimes even contradictory rulesets. It also allows us, as AI designers, to think in familiar terms of âhow muchââthe same terms that we often use when we think of our own (human) states. The numbers we need are there already. The magic is in how we use them.
10 days in and I still have not played Skyrim. I’ve been too busy. However, that doesn’t stop me from seeing what other people have pointed out. Given that it is a PC-playable game, there are no shortage of YouTube videos out showing many of the plusses and minuses of it. (There seem to be plenty of both.) If I took the time to analyze each one that I saw, I would never get anything done and would have even less time to play it myself. That said, some things are too easy to pass up.
This video came to my attention via someone on Twitter and I thought it was worth a mention.
This is something that is so easily fixed that it is spectacular that this even occurs.
Obviously, our poor Lydia is having a difficult time with this gate trap. The problem is, she really shouldn’t. While we can understand Lydia getting whacked the first time (after all, that’s what traps are all about, right?) why is it that she persists in trying to go through the same area? This is something that is so easily fixed — even with likely existing tech and logic — that it is spectacular that this even occurs.
The short version of why this is happening can likely be summed up as follows:
The pathfinding engine in Skyrim is a waypoint graph rather than a navmesh. The edge that she is trying to follow runs right through the middle of that gate and, therefore, right over the trap trigger.
Even when knocked off the graph, her top movement priority is to get back on the path at the nearest node. This is why she moves to the center of the hall instead of just moving along the left (her left, our right) wall towards the player.
She has no recollection of getting hit by the gate. Therefore, nothing about her processing is different in each iteration.
Even if she recalled that the gate is the problem and was able to understand that the trigger stone was the issue, on a waypoint graph she has no way to really steer around the stone anyway.
When she is stuck behind the gate against the wall, she has no realization that she is stuck… therefore, she keeps “running”.
As you can tell, this could be remedied fairly simply. First, for the pathfinding issue, a navmesh would be very helpful here. (For an excellent treatment on waypoint graphs vs. navmeshes, see Paul Tozour’s post on Game/AI, Fixing Pathfinding Once and for All.) That way, the stone could be created as a separate mesh polygon and, upon discovery, marked as as something to avoid.
Of course, the above is premised that the stone can be “discovered” in the first place. Certainly, Lydia managed to “discover” the stone when she got whacked the first time. What she failed to do was make a mental note (in an e- sort of way) of its existence. It is at this point that the AI started to look stupid. Again, not really all that hard to handle. In fact, by simply doing what I suggested above (marking up the navmesh as being unusable), this becomes implied by her subsequent behavior of avoiding the stone. No animations, voice barks, etc. needed. She just doesn’t do the same thing twice.
The being stuck behind the gate thing is actually a separate problem entirely and I won’t bother to address the details here. Suffice to say, however, that it is partially similar in that it is based on the notion that NPCs rarely have a sense of “futility”.
Anyway, I just thought that this was worthy of note specifically because the solution is so easy to implement. It makes me wonder why major studios can advance so much in some aspects of their AI and yet have such glaring holes in other areas. I suppose that’s why we now have the AI Game Programmers Guild and the GDC AI Summit. We are trying to share enough information between us that we are lifting the floor of game AI as a whole.
Yet another video example courtesy of our dogs (and my somewhat mischievous kids). Obviously Jake is having pathfinding issues despite knowing where he wants to go and seeing his way out. If this were in a game, it would go up on YouTube as an example of bad game AI. So why not put it up there anyway?
I admit that, despite it being 11/11/11, I haven’t played Skyrim. I don’t even know if I will be able to get to it for a few weeks. However, that doesn’t stop the barrage of information from people playing it. I am trying to avoid most of the breathy reports from my friends and colleagues around the internet. However, this one kept popping up on my Twitter feed so I figured I would take a look.
The title of this YouTube video is “How to steal in Skyrim.” When I clicked on it, I really didn’t know what to expect. I figured it was going to either be a boring instructional video or a blooper reel. I suppose it goes in both categories, for whatever that’s worth. However, it is an instructional video for game AI developers and designers alike.
What you are seeing is an attempt by Bethesda to mitigate a problem that has plagued RPGs since their inception — that of rampant stealing from houses and shops. Usually, one can do this right in front of people and no one seems to care. One poor solution was to mark objects as being people’s possessions and alert that person when they are stolen. However, that pretty much eliminates the notion that you could steal something when that person is not around…. kind of a “page 1″ lesson in the Book of Stealing, really.
Every person in the game is completely cool with me just placing large objects over their head?
What Bethesda obviously did here is perform a line-of-sight check to the player. If the player grabs something that isn’t normal, react to it. In the case of the lady at the table, she simply queries the player about what he is doing. In the case of the shopkeeper, he reacts badly when the player takes something of his. All of this is well and good. However, when the line of sight is blocked (in this case by putting something over their heads), they can no longer see the player taking something and, therefore, don’t react.
But what about the reaction that should take place when you put a bucket over the person’s head? Are you telling me that every person in the game is completely cool with me just placing large objects over their head? It certainly looks that way!
The lesson here is that we either can’t think of every possible action the player could perform in the game or we simply do not have the resources to deal with it — for example, by having the player protest and remove the ill-designed helmet.
“But why would the player want to do that?”
In the past (and I mean >10 years ago), when the player’s interaction with the world was simpler, many of the faux pas would have stemmed from the former reason. We just didn’t bother to think about the possible actions. The pervasive mentality was simply, “but why would the player want to do that?” Of course, players did do things like that — but given the limited worlds that we existed in, the ramifications weren’t that huge. We were far enough away from the proverbial “uncanny valley” that we simply accepted that the simulation didn’t model that sort of thing and we moved on.
Adding one mechanic to the game could have hundreds of different possible applications.
More recently, as games have allowed the player even more interaction with the world, there is a necessary exponential explosion of possible results for those actions. That is, simply adding one mechanic to the game could have hundreds of different possible applications. When you figure that game mechanics can be combined so as to intersect in the world, the potential space of resulting interactions is mind-numbingly complex. The problem then becomes, how do I account for all of this as a game developer?
One game that began simulating this stuff on an almost too deep level was Dwarf Fortress. I admit going through a DF kick last spring and it almost killed me. (It was like experimenting with powerful drugs, I suppose.) Pretty much everything in that world interacts with everything else in a realistic way. The rulebase for those interactions is spectacular. However, pretty much the only way they can pull it off is because their world is represented iconically rather than in the modern, 3D, photo-realistic, way. For DF, creating a new visual game asset is as simple as scouring the text character library for something they haven’t used yet and making a note of the ASCII code. In Skyrim (and all modern games of its ilk), the process of creating an asset and all its associated animations is slightly more involved. Or so the rumor would have it.
Given the example in the video above, DF (or any other text-based game) could simply respond, “the lady removes the bucket and yells obscenities at you.” Problem solved. In Skyrim, they would specifically have to animate removing things from their head and hope their IK model can handle grasping the bucket no matter where the physics engine has placed it.
What occurred in the video isn’t necessarily a failing of AI.
So there’s the problem. What occurred in the video isn’t necessarily a failing of AI. We AI programmers could rather simply model something like, “your messing with [my body] and I don’t like it.” It just wouldn’t do us a lot of good if we can’t model it in an appropriate way in-game.
This bottleneck can apply to a lot of things. I could represent complex emotional states on finely graduated continua, but until the animation of facial expressions and body language can be modeled quickly and to a finer degree of realism, it doesn’t do anyone any good. No one will ever see that the character is 0.27Â annoyed, 0.12fearful, and 0.63 excited.
In the meantime, rest assured that the hive mind of the gaming public will think of all sorts of ways to screw with our game. Sure, they will find stuff that we haven’t thought of. It’s far more likely, however, that we did think of it and we were simply unable to deal with it given the technology and budget constraints.
And to the gaming public who thinks that this is actually a sign of bad AI programming? Here… I’ve got a bucket for you. It looks like this:
An article was recently brought to my attention. The first one I looked at was Wolves May Not Need to be Smart to Hunt in Packs from Discover Magazine. However, it was originally from New Scientist it seems. Both of them cite a couple of other papers via links in their respective articles. You can get the gist of what they are talking about from the text of the article, however.
The point is, they have discovered that the complex(-looking) pack hunting behaviors of wolves are actually not as complex and joined as we thought. With just a few very simple autonomous rules, they have duplicated this style of attack behavior in simulations. Specifically,
Using a computer model, researchers had each virtual âwolfâ follow two rules: (1) move towards the prey until a certain distance is reached, and (2) when other wolves are close to the prey, move away from them. These rules cause the pack members to behave in a way that resembles real wolves, circling up around the animal, and when the prey tries to make a break for it, one wolf sometimes circles around and sets up an ambush, no communication required.
The comment that brought it to my attention was that biologists “discover” something that AI programmers have known for decades — the idea of flocking. Going back to Craig Reynolds seminal Boids research (from the 1980′s), we as AI programmers have known that simple rules can not only generate the look of complex behavior but that much of the complex behavior that exists in the world is actually the result of the same “simple rule” model. Even down to the cellular level in the human body — namely the human immune system — autonomous cellular behavior is driven by this mentality.
The key takeaway from this “revelation” about the wolves is not so much that wolves are not as clever as we thought, but rather that there is now legitimacy to using simpler AI techniques to generate emergent behavior. We aren’t “cheating” or cutting corners by using a simple rule-based flocking-like system to do our animal AI… we are, indeed, actually replicating what those animals are doing in the first place.
We could likely get far more mileage out of these techniques in the game space were it not for one major block — the trepidation that many developers feel about emergent behavior. For designers in particular, emergent behavior stemming from autonomous agents means giving up a level of authorial control. While authorial control is necessary and desired in some aspects of game design, there are plenty of places where it is not. By swearing off emergent AI techniques, we may be unnecessarily limiting ourselves and preventing a level of organic depth to our characters and, indeed, our game world.
Incidentally, emergent AI is not simply limited to the simple flocking-style rule-based systems that we are familiar with and that are discussed with regards to the wolves. Full-blown utility-based systems such as those that I talk about in my book are just an extension of this. The point being, we aren’t specifically scripting the behavior but rather defining meanings and relationships. The behavior naturally falls out of those rules. The Sims franchise is known for this. As a result, many people are simply fascinated to sit back and watch things unfold without intervention. The characters not only look like they are “doing their own thing” but also look like they are operating together in a community… just like the wolves are acting on their own and working as part of a team.
So take heart, my AI programmer friends and colleagues. Academic biologists may only now be getting the idea — but we’ve been heading down the right track for quite some time now. We just need to feel better about doing it!
About a month or two ago, I launched something that I did not bother to mention here. Mostly, that is because I have been fairly busy with other things. Also, I have found that most of the small announcements that I have to make, I have been doing on Twitter. However, realizing that there are people who may subscribe to this blog, or visit in the future, that may not follow me on Twitter, I figured it was worth a mention here.
Over three years ago, Steve Rabin and I formed the AI Game Programmers Guild. However, it was only a few months ago that we decided that we needed to put up a web site. Actually, to be more accurate, we decided to put out a web site over a year ago. We just never got around to it. Thankfully, our good friend Steve Woodcock decided that he was no longer going to be able to keep up his website. He also had a really nifty domain name: GameAI.com. We initiated a transfer of the domain so that I could start taking care of it. All I then set about setting up the new web site for the guild.
The guild web site, has many links to all sorts of information. We are hoping to continue to expand that over the years. In particular, links to people’s presentations at places such as GDC will be hosted on there. Also, links two papers on artificial intelligence, especially in the game industry. There is a news feed on that site as well where I will announce as we enter more information over the course of time. When appropriate, I will try to remember to cross-post on this blog as well.
I was browsing through my Google alerts for “Game AI” and this jumped out at me. It was a review of the upcoming Ghost Recon: Future Soldier on Digital Trends (who, TBH, I hadn’t heard of until this). The only bit about the AI that I saw was the following paragraph:
The cover system is similar to many other games, but you canât use it for long. The environments are partly destructible, and hiding behind a concrete wall will only be a good idea for a few moments. The enemy AI will also do everything it can to flank you, and barring that, they will fall back to better cover.
There is a sort of meta-reason I find this exciting. First, from a gameplay standpoint, having enemies that use realistic tactics makes for a more immersive experience. Second, on the meta level is the fact that this breaks from a meme that has been plaguing the industry for a while now. Every time someone suggested that enemies couldâand actually shouldâflank the player, there was a rousing chorus of “but our players don’t want to be flanked! It’s not fun!”
“but our players don’t want to be flanked!”
This mentality had developed a sort of institutional momentum that seemed unstoppable for a while. Individuals, when asked, thought it was a good idea. Players, when blogging, used it as an example of how the AI was stupid. However, there seemed to be a faceless, nebulous design authority that people cited… “it’s not how we are supposed to do it!”
What are we supposed to do?
One of the sillier arguments I heard against having the enemy flank the player and pop him in the head is that “it makes the player mad”. I’m not arguing against the notion that the player should be mad at this… I’m arguing against the premise that “making the player mad” is altogether unacceptable.
“…it makes the player mad.”
In my lecture at GDC Austin in 2009 (“Cover Me! Promoting MMO Player Interaction Through Advanced AI” (pdf 1.6MB), I pointed out that one of the reasons that people prefer to play online games against other people is because of the dynamic, fluid nature of the combat. There is a constant ebb and flow to the encounter with a relatively tight feedback loop. The enemy does something we don’t expect and we must react to it. We do something in response that they don’t expect and now they are reacting to us. There are choices in play at all times… not just yours, but the enemy’s as well. And yes, flanking is a part of it.
It builds tension in my body that is somewhat characteristic of combat.
In online games, if I get flanked by an enemy (and popped in the head), I get mad as well… and then I go back for more. The next time through, I am a little warier of the situation. I have learned from my prior mistake and am now more careful. It builds tension in my body that, while having never been in combat, I have to assume is something that is somewhat characteristic of it. Not knowing where the next enemy is coming from is a part of the experience. Why not embrace it?
Something to fall back on…
One would assume some level of self-preservation in the mind of the enemy…
The “fall-back” mechanic is something that is well-documented through DamiĂĄn Isla’s lectures on Halo 3. It gives a more realistic measure of “we’re winning” than simply mowing through a field of endless enemies. Especially in human-on-human combat where one would assume some level of self-preservation in the mind of the enemy, having them fall back instead of dying mindlessly is a perfect balance between the two often contradictory goals of “survival” and “achieving the goal”. It is this balance that makes the enemy feel more “alive” and even “human”.
If enemies simply fight to the death, the implication is that “they wanted to die“.
Often, if enemies simply fight to the death, the implication is that “they wanted to die”. Beating them, at that point, is like winning against your dad when you were a kid. You just knew that he was letting you win. The victory didn’t feel as good for it. In fact, many of us probably whined to our fathers, “Dad! Stop letting me win! I wanna win for real!” Believe it or not, on a subconscious level, this is making the player “mad” as well.
They want to win but you are making them choose to live instead!
By given our enemies that small implication that they are trying to survive, the player is given the message that “you are powerful… they want to win but you are making them choose to live instead!”
Here’s hoping that we can actually move beyond this odd artificial limitation on our AI.
I’m about to leave my hotel for my daily drive into the LA Convention Center. I’ve been watching the prodigious flow of information on Twitter (and, by proxy, elsewhere on the internet) the past 36 hours now â the press conferences, announcements, etc. â and I’ve noticed the yearly trend occurring once again. Juxtaposed alongside the slobbering exclamations of “that looks so cool” are the more cynical comments along the lines of “gee thanks for showing us a cinematic trailer… can I see the gameplay, please?” These comments are well-deserved. After all, we are selling games, right?
For movies, doing a trailer is a touchy thing… you want people to understand the premise of the movie but you can’t venture into the territory of spoilers. The longer you make the trailer video, the closer you get to recreating the entire movie. One could claim that for some bad movies (esp. certain action flicks or romantic comedies), all the highlights are in the trailer and the rest is simply filler.
For games, however, people don’t want to know simply the premise. They want to know how that premise is going to be interacted with. Some things have become so standard that the description of the genre is all we need. For example, is it going to be 1st person, 3rd person, shooter, RPG, turn-based, real-time, etc. Those are terms we all know and can somewhat infer other aspects from. Still, we would like to see something other than the equivalent of a movie preview. What am I going to be doing? What does it look like?
“I really don’t like playing game demos.”
So… off we go to the expo floor where we can actually do the “hands-on” play, right? But here’s where I really start to diverge from the masses that descend upon the LACC every year. I really don’t like playing game demos. I get very little out of them. There… I said it. So sue me.
Perhaps some of it is due to the fact that the types of games I like involve components that are not tractable to experience in a short time. I like to have an exploration of game mechanics. Button mashing doesn’t do it. I like more cerebrally engaging tactics and strategy. You can’t do that in 15 minutes on the expo floor. I like character development. At E3, I can learn less about a character than I learned about the person in my hotel elevator on the way down to breakfast just now. And, given my line of work, I like detailed, realistic, character AI. At least this much I can gather from watching over people’s shoulders â which is usually how I elect to experience the E3 show floor.
“You can’t do that in 15 minutes on the expo floor.”
This is obviously something that is simply endemic to the delivery medium. Much like the movie trailers, the only way to “get” some games would be to play them entirely. The more that people play the game demo, the less of the actual game remains. At some point you have to put down the controller and go on faith. But how long is long enough? And given the number and variety of titles on the show floor, how long to dedicate to each one? I suppose that’s why many people who come to E3 have only a select few things they want to see and play. Unfortunately, to me, that seems to be missing out on some of the point of E3.
Unfortunately, it seems that a parallel between movie trailers and game demos such as those found at E3 are that they both cater better to the shallower fare. The shallower a movie is, the better “feel” you can get for the whole thing in a trailer. For more depth on whether or not it is good, you have to read reviews, synopses, etc. The same for a game. If all you are after is stunts and explosions (in either medium) then a trailer/demo will let you know what you’re in for.
“It becomes a big psychological game for me.”
In my strategy, I try to look at a little of everything. I want to take the pulse of the industry… not just the giant titles from the mammoth houses but the small off-brand products as well. What are the little games that people are making? And why? What are the niches that are out there? Can I mentally predict who is going to fail? Do some of the titles strike me as being completely and utterly useless? And is that a function of the title or that I simply don’t like it? If it is me that is out of sync, can I step outside myself and determine what kind of player this title would be for? It becomes a big psychological game for me.
My kids have asked me over the years, “dad, wouldn’t it be cool to have your game at E3?” To explain, they mean my current labor of love, Airline Traffic Manager. Their blind pride for their father aside, this is simply not going to happen. Even if I made the best airline management simulation on the planet (which I aim to do), it is simply not something that is even possible for people to “get” in the hors d’Ćuvre-sized morsels that E3 is meant to serve.
Or maybe it will be on the floor some day… and someone will walk by and ake, “I wonder what kind of market and airline management sim would appeal to?”
All 12 of the sessions for the 2011 GDC AI Summit have been posted on the Game Developers Conference site. Once again, the AI Summit features a staggering array of content from over 20 AI developers.
The full list of sessions can be found here. The schedule will be arranged in the next week or so.
This year, GDC is February 28th through March 4th. Make sure you get registered soon!