Zelda: BOTW Diary (35)

Alright, here’s a thing about the enemy AI.

I don’t really care for the way game developers use the term “AI” to mean “enemy behavior”.  Most enemy behavior is not remotely close to anything resembling what academics and researchers mean when they talk about Artificial Intelligence.  Much “AI” in games is super simple, deterministic, and basically linear.  More sophisticated “AI” combines several behavior states into a finite state machine system, where the enemy will shift from one to another depending on context.  These can be fairly sophisticated and make the enemies feel almost alive and maybe a little, tiny bit intelligent, but not really.  Most of them are super easy to fool, and once you figure out how they are triggered, what their vision radius is, they’re generally pretty easy to kill.

Bokoblins and Lizalfos for example, they seem to have a “home” point on the map, and they will not chase after you beyond a certain distance from this point.  It’s like in The Dukes of Hazzard, when the the Duke boys would be on the run, and to get away they would cross the county line, and Sheriff Roscoe couldn’t go after them across the county line… for some reason.  Once you’re out of their territory, it’s like they can’t see you anymore, and they don’t care, and they’ll turn around and walk back home.

To some extent that’s reasonable behavior.  I wouldn’t chase kids off my lawn for blocks and blocks.  Once they’re outside my property line, if they keep running away, I’ll let them.  But if they just stand there, and shoot arrows at me, I’m not going to start walking back to my house, take an arrow in the back, act surprised and look around, and then not see them because they’re across the street in plain sight but I can’t see them for some reason, and then give up and head back toward the house, only to get nailed again with another arrow.

But these bokoblin boys sure do!

That’s sad.  That an “AI” in such a beautiful game that in many ways is more an attempt to create a realistic model of a fantasy world than any game I’ve played before, still has such poorly developed AI.  This can’t be a limit of the hardware, and even the programming, I’m sure, could be done if someone had the notion to develop it.  

I think if the bokoblin should be able to still see you, he ought to react to you, as though you’re a threat. He should either attack, or seek cover, or run away, or call for help.  They do a lot of these things if you run into their camp area, but if you go outside, they lose interest in you a bit too quickly.

It makes the game easier, and there are times when I’m grateful for it, but I feel like when I run away, and succeed at getting away, I should have to have earned that, by really doing a good job of hiding and not by simply traveling beyond their give-a-damn radius for patrolling their home turf.

I also find it unenjoyable that it’s possible to use lame tactics like firing arrows from extreme range, where you can  hit the enemy and do damage to it, but they will never see you or react to you in any way.  They do react to the injury, sort of — they get knocked down, get angry, go over and pick the weapon they dropped back up, look around for a few seconds, and then if you don’t show yourself by charging in to finish up the attack, they… forget all about the arrow they just took to the head, and go back to standing around like an idiot waiting for you to finish murdering them.

Better AI would respond to these situations more realistically.  Getting hit with an arrow should be a major, life-altering event for an enemy AI, not something you forget about in five minutes, and you go back to standing where you were, only now bleeding.  

An enemy that takes a hit should not go back to standing where it was.  They should go off and seek healing.  They should run over to their friends and tell them what happen, and then the friends should bandage them up a bit, while one or two of the others grab some weapons and armor and head off into the general direction where they think the attack came from, and hunt you.  And if you get spotted, sometimes they will come over to attack you, but if you can hit them from way, way far away, well outside their visual range, they never will.  It’s like the world doesn’t exist for them outside of the bubble they live in.  And there’s plenty of ways to dish damage from a quarter mile off and never be seen.  They never seem to look up.  If you’re high enough, up a tree or on a tall hill, they’ll never know what’s been raining death on them patiently for minutes.

If you miss with the arrow, and it hits nearby, they’ll be alerted for a few seconds, but again, they’ll decide after a short time “it was nothing” and go back to their idle state, and completely forget about anything that just happened.  Well, every time you trigger an enemy from its idle state to an alert state, it should never go quite back to idle again.  It should go into a “heightened idle” where it remembers that something funny just happened, and if something funny ever happens again, at least in the next few hours, that should trigger them to go into a higher alert state than the first alert state they went to.  

Say something lands by your feet, startling you.  You look around to see where it came from. You’re maybe not sure what it even was, you just heard a whoosh and a thud by your feet, but you didn’t actually see it.  Maybe you can’t see the arrow, you don’t know exactly where it landed, and they’re hard to spot unless you know where to look, or happen to be looking right at the spot where it hit.  So after a second or two, you think to yourself “I don’t know what that was, but that was weird.  Huh, oh well.” and you go back to what you were doing.  But then it happens a second time.  Ok, now you know something is up.  Something is out there.  You don’t know what.  You don’t see it  yet.  But now your hair is standing on end.  You feel as though you’re being watched.  You feel vulnerable.  You move, and get out of sight, and start eyeing the treeline near the outskirts of your vision, straining to see any glint or motion, or something that wasn’t there before, something that isn’t right.  

If something happens again, well, you call your friend over and get them to help you, or you go find your friend.  Maybe they sneak out around the back way, out of sight, and start sweeping the general area, looking for you.  If you’re not up a tree, motionless and silent, or  using some significant stealth buffs, they’re likely to find you, unless you carefully use cover to stay out of sight.  

And that’s if you miss.  If you hit them, or if you lob a freakin’ bomb into their camp and it goes off with a huge, loud explosion, they ought to damn well behave as though that just happened.  A general alarm should go off and everyone should be on alert and they should hunt for whoever did that until they find them, and not give up for a day or two of wide-ranging perimeter patrols.  And after that, things should not go back to normal.  They should set up an ambush point on the approach to their village, or beef it up if there already was one.  They should set some traps or trip-wires or additional fortifications.  They should go to high alert much more readily after the first alert, and respond in an escalating fashion where they do more each time something sets them off, until they perceive that the threat has been dealt with, or the unknown has been identified and determined to be harmless.

That’s what it should be like, and that’s what’s missing with from the game, with the “stupid” AI behavior of these enemy creatures.

As well, there should be more variability into what the AIs decide to do next when they change behavior states.  The typical AI finite state machine is a series of interconnected behaviors where one behavior state connects to one or more others in the state machine.  But most of the time the state changes are too predictable, because they are connected by a rigid, deterministic logic.  

For example, if an enemy is on its “high alert” behavior, it will either transition back to “idle” if the enemy isn’t able to detect the player, or elevate to “attack” mode if it is.  This is too simple, and leads to the AI agent always behaving in the same way, repeatable and predictable, manipulatable and exploitable.  

Instead of that, it would be better if AI agents had behavioral drivers, which model the agent’s decision making.  Then the AI’s state machine transitions could be influenced by a complex, less deterministic seeming process.  Various factors could enter into an agent’s decision-making:  are there other friendly agents near it?  Is it injured?  How badly?  How long has it been since it last was in its sleeping behavior state (ie, is it sleepy?)  Is it exhausted?  Is it frustrated (has the player been screwing with it a lot?)  Has it seen the player?  Is it able to tell whether it’s stronger or weaker than the player?  Is there a nearby object that it wants, such as a weapon, or food, or some treasure that it guards jealously?  Various behavior drivers could influence the agent to make better, more realistic seeming choices to move through its behavior-states, and avoid looping through the same “dumb” behaviors repeatedly, as though the AI has no memory or ability to reason, or to choose between a few roughly equally reasonable behaviors.  

I think some day we’ll see this, and it will probably be fairly soon.  It might even be in other games that I haven’t played or heard of for all I know.  But I think when that level of sophistication becomes normal and expected in video games, they’ll have advanced the state of the art to a new level. 

We get a few glimpses of this in BOTW.  If an enemy has dropped its weapon when it gets knocked down, it will go and pick it up first before running back to fight the player.  So it has a certain priority order in which it decides to do things.  But this priority system is as yet too simple and agents always decide the same thing given the same collection of factors. An enemy never gets knocked down, drops its weapon and decide it’s too injured and should run away, or surrender.  It always gets back up and grabs its weapon and tries to fight.  And when it goes to fight, there are a couple of different tactics that it might use, but mostly it’s charge the player, or stand at a distance and use a ranged attack.  A few enemies do have multiple tactics that they can switch from, but for the most part it seems like they make the “decision” randomly, rather than with cunning.

Breath of the Wild does have some amazing stuff in it.  The atmosphere created by the Day-Night cycle and the weather system is impressive.  The climbing animation and kinematics is very well done.  The horse riding is pretty good.  The fact that pretty much anything in the game can interact with anything else through the physics system or through elemental effects is amazing.  But I’m not impressed with the enemy behavior — it still feels about the same or not much more advanced than what I was seeing in games like Half-Life 20 years ago.

And that’s kindof a shame.

Updated: 2020-May-04 — 8:05 am

Leave a Reply