Improving Monster AI

We’ve had quite a productive discussion in the comments of this week’s articles. Another great topic came up about improving monster AI. Lately the trend has been more toward highly-scripted encounters resembling ‘intelligence’. We all know that’s a bunch of crap. Public Quests, “Dynamic Events”, etc., are all just scripted events that run, complete, then reset.

One idea from the comments yesterday was: “An orc facing a lone opponent will attack, but if there are three or more people nearby, he runs away. Unless there are other orcs nearby, in which case he calls them over.” This is very similar to the “bring a friend” (BAF) type system we saw in EQ and DAoC. Also the “call for help” some monsters did when they would run away and bring more monsters back with them.

Camping a dangerous area full of really tough mobs (note the 2 words ‘dangerous’ and ‘tough’) back in early EQ days required you to use spells to manipulate mob behavior. I remember needing spells like “Lull” to pull one mob at a time. I remember one person’s job was to snare or root a mob (usually snare since it would slow them enough, and if a mob was rooted it would still attack which increased downtime) so that the mob could not get away and bring back more friends.

Another idea for improving mob AI was more along the lines of unpredictable elements influencing monster behavior. “A long list of random hidden stats would affect how mobs interact. Using the orc example again, one lone orc that spots three players may attack if his strength and bravery stats are high while intelligence is low. A different orc may gather friends.” I love the idea of having visible cues for these traits such as bigger orcs probably having more bravery, and scrawny orcs having more magical abilities or intelligence — intelligence would likely mean getting friends before charging in alone.

One of my favorite ideas was something else brought up: Players taking control of monsters. I remember this being a feature in EverQuest for a short period of time, and a PvP feature in Lord of the Rings Online. I think the idea of letting players take control of monsters from a zone and even level them up is a fun idea worth exploring. The more a player played as a monster, the more powerful their monsters would be the next time they play. This way players are encouraged to be great monster players and not just use them for griefing. Obviously tons of work on a system like that is needed, but it has potential.

All of these ideas are really just getting at the fact that mob ai in today’s MMOs is weak. It’s really predictable, not much of a challenge, or hasn’t changed much in years. There are lots of ways to increase the dynamic nature of PvE without just increasing health, how much damage something does, or making it happen in phases or waves. Players like myself would like to see more variety, and development time spent, in this areas.

  • I really think there’s something to the mob player idea. I’m glad you liked it. It does obviously need a whole system designed around it. EQ’s system was tacked on and so it failed.

    There also needs to be a system to dissuade players from “feeding” mobs to their friends which was EQ’s biggest concern I believe, aside from griefing of course but that’s the next system. Players should never know what they will drop. They should know that dying worsens their loot and xp while living longer and killing mobs/players improves loot and xp. The latter providing a much bigger boost.

    Player mobs need to be susceptible to whatever taunt mechanics the game uses. Lock their target for a few seconds. Have them deal 100% damage to the player with top hate. If someone has 50% hate you deal 50% damage to them with direct attacks. Maybe it’s worth suddenly charging a healer or dps with 87% hate. Would open up some interesting strategy I think.

    God, I would love to be involved in making a game, lol.

  • Blank Desert has this with formations. Bike man has been streaming the Korean version and some examples he’s down is like:

    If your group is in a line you have increased dps, but if your group is in a circle around the enemy you have increased defense.

    The mob in theory is suppose to change its tactics depending how you group is positioned.

  • Back around when DAOC launched I remember reading a few developer comments about mob AI. The gist of it was that making smarter monsters wasn’t really a problem – the problem was that players wouldn’t stand for it.

    As in all these discussions, I think time and experience demonstrates that, as far as your (and to a large degree my) preferences go, MMOs have developed in the opposite direction. This, I would contend, is not due to lack of foresight or an inability to do “better” by the designers; rather it has been in direct response to player demands and, more importantly, player behavior.

    In Everquest itself players would always gravitate towards any content that didn’t require them to deal with the kind of quasi-intelligent behavior you describe. The easiest, least-challenging pull spots and camps always filled first. Those were the ones that generated lists. The only counter to ease of access was reward – people would do all kinds of “difficult” things if the bribe was sufficiently large. Absent that, though, easier content always won out.

    Moreover, what was grouping in EQ other than a means of rendering the kind of mob AI you describe ineffective? I vividly remember the extreme risk of trying to hold back wall in Velketor’s Labrynth in a duo, saving the camp until the rest o the group could get there, then seeing the risk diminish as each group member arrived until, with a full group, risk disappeared altogether and we were set for the much-lauded 3-hour chat and joke around socializing session we’d all really logged on to enjoy.

    If someone can come up with quasi-intelligent mobs that don’t require either their intelligence to be neutralized or their numbers overwhelmed before players can enjoyably cope with them then we’ll really be on to something. I’m not convinced, however, that genuinely intelligent behavior from mobs is going to be a lot of fun. They are always going to have better reaction times, less lag, fewer disturbances and better spatial awareness than any player, after all. They start with a massive advantage which is why they have to be stupid.

  • I was going to write what bag puss just said. The problem was never designing the ai, but that smart ai would crush players as mobs have many inherent advantages.

    Champions online also had a similar system that turned incredibly annoying when portions of groups would keep going for more help, resulting in your defeat as you’re swarmed by 8 or more enemies that keep getting help when they get low.

    Never mind creatures with more intelligent behavior, who could come in groups and St unlock you instead. Intelligent stuff is really for more tightly controlled encounters like bosses rather than standard nooks in order to avoid player frustration.

  • All those tactics that were used in EQ (lulling, mezzing, snaring) have really gone by the wayside, haven’t they? Which is a shame, because their presence was one thing that made it important for players to communicate. These days gameplay tends toward “wade in and kill”, and everyone is expected to know how do do their part (which amounts to very little) without anyone saying a word. Not much camaraderie there.

    The sort of AI that I describe would be great for dungeon boss encounters as well as regular mobs. Dungeon encounters have become highly elaborate affairs with lots of special effects special attack abilities, special environmental effects. But it’s all pretty much scripted, and therefore boring. Learn the encounter, and you’ll repeat it in your sleep. Instead of simply boosting the bosses’ HP and damage, why not make them more unpredictable and give players a reason to think?

    I agree that as mob behavior becomes more varied, visual cues will become more important, especially when we’re talking about boss encounters. If a boss has a really devastating attack, he should telegraph it clearly well before using it. (Like Godzilla holding position and flashing his dorsal scales for a second or two before unleashing his fire breath.) Better yet, he should use that attack once before the fight even begins (to destroy some NPCs or scenery, for example) so that players will have a chance to learn the pattern before it is turned against them.

    @Bhagpuss: “They are always going to have better reaction times, less lag, fewer disturbances and better spatial awareness than any player, after all. They start with a massive advantage which is why they have to be stupid.”

    Yeah, that’s true. The fact that mobs in EQ could do an instantaneous (literally 0 time elapsed) about face, without any sort of reorientation lag, always struck me as patently unfair.

    Now, I never said mobs should be “smarter”; I just suggested that their behavior should be more varied. Those aren’t necessarily the same thing. I think programming those orcs to do something monumentally, suicidally stupid under certain rare conditions would be a great idea! Anything to break up the humdrum.

    But you’re right, insofar as more varied behavior would tend to make mobs more dangerous, it comes down to the same thing. Especially when you consider the advantages you mentioned.

    But then again … those advantages are themselves the result of relatively primitive programming. Those mobs can turn on a dime because that was the easiest way to do it. But since we’re now talking about using technology to make mob behavior more varied, why not use it to make them more stupid? Instead of making their behaviors bland and boring, we could make them react more like humans.

    It shouldn’t be too hard to make mobs turn around more slowly and wait to attack until the turn is finished. Slow reaction times can be simulated by adding a timer before the mob reacts. There are also algorithms for spatial awareness and such. These things could be also be accompanied by visual clues. When the orc has just realized he’s outnumbered, let him take a step back and look around as he decides if it’s time to run. Or just give him an ability called “Yikes!” that causes him to stop attacking for one second, with a progress bar that fills up as he thinks about his next move.

  • Personal Pet Peeve of mine is calling it “AI” at all. Thems’ just scripts, folks. Nothing but if>then when you break it right down.

    Semantics aside, I think the best idea here would be a mixture of “more intelligent” scripts, ala running away or calling for buddies kind of thing, and then ALSO the more tabletop design idea of having hidden stats that affect behavior. If we mixed both of these things the possibilities are endless.

    As far as players being mobs…. Anywhere this happens I simply see it failing. The desire to exploit it in some way would always win out with the masses. Because of this, I prefer the Dev-Controlled super-mobs (bosses, whatever) that present more of a challenge for raids and give a real sense of accomplishment. Plus, any Dev that fell to the dark side and decided to exploit could promptly be fired. Reason enough to stay on the straight and narrow.

  • Don’t forget the power of feign death for pulling mobs! And the person who talked about people “feeding” mobs to their friends must never have played EQ. Some of the best group interaction happened when the person was out pulling and everybody was just standing around chatting.

    While I love this extended conversation we’ve been having this week it feels a little like preaching to choir. Yeah we agree but nobody making games in the last decade seems to.

  • @Baba:

    “While I love this extended conversation we’ve been having this week it feels a little like preaching to choir.”

    Agreed. Unless perhaps there’s a small chance that some enterprising developer might happen across the blog and decide that there’s a niche worth courting here.

    I think I have said this before (and so have Keen and others), but the real problem with the MMO industry today is the fact that developers no longer want to think of their games as niche products. The success of WoW seems to have gotten every developer thinking along the same lines: “if we can’t target the mainstream, it ain’t worth doing at all.” This affects everything from budgets to gameplay design, and it’s a recipe for failure.

    Let’s face it: no new MMORPG is going to have as much polish as WoW, or as much brand recognition value, or as huge a community. Any game that merely tries to grab a slice of that pie is going to look slightly lame in comparison. At best, it may become a temporary haven for folks who are looking for a change of flavor; but most of those will doubtless jump ship when the next WoW expansion rolls around.

    That being the case, the best approach would be to design something for us folks whose needs aren’t being addressed by WoW and its clones. We are a niche market, to be sure, but so were the original MMORPGs. And that game is still around! So set your sights (and your budget) a bit lower, and create something with a bit less flash but more substance. Something that will keep us around for years.

    The above rant is addressed directly to any enterprising developers who may happen to wander by. Our hopes lie with you. Go forth and clone no more!

  • I get the feeling some people aren’t reading all the way through posts.

    Few things. I guess AI is the wrong word to use for describing how mobs will interact with the world. Once engaged in combat they would perform the usual “attack the guy with 100% threat” routine. Outside combat and leading up to combat is where their interactions would come into play. If an orc with high leadership is around will he decide to set up an outpost of his own? Will other orcs follow him? Will they decide to attack a player city? Are there intelligent orcs around? If so might they decide to start building seige weapons? Now imagine as a player stumbling across this remote outpost that wasn’t there before. It looks like they are building seige weapons! They would still function like the mobs we know in most cases. You could pull them and kill them. With enough people you could kill them all and either claim the outpost or burn it to the ground.

    When referring to “feeding” mobs to players during the short time in EQ when you could actually PLAY as a monster. People would log in as a monster and purposefully die to players to give them free experience without the threat of actually fighting a mob. If you had read the post you would’ve known it wasn’t referring to pulling mobs to a group.

  • @Gringar:

    “I guess AI is the wrong word to use for describing how mobs will interact with the world.”

    I think the term “AI” is applicable to behaviors both in and out of combat. In existing games, both kinds of AI tend to be rather rudimentary, to the extent that (as Rawblin says) it’s really not artificial intelligence, it’s just scripts. There’s room for more variety of mob behavior both in and out of combat.

    In my comment yesterday I focused on the in-combat variety as an example, but I think your examples of how mobs might behave out of combat are just as intriguing. They also remind me a bit of what the folks at SOE were saying we’d see in EQ Next, though I got the feeling at times that they might really be talking about scripted events. If they are indeed talking about making mobs more sophisticated, then they can keep their voxels, I want some of that stuff!

  • Fun fact: My job involves designing tactical AI outside of the gaming industry. And I don’t think I could put much of that in today’s MMOs, outside of instanced dungeons.

    I think many of the problems with MMORPG AI stem from the fact that most MMOs are balanced so that a single player can only handle up to 2-3 mobs at a time. You have to make them *incredibly* stupid, or the risk of being overwhelmed becomes too high. So we end up with the same old thing in every game: a bunch of mobs doing a random walk (or standing still) in an open field, who charge at you when you get within a few metres of them.

    Any half decent AI would attack as soon as one of their buddies has you in their line of sight or hearing range, smell, scrying spell, security camera etc. But for that to work in an MMO, you’d be limited to really claustrophobic environments with lots of cover. And stealth-based characters would probably rule the game.

    Alternatively, if you insist on having the large, densely populated open environments you see in most MMOs today, they’d have to be populated entirely by ultra-weak trash mobs that your character or group can mow down en-mass. Because as soon as one sees you, they’re all coming at you. Then you’d have the problem that one player or group would quickly clean up an entire area, so what’s left for the next player/group to kill?

  • Interesting perspective, Fuzzy. I appreciated the explanation of why mobs always seem so much more nearsighted than players, a fact which has always amused me.

    I’ll probably be in the minority on this, but I would like to see an game with huge, truly vast areas that are only sparsely populated with hostile mobs. (The zones in most games these days strike me as fairly small.) Modern games have gone a bit to far toward the action RPG end of the spectrum; what they offer is not so much adventure, as it is a bit of recreational genocide. Wading through scores of predictably stupid mobs gets boring.

    I’d like it if the game was as much about finding foes and traveling to them, as it is about killing. And once you’d found them, there wouldn’t be many; but they’d be smart, and you’d need good tactics to take them on. Each encounter would be the equivalent of a boss encounter, in terms of challenge, reward, and entertainment value.

    Of course that poses other challenges. With such vast spaces, you’d need to have some way for players to get to each other quickly, or grouping would be difficult. And I suppose most people would get bored with the idea of riding around looking for adventure. It’s not everybody’s cup of tea, but then as far as player types go, I’m definitely at the “explorer” end of the spectrum.

  • Fun read. As one or two other posters brought up (Grangar..), I also recall hearing developers talk about “Smart AI” and its downsides. Apparenlty, their testing didn’t see fruit.

    But my opinion is we’ve only just started to explore AI and MMORPGs. To say or even think we KNOW “smart AI” is undoable, is patently premature.

    Then there’s hte post by Fuzzy who says he’s worked with tactical AI. He says hte problem is NPCs will crowd together and storm players. This means limitations on the numbers of NPC’s and their ability to see each other which might also place limitations on the player or the world.

    Now, I don’t want to jump and judge yet, so I want to mention Ryzom. It’s an MMORPG or MMOSandbox which (I’m told) has implemented better AI for its NPCs than average. I actually played Ryzom for a while and can’t say for sure if this claim is true. From what I recall, NPCs do call out to each other for assistance and run when low on health. They might do more than that. But I guess the main takeaway is if the AI can (supposedly) be better in Ryzom then it probably can elsewhere.

    In the realm of single player games, I’d like to mention this gem: Here’s the wiki link for it:

    The name of the game is Outcast, an 3d action-adventure hybrid produced in 1999. This isn’t just any action-adventure. It’s a sprawling world with few restrictions on the players actions.The 3d engine was termed as a Voxel engine, but it’s actually – more correctly – a ray casting engine. Its graphics, for the time, were gorgeous and in some ways ahead of their time. Today they’re not nearly as enjoyable, but it’s not just the grahpics which make this game stand out to me. It has factions, projectile physics, great music and non-linear play. It’s a lot, and….. the AI.

    Here’s some sections from the wiki:
    “……Soldiers will sound different alarms with a horn-like instrument when they see the player, to give orders to others nearby. They will try to move behind the player in order to flank them, and search the area or call for a meeting when they can no longer find them. In addition to soldiers, the hostile and less intelligent Adelphan wildlife will also try to fight the player if they come too close.”
    “The AI used in Outcast was considered revolutionary at the time it was released.[10] It was based on a proprietary engine codenamed GAIA, for Game Artificial Intelligence with Agents, which was composed by a set of C++ libraries that provided sophisticated control of game characters based on research in distributed AI. Intelligence is represented as a distributed activity over a set of autonomous routines called agents. An agent uses skills, such as hearing, sight, acrobatic, to complete assigned tasks. These agents can interact and even compete with each other to realize a complex task.”

    So am I going to say what I think? I don’t thikn I have to. I wanted to give a couple examples of games which have tried to use AI in ways which we don’t oftne see. I think instead of talking about it, game designers just need to do it and see where it goes from there. Lord knows years from now when computers are like the supercomputers of today, we’ll have a lot less excuses to do these things.

  • Interesting topic, especially with Daybreak breaking ties with Storybricks, the company that was designing the AI for EQN. I do not think I was buying all of the devs hype about their improved AI but at least they were attempting to improve it on current MMOs. I remember when these stories were first coming out and the devs were saying that there would be no trinity because the mobs would be too intelligent for it. The mob would be able to figure out to go after the char with the highest dps or the healer.

  • This is a point I also have gone on about and find it to be a fundamental and yet purposefully overlooked flaw in MMORPG’s.

    We have become habituated to unintelligent AI and so just accept finding a field of hostile monsters marching back and forth like their day job is to wait to be harvested for loot, all in clear line of sight of players, won’t attack until attacked, and when one is being killed the others will ignore the slaughter of their brethren instead patiently waiting for their turn to die.

  • Imagine if mob had lives with purposeful tasks that varied throughout the day, and actively sought out those that wronged their tribe.

  • I’ve always wanted an open world that contained destroyable mob spawn points that would randomly appear in the game world. These spawn “barracks” would produce a new mob on a set interval, and have a cap to how many active mobs they can have in the world. After a length of time going undestroyed, they’d get upgraded and produce more mobs, or stronger mobs more quickly. Then the mobs would be free-roaming the world similar to how mobs would in ultima online, but with smarter creatures or social creatures give AI to be able to attach and form groups that roamed together. Mobs would fight against other hostile mobs logically, even destroying their spawning structures when the opportunity arose. (lizard men vs orcs, wolves vs sheep, etc) I’d even let the mobs attack and kill NPCs in towns used the players, and potentially invade those cities.

    Dynamic events would then be triggered *gasp* dynamically. If a particular forest gets a certain number of wolf caves, or wolf caves to a certain level, then a forest wide event would begin where those caves increased spawn rate, and some of the new spawns would get special pathing to attack a specific static location, like a farm or town. They’d eventually slaughter all the critters on the farm and keep it devastated, or players would tackle the event, wipe out the caves, and clear the farm. Or maybe that same forest ends up with a bunch of high level orc spawn structures, and an event triggers to have the roaming orc groups all suddenly get pathing straight to the nearest city for a raid. Without player intervention, the orcs would eventually totally occupy the city, and disable the respawn of the NPCs until players intervended and cleared the event. Even then, you could have the cities in the game be a static spawn for PC friendly guards that constantly patrol the town, and when there’s enough guards alive in the game world to staff the city properly, some of the new spawned NPC guards would get expanded pathing freedom to nearby areas of the map giving extended patrols into the wilderness.

    You could setup such a city guard “barracks” to have parameters like this:

    City Guard Faction Spawner (new guard spawns every 15 minutes, Guard Commander every 2 hours after previously killed, static spawn point, friendly to players, not destroyable)
    0/20 city guards (guards that can only path within city limits)
    0/15 patrol guards (guards that can path to adjacent biomes to the city)
    0/10 war party guards (guards that remain in the barracks, and will automatically path towards any events in a nearby biome to assist players with tackling the event)
    0/5 elite guards (groups with guard commander, if guard commander is dead, protects barracks, 45 minutes spawn interval, elite level mob)
    0/1 guard commander (leads war party, otherwise remains in barracks, boss level mob)

    Stuff like that. All the “spawn camps” would be setup like that, whether a static NPC guard barracks in each city, or a random orc camp/wolves den/spider nest/etc out in the wild. Wouldn’t even need dungeons I’d bet. Just randomly roaming mobs with slightly different social AI on how they interact with their own kind and other mob kinds would be really cool. Then events based on actual the world state of the mobs. Heck, could even have some orc spawns help complete the wolf event mentioned above by a roaming band of orcs from the local orc spawn stumble upon and destroy the wolf cave that the players haven’t found yet. Players wouldn’t even known it had happened other than the event completing.

    Other than that, you’d just need to design a really interesting world map, and flesh it out with various possible creatures and give them plenty of potential spawn locations or a good random spawner for where their “destructible barracks” can appear. Maybe wolf caves can’t spawn in desert biomes. But wolves could path into desert biomes if it were right next to the forest that can spawn wolf caves. Living and breathing world that is active while you’re gone. Done. It’d run as an interesting system, even with the players not present. I’d probably scale the number of different camps that can exist in an area based on the number of player characters currently in that area. If player population drops, the cap drops, but existing structures will remain until they’re thinned out by the lower player population, or other mob infighting.

  • Hey Gali, what you say there isn’t really AI, but it’s more relevant to dynamic spawnig and/or dynamic events occuring in the game. A lot of games have used either/or and some have used both. For example, in Wurm Online, creatures are attached to a den or “spawn point”. The den isn’t labelled or anything. You have to see it to attack it. If you destroy the den then the creatures will not spawn there anymore. They also will roam around freely after spawning, regardless of other variables. However, the rest of the behavior and dynamics is limited.

    It’s a very popular idea but very hard in principle to do in a full scale game. UO, in its early stages, attempted many of these things and ultimately failed. There were many reasons apparently.

    I think it’s hard to customize it to particular circumstances as well. This makes it hard to ensure it’ll be engaging and fun for the players. This is a problem many simulations face – how to make seemingly random occureances fun.