Question about NPC AI and Enemy AI.


Pathfinder Online


With all of the PvP topics around there has been only a handful of topics for this that I could find. Now I understand commoner NPCs wil be randomly wandering around hexes just muddleing about until someone starts a settlement a mine,lumbermill, camp ETC. As far as I know we really don't have a whoal huge need for seriously intelegent AI and I am not sure if I want any. (Personally if their is a world boss monster walking around I would love to see a dev playing it.) but as dungeon crawls go I would like to something better than WoW clone walking bags of loot. I do not mean a hard 50 lvl dungeon you have a chance in abbysal to win. A nice semi-dungeon crawl with friends would be nice. something a few lvls deep couple dozen mid difficulty monsters and three or four tough bosses with more moves than attack and stare at wall until something attacks me attitude. I saw your video and I know it is not really all that important but how about try and give a litle life into AI. give goblins something to do. have them look like they are playing with fire, cooking, sleeping, haveing a thumb wrestling tournament thoughout the cave. I just don't want to feel that fighting a cloud giant feels like fighting a goblin and the AI is identicle. There should be no time when; i say
let's go hunt some storm giants that should be easy money.

Goblin Squad Member

Yeah I am very, very interested to get more info on the dungeons. Most of the talk has centered on the PvP and settlements that is true. But this is Pathfinder and that means we need cool dungeons to explore.

I hope the dungeons are truly Pathfinder/DnD in nature. Traps, tricks, riddles, secret doors and such, not just spanking and tanking.

Goblin Squad Member

I'm hoping monsters are diverse, intelligent, somewhat adaptive and have a range of abilities that make them interesting to fight, also variable, I hate how static and predictable monsters and their spawns have become in newer mmos, even uo had less predictability in spawns than newer games I hope we get diversity, not just a dungeon filled with goblins with progressively more hp and very little change in strategy.

Goblin Squad Member

I agree, I love my PvP and trade stuff, but some times I do just want to go hunt down something in the wilds. And as for dungeons, this Pathfinder so I really do hope to see well thought dungeons that have more going for them then just the fights.

Goblin Squad Member

Arlock Blackwind wrote:
Now I understand commoner NPCs wil be randomly wandering around hexes just muddleing about until someone starts a settlement a mine,lumbermill, camp ETC.

I may be misunderstanding this, but just in case I'm not I wanted to point out that the Common-Folk NPCs - the "sims" that Ryan talks about that do the grunt work of operating your Harvesting Camp or your Processing Facilities in your Settlement - won't actually be visible in-game. You won't see them as you're walking around.

As for the rest of your post, I wholeheartedly agree that fighting a Goblin should feel radically different than fighting a Dragon.

One thing that I really don't like about LOTRO is that virtually every outdoor zone has Boars and Wolves in it, it's just that they're higher level than in the previous zone. So I started out killing level 4-6 wolves, then moved up to killing level 10-12 wolves, on and on until I'm fighting level 60-63 wolves. It really contributed to the sense of "chopping wood" - that combat was just a slog to beat through the same old mobs over and over again.

I don't know if it's this way in PFRPG (if anyone has insight into this, I'd really like to hear it) but I'd love PFO to make pretty much all Bears stronger than all Wolves, etc. It's fine if there's the occasional Dire Wolf that might be tougher than the weakest Bear.

Goblin Squad Member

Also want to see lots of doors/chests with locks to pick, secrets to discern with perception rolls and traps to find/disarm. Gotta have something PvE wise for us 'light armored warriors' to do in between shiving people in the back :)

Can we also NOT have the anti-rogue code many MMOs seems to have (GW2 most recently) in that mobs seem to instantly detect a rogue coming out of stealth behind them, turn on a dime 180 degrees and attack them while ignoring the raging barbarian they were facing.

Goblin Squad Member

Of also like to see secret areas and levels that make you go "wow I've been coming here for months and never knew about that area!"

And puzzles- puzzle locks and traps, things that are randomly generated but follow rules so it's not a case of just looking up a walk through for the answer

Things like the golem control towers in uo, where there was a correct path to deactivate it that you had to find, make a wrong move and you get electrocuted, do you better have a healer on hand to keep you alive.

Mazes that change, stuff that keeps you coming back for more adventures!

Goblin Squad Member

That would really be awesome if they could make the Dungeon-crawling experience like a good book where every time you read it you notice something new.

Goblin Squad Member

"Through one of these doors is the way out. Behind the others is near certain death. Except one other, which has a goat. From the darkest reaches of hell."


we can only hope that goat likes grass instread of freash blood. I wonder what kind of cheese I can make using a goat like that?

Any idea on what roaming mobs you want to see ocassionally attacking our settlements. my vote is for goblin or undea. ow maybe undead goblins. Brains.. ughhh ... plushiessshh ideas ughh brains....

Goblin Squad Member

Arlock Blackwind wrote:

we can only hope that goat likes grass instread of freash blood. I wonder what kind of cheese I can make using a goat like that?

Any idea on what roaming mobs you want to see ocassionally attacking our settlements. my vote is for goblin or undea. ow maybe undead goblins. Brains.. ughhh ... plushiessshh ideas ughh brains....

I'd like to see (and I'm pretty sure it's been mentioned somewhere) goblin/orc settlements that grow if left alone and start attacking neighbouring hexes and expanding.

I'd love also to see wandering necromancers raising undead armies as they go, so as they progress, their army gets larger and larger and they get stronger and stronger xD

Also roaming dragons and their kin

The occasional cult raising a portal to a demon realm swarms of demons coming out until our heroes find the portal and close it (by killing the cultists?)

The occasional wandering insane mage that conjures armies of rabbits that just get out of control and eat all the crops so he has to be apprehended or slain

ravening hordes of barbarians... but I think we get them already with the chaotic evil alignment :P

and Gormug the pig lord! An orc herder with an army of aggressive boars.

Goblin Squad Member

Actually I'd also love a mage asylum dungeon that's full of really powerful and totally insane sorcerers and wizards that do really wierd and random things and cause a series of totally bizarre events, reality warping type stuff. An adventure you get to the end of and go "What the HELL just happened?"

Goblin Squad Member

1 person marked this as a favorite.
Arlock Blackwind wrote:
we can only hope that goat likes grass instread of fresh blood. I wonder what kind of cheese I can make using a goat like that?

Evil cheese. Abyssal Feta.

Goblin Squad Member

1 person marked this as a favorite.

What if NPC monsters could learn and evolve their behaviour? If a creature has a number of different attack actions, it could try some random ones along with its basic attacks, and the survival time of the creature and the amount of player damage it manages to cause could be tracked. When a new 'high score' is reached for a monster type, others of its type will adopt more of its behaviour into their default scripts, and vary from there. Over time, the system should learn to play that type of creature better.

For example, imagine a creature has options including a slow but powerful attack, a series of quick jabs, a healing power, and fleeing. One creature might power attack and jab 50% of the time each, while another might make a 75/25% split. The distribution could vary between 100/0 to 0/100, and whichever ones produce the best results would push the others closer to their distribution.

Some creatures of the type in the example may heal when they've hit 50% HP, while others might start at 75% or 25%. A similar but lower range could be set for the creature's morale breakpoint, when it flees and runs towards a safer place or others of its kind. The creatures that live the longest while producing the most player damage would again influence the rest of its type.

Goblin Squad Member

Keovar wrote:

What if NPC monsters could learn and evolve their behaviour? If a creature has a number of different attack actions, it could try some random ones along with its basic attacks, and the survival time of the creature and the amount of player damage it manages to cause could be tracked. When a new 'high score' is reached for a monster type, others of its type will adopt more of its behaviour into their default scripts, and vary from there. Over time, the system should learn to play that type of creature better.

For example, imagine a creature has options including a slow but powerful attack, a series of quick jabs, a healing power, and fleeing. One creature might power attack and jab 50% of the time each, while another might make a 75/25% split. The distribution could vary between 100/0 to 0/100, and whichever ones produce the best results would push the others closer to their distribution.

Some creatures of the type in the example may heal when they've hit 50% HP, while others might start at 75% or 25%. A similar but lower range could be set for the creature's morale breakpoint, when it flees and runs towards a safer place or others of its kind. The creatures that live the longest while producing the most player damage would again influence the rest of its type.

That would be cool, I'd love to have adapting and evolving monsters.

Can you imagine dragons that terrorised areas, then took off again, but learns more each time, so they became deadlier and learned more tactics, learned more about the attacks used against them and adapted? would be awesome.

Goblinworks Executive Founder

Jameow wrote:
"Through one of these doors is the way out. Behind the others is near certain death. Except one other, which has a goat. From the darkest reaches of hell."

If I asked the goat what you would say if I asked you which door lead to certain death, should I switch doors?

Goblin Squad Member

DeciusBrutus wrote:
Jameow wrote:
"Through one of these doors is the way out. Behind the others is near certain death. Except one other, which has a goat. From the darkest reaches of hell."
If I asked the goat what you would say if I asked you which door lead to certain death, should I switch doors?

Always switch ;D

Goblin Squad Member

Jameow wrote:
DeciusBrutus wrote:
Jameow wrote:
"Through one of these doors is the way out. Behind the others is near certain death. Except one other, which has a goat. From the darkest reaches of hell."
If I asked the goat what you would say if I asked you which door lead to certain death, should I switch doors?
Always switch ;D

Send in the guy in the red shirt first.

Goblin Squad Member

Jiminy wrote:


Can we also NOT have the anti-rogue code many MMOs seems to have (GW2 most recently) in that mobs seem to instantly detect a rogue coming out of stealth behind them, turn on a dime 180 degrees and attack them while ignoring the raging barbarian they were facing.

In Vanguard stealth isn't broken by attacking, and you generate less aggro and more damage. Coming out of stealth (ie playing solo) is generally a bad thing.

This post, along with the healing/trinity threads really asks the same key question:
How does the AI choose targets?
afaik there is no dev info on this yet.

re: evolving AI, this should be fairly doable on a small scale (ie learning to choose between different predefined actions/tactics) and is an interesting experiment. But expect players to adapt much quicker.

Goblin Squad Member

randomwalker wrote:
But expect players to adapt much quicker.

Or much slower! Sometimes I have an off day. :(


If anything we can expect a alrge amount of our day to day activities to include running off the ocasional wolf from the henhouse and goblins from the the kitchen.

Now what about Benificial wondering monsters. Like an infestation of brownies or a goldmine that is run by lephrachans. oh maybe a benevolent fragon roosts in a cave on your hex. A nice metalic silver dragon.

Goblinworks Executive Founder

What do metallic dragons eat? Where did my livestock go?

Goblin Squad Member

DeciusBrutus wrote:
What do metallic dragons eat? Where did my livestock go? Where did my gnome friend go?

Fixed it for you.

Goblin Squad Member

For information on what we already know (though much of the discussion here is new) about PvE, check out the blogpost and the corresponding thread for the blogpost, in which I think we got a lot more info, iirc.

The blogpost below the one I linked is actually the one that details how 'commoners' work, along with the game economy at large. It's actually one of my favorite blogposts, I highly recommend it. I think the corresponding thread for that one has more developer info, too.

EDIT: Nihimon, did I do good??? (linked straight to correct blog, didn't remember I could do that yesterday! ;)

Goblin Squad Member

Keovar wrote:

What if NPC monsters could learn and evolve their behaviour? If a creature has a number of different attack actions, it could try some random ones along with its basic attacks, and the survival time of the creature and the amount of player damage it manages to cause could be tracked. When a new 'high score' is reached for a monster type, others of its type will adopt more of its behaviour into their default scripts, and vary from there. Over time, the system should learn to play that type of creature better.

For example, imagine a creature has options including a slow but powerful attack, a series of quick jabs, a healing power, and fleeing. One creature might power attack and jab 50% of the time each, while another might make a 75/25% split. The distribution could vary between 100/0 to 0/100, and whichever ones produce the best results would push the others closer to their distribution.

Some creatures of the type in the example may heal when they've hit 50% HP, while others might start at 75% or 25%. A similar but lower range could be set for the creature's morale breakpoint, when it flees and runs towards a safer place or others of its kind. The creatures that live the longest while producing the most player damage would again influence the rest of its type.

Programming works in collectives of collectives of collectives of data. A child collective's data may or may not be accessible by a parent collective, and the reverse is just as true; it all depends on how the program is written. In general, hiding data from any part of the program that doesn't need it is good practice (this is called encapsulation), and in this case, it makes more sense for this to be true (after all, if you kill an entire group of goblins, it's not likely that they're going to be telling the other goblins that X works better).

This would slow the rate of learned behavior, but there could be a random factor in place to keep the game from seeming too static. For example, if an orc tribe equips a scouting party all with bows, and they don't come back, the chieften could decide the next group might need a melee weapon. And if that group doesn't come back, the next gets armor. And if that one dies, the next gets a different type of ranged weapon. And so on. It results it changed behaviors without them necessarily being learned.

By allowing it to spread upwards to parent collectives automatically, the behavior would change in strange ways: if two groups of fire elementals roamed the same area, and one encountered a party with a wizard who immediately cast protection from energy (fire) and the other did not have anyone to do so, the first group might report back that their slam attack that is half fire and half physical is more effective, while the second says that their fire wave ability (that hits harder by raw numbers) is better. While this could and probably would happen if the game required a child collective to reach another collective (parent or otherwise) for the information to spread, it would be much slower and happen less often (as the second party has a greater chance of dying to the monster). This -could- result in trends of gear and buffs and even debuffs amongst the players who try to keep up to date on how a given monster type currently fights.

It's just as possible to have the monsters recognize buffs/debuffs/gear and know what stuff does and how to react, and plenty of games implement this, and this would result in an overall smarter learned behavior.

I like the idea, and while it's not terribly difficult to initially implement, it's one of those things that would generate lots of bugs, and in programming, finding and dealing with bugs can be very time consuming. I think this is more of a feature after Early Enrollment begins.


Vendis wrote:
Keovar wrote:

What if NPC monsters could learn and evolve their behaviour? If a creature has a number of different attack actions, it could try some random ones along with its basic attacks, and the survival time of the creature and the amount of player damage it manages to cause could be tracked. When a new 'high score' is reached for a monster type, others of its type will adopt more of its behaviour into their default scripts, and vary from there. Over time, the system should learn to play that type of creature better.

For example, imagine a creature has options including a slow but powerful attack, a series of quick jabs, a healing power, and fleeing. One creature might power attack and jab 50% of the time each, while another might make a 75/25% split. The distribution could vary between 100/0 to 0/100, and whichever ones produce the best results would push the others closer to their distribution.

Some creatures of the type in the example may heal when they've hit 50% HP, while others might start at 75% or 25%. A similar but lower range could be set for the creature's morale breakpoint, when it flees and runs towards a safer place or others of its kind. The creatures that live the longest while producing the most player damage would again influence the rest of its type.

Programming works in collectives of collectives of collectives of data. A child collective's data may or may not be accessible by a parent collective, and the reverse is just as true; it all depends on how the program is written. In general, hiding data from any part of the program that doesn't need it is good practice (this is called encapsulation), and in this case, it makes more sense for this to be true (after all, if you kill an entire group of goblins, it's not likely that they're going to be telling the other goblins that X works better).

This would slow the rate of learned behavior, but there could be a random factor in place to keep the game from seeming too static. For example, if an orc tribe equips a...

Wow, really great ideas! I'm not sure how hard coding it would be, but the more intelligent the AI, the better the experience for the players and popularity for the game.

I remember in one game, war hammer?, they had it where humanoids could run back and get help if they were being slaughtered, or even shout for help. I thought that a cool addition to the normal felling trees combat in many games. :)

In NeverWinter online they have humanoids that can act together like one would throw down oil, while another would light it on fire. Cooperative acts like these would be cool to see.

Goblin Squad Member

The best part about this possible development is that it would really make traditionally farming 'hard'; as soon as a large enough population of players developed the trick of wiping out a whole group of NPC mobs, they would 'evolve' (cause that's effectively what this is) a new attack or defense method, likely negating the players advantage.

This in turn would require the players to adapt, probably necessitating new weapons to be made, new routes to be made, new resources to be farmed.

In fact, I'd dare say that this idea isn't just great, it's neccessary to keep an economy robust, and just a little volitle.

Kudos to the idea

Goblin Squad Member

The biggest problem foreseeable with evolving/learning AI would come in with the persistence of it's learning function. Where a group of mobs would eventually end up completely unbeatable. While it is a great idea for keeping things rolling forward there is still the question of how much learning will be retained. After a few up ticks in mob evolution will there be something fundamental that will again allow the players to triumph or will the mobs eventually become the lords and masters of all?

Goblin Squad Member

I would like to see:
- random encounters with proper AI and social networking
- game masters making the extra X factor in an encounter, motive/means
- also a lot of non hack and slash encounters, change the course of history kind of encounters


Akryn wrote:
The biggest problem foreseeable with evolving/learning AI would come in with the persistence of it's learning function. Where a group of mobs would eventually end up completely unbeatable. While it is a great idea for keeping things rolling forward there is still the question of how much learning will be retained. After a few up ticks in mob evolution will there be something fundamental that will again allow the players to triumph or will the mobs eventually become the lords and masters of all?

With the escalation mechanic, this might be a concern. Normally I would say don't worry about it, as a group of NPCs can expect a pretty good death rate and little chance to pass their knowledge along to other NPC groups. But really I think they could cap the amount of knowledge a mob has to where it's challenging, but fun.

Couple an advanced AI with the escalation concept and you have the potential for some truly epic battles as settlements fight off NPCs expanding into their territory. I can't wait! :D

Goblin Squad Member

I think the learned behavior should reset every now and then. If it was in an escalation cycle, it simply restarts when the cycle is over.

This way, you don't hurt new players by throwing very learned monsters at them all the time, but it maintains the increasing difficulty for those trying to deal with a particular group of enemies.

Goblin Squad Member

It would surely reset when that pack of baddies perished. But if they didn't then they should carry on, escalate, and become a challenge the Settlements have to band together to overcome.

Goblin Squad Member

Being wrote:
It would surely reset when that pack of baddies perished. But if they didn't then they should carry on, escalate, and become a challenge the Settlements have to band together to overcome.

This, but I also still expect mob behavior to be highly random.

I would like mobs to use the 'best current' strategy (best within the last week) about 20-30% of the time and the 'best overall' strategy (best over the last few months/year) about 10-20% of the time, meaning that mobs would choose at random any of the other strategies/equipment loadouts/force compositions 50-70% of the time. The best strategies would each have the highest share of outcomes, with the others having a lower, equal share.

I guess it might also make sense to change up the amount of 'learning' different sorts of mobs could do, so some could choose one of the two 'best' strategies as much as 70% of the time.

Goblin Squad Member

Good comments, everyone!

The idea I'm proposing wouldn't give creatures new abilities, it would just affect how they use the possible behaviours that they've got. Smarter creatures might learn to slowly sidestep from round to round, and emergently develop a habit of flanking. Those wielding large 2-hand weapons might learn when to power attack, or even to temporarily flee toward their camp and then turn around and charge. What they wouldn't do is suddenly learn to use keen thundering falcatas all the time if they wouldn't normally have access to such weapons.

I was also thinking that there could be some random factor in the mob's strategies. If orc druids normally try to heal when at 50% health because that's been working, some may naturally vary 10% either way. After all, they don't have a life bar to watch.

Information for what worked well should almost always propagate if the PC was defeated, and have a lesser chance if the creature was defeated, to represent the chance that there could have been some who fled to tell the tale, spies, whatever. There could be a 'regression to the mean' effect on the creature's behaviours to slowly push them toward a more 'average' starting strategy.

I suppose that if all that still didn't keep creatures from becoming too good, players could 'teach' them to be stupid by manipulating the system somehow. Find a creature that isn't terribly effective and play with it for a while, letting it get more 'survival' points, and letting it hit you more often if you have enough healing to counter that. Then let it go when it flees (or cast a fear effect) to make sure it spreads the word of its 'successful' strategy. :P


Keovar wrote:

Good comments, everyone!

The idea I'm proposing wouldn't give creatures new abilities, it would just affect how they use the possible behaviours that they've got. Smarter creatures might learn to slowly sidestep from round to round, and emergently develop a habit of flanking. Those wielding large 2-hand weapons might learn when to power attack, or even to temporarily flee toward their camp and then turn around and charge. What they wouldn't do is suddenly learn to use keen thundering falcatas all the time if they wouldn't normally have access to such weapons.

I was also thinking that there could be some random factor in the mob's strategies. If orc druids normally try to heal when at 50% health because that's been working, some may naturally vary 10% either way. After all, they don't have a life bar to watch.

Information for what worked well should almost always propagate if the PC was defeated, and have a lesser chance if the creature was defeated, to represent the chance that there could have been some who fled to tell the tale, spies, whatever. There could be a 'regression to the mean' effect on the creature's behaviours to slowly push them toward a more 'average' starting strategy.

I suppose that if all that still didn't keep creatures from becoming too good, players could 'teach' them to be stupid by manipulating the system somehow. Find a creature that isn't terribly effective and play with it for a while, letting it get more 'survival' points, and letting it hit you more often if you have enough healing to counter that. Then let it go when it flees (or cast a fear effect) to make sure it spreads the word of its 'successful' strategy. :P

Really like the ideas Keovar! None are too difficult to program into the AI and would result in extremely varied gameplay. An AI that learns from its mistakes is a great selling point for the game even though its been tried before in theme park MMOs. I don't think it's been successful because typical MMO players don't want to be challenged with trying to defeat 1 band of Orcs, they want to move on to the Gnolls, or the next quest or whatever.

Having mobs who escape and report their observations back to their fellows is so innovative that it alone would make me want to try the game even without all the other features that Pathfinder will have.

Goblin Squad Member

Just don't connect the AI to any thermonuclear weaponry and we should be fine...

Goblin Squad Member

Most of the various npc's found in the tabletop bestiary books include details on there behaviors and strategies.

I'd like the npc's in PFO to actually act like the npc's from tabletop.

i.e. goblins act like goblins and use goblin attacks & behavior and abilities and gnolls act like and use gnoll attacks & behaviors instead of goblins with more HP & better armor.

At the same time I understand that doing so would require a new set of programming parameters for each npc type which increases the development load (hence the wolves & bears in every zone mentioned earlier development time saving device used in many games) so if the npc types are limited during early release & open release I would like to see the npc's evolve into newer more diverse types as the game ages.

i.e. if we have goblins and kobolds in every zone to start out with, as more development resources can be directed into new npc's they eventually get driven out by newer and more diverse npc's

Goblin Squad Member

AI routines are complex, which may impede development at this stage. But what might it look like?

Put the tabletop behaviors into tables specific to that type of critter and weight the RND generator selecting which one for the critter to use and use a second RND seed to randomly choose the probability for each.

Memorization of successful tactics would only apply for successes, since failure means elimination unless you really do make them run away and really hide when their morale threshold is exceeded. In that case the critter could reduce the likelyhood of using that tactic again.

This means that the more cowardly of critters will survive to learn, and learning for them will happen more often, either by deduction (reduced chance of using a losing tactic) or by accretion (victory increases the probability for using a tactic that worked.

The critter might give cues that, if noticed by the player will warn that this critter is a veteren: Goblin: "Don't fix what ain't busted!" or "Me no do like last time! No, not stupid this one!"

Goblin Squad Member

Odds are good however that specific Goblins aren't going to hang around even if they do survive, they would be despawned to conserve resources.

In that likely event my recomendation would be that victorious goblins, for example, would add their 'learning' by adjusting the combat behavior table weights.

Community / Forums / Paizo / Licensed Products / Digital Games / Pathfinder Online / Question about NPC AI and Enemy AI. All Messageboards

Want to post a reply? Sign in.
Recent threads in Pathfinder Online