Enemy behaviour variety - profile / tag system

As we know, the enemy behaviour in Kingmaker is pretty rudimentary. Enemies generally just attack the first party member they see, and run straight towards them. That’s why a single tank is quite effective.

In the alpha there’s a difficulty option regarding enemy behaviours, but it’s not yet implemented and we don’t know how it will work.

Here’s my suggestion anyways on this topic. Personally, I’m not interested in some super advanced AI that will always make the best tactical decisions or whatever. Instead, I’d like to see a greater variety of enemy behaviours, with each individual enemy having their own personality. Here’s a simple system I thought up to do this.

Basically, have a big pool of different AI behaviours or profiles, (let’s call them Tags), and then each individual enemy will randomly get several of them.

For example:

  • Tank hater / Melee hater / Archer hater / Arcane hater / Divine hater: The enemy will prefer to attack that particular character type when possible.

  • Prefers flanking / prefers 1v1: The enemy will prefer to attack characters that another enemy is attacking / enemy prefers to attack characters that aren’t.

  • Self-preserver / Reckless: The enemy will attack characters that are attacking it / it will risk AoO’s and other dangers to attack its preferred target.

  • Likes groups / likes space: The enemy will stay close to its allies / the enemy prefers to spread out.

  • Fears AOE / Ignores AOE: The enemy will try to move out of AOE attacks / the enemy ignores AOE attacks.


I guess the tags I listed above come in groups that are mutually exclusive (fears AOE vs ignores AOE), so the random picking system would need to know not to pick more than one tag from a group.

Different enemy types / races could have higher probabilities to get certain tags. (eg. goblins could have a higher chance to prefer flanking and attacking together, whereas barbarians could have a higher chance of getting tags for 1v1.)

Boss encounters or set piece battles could have tags directly assigned by the developers rather than randomly, to craft specific tactics (eg. archers all get divine hater and arcane hater.)

The goal of this system is for every individual enemy and every battle to behave differently. This particular group of goblins might randomly have many members that like to swarm the first character they see, with a couple of members that like to split off and attack lone characters. Whilst another group of goblins might all spread out and divide themselves across all the party members immediately, etc.


I’ve always loved the idea of enemies having variable behaviors and stats that keep encounters fresh even after fighting the same enemies for the thousandth time. The FWE and MMM mods for Fallout 3 did something like this but it’s the modded S.T.A.L.K.E.R. games that really got it right. It can make every encounter feel unique and can create some epic “gaming stories” where enemies get the perfect combination of behaviors and stats to make them interesting enough to talk about years later.

Another alternative is to just script boss fights. AI is extremely expensive to build well, and difficult to test for bugs or whether it plays well in different (especially unforeseen circumstances). Hard coding different behaviors is far less expensive and far simpler, but will bring diversity on the toughest fights.

My suggestion doesn’t use AI though, it’s mostly just tweaks to target selection and certain predefined movement behaviours. They’re there for variety, especially in regular fights which need it most.

Boss fights are usually scripted anyways, to some degree, so I’m not talking about those.

It’s simple AI. I don’t disagree with the suggestion. I’m just cautious whenever I see posts about opponent combat logic because it seems deceptively simple.

The idea is good in principle, but some things will be hard to implement properly.
For example the first point were enemies prefer to attack certain characters.
Because there are tons of classes, several ways to build one class and multi classing it might be hard to tag a char as tank/arcane/divine and so on.
Ok, even a system that classifies targets sometimes in a strange way is probably better than a system that attacks always the first thing they see.
The idea that different enemies of the same type have different behaviour would be nice.

In the worst case we get:

  • Player A: I cannot beat boss X. He is a mage hater. He prevents me from casting and throws giant rocks at my back row characters.
    PlayerB: No problem. You need a monk/sorcerer/dragon as tank and no other arcane caster in your party. Cast displacement, mirror image and so on before combat. All other characters use bows or crossbows. The adds of this boss are melee haters. Your tank attacks the boss in melee. The adds attack your tank because its the only melee. The boss throws rocks at your tank because its the only arcane char and hit himself and the adds this way. You cannot cast but you attack with your sword anyway.
  • tanks become useless because many enemies always attack the party member with the lowest defense. Players solve this by summoning many weak creatures who attract enemies like magnets with their weak defense.

There must be SOMEKIND of AI in use. If not enemies and your party members would just stand still without doing anything, even at a point when they are attacked. Naturally your party members would do what you order them to do. But enemy MUST have somekind of AI.

I allso in a some point, agree with starter of this thread. It is good idea to have somekind of variety, atleast with different type of enemies and inside “human” kind of intelligent enemy groups.

What I mean is: witld pack of something, let’s say a wolfs most likely will try to attack ONE enemy and surround it. IF that enemy have too much protection (hurt your fangs, can not find soft spots) they most likely try next target. But like Swarm would do (except swarm most likely can do damage because they are small enough).

I do not agree that “mage hatter” for instance would be good idea. But in reality if anyone make HUGE damage that is most likely something what will get target soon.

So if one archer, barbarian or mage deal huge amount of damage fast and take multiple “allies” down it is likely that them try to do something about it and fast. If they have spellcaster most likely “silence” would be good option, or ranged spells / arrows and so on. Or that iritating barbarian => most opposite enemies would attack that one and leave that slow tank alone or left only one person fighting him/her.

Now thinking of new game we are getting, if “leaders” are demons and they have human underlings… …well, they most likely do not really care what happen for them. But I can easily see things like demon leader teleporting from front and in melee to back and “slay few of it’s own troops to heal itself and take they life force” or something like that. Instead of just staying in front lines and dying.

What is told from scripted fights, time to time they are nice. But bad thing is, you sooner or later learn how they go. After all scripts do not change. Thinking of Kingmaker, you soon learn what are different ways you can go for Stag Lord and final “boss” battle.

First it can be quite hard, some even say impossible. But soon it become too easy, after all it is ALLWAYS same. True, coders can create even 10 different scripts for every single boss fight. But still… …after you have tried it multiple times you learn how even ONE of them work and then you just (in worst case scenario) keep reloading untill you get that ONE scenario you have learned and fight “right” to get it through.

So it would be better if enemy AI would be better, not just certain battles with ready build scripts. Because of these scripts… …there are problems. What if player think of something totally different? What if player just get in, using magic and enemy can not really detect them / him and still script start, battle start, enemy use all they buffs and… …what? Player is there hidden wondering what is going on? Stupid AI is using they buffs and standing there… …player wait and attack them after, he can not go away because game is in fight mode (even thought no one have not actually SEEN player or anyone in his / har party) and so on…

I agree with you mostly.

When you write “enemies attack the party member that causes most damage” it sounds like an aggro system. Pathfinder has no rules for this because usually enemies are controlled by a human DM.

As you said: Since enemies show some behaviour at all there must be some kind of AI. There must be an algorithm that defines what target to attack and what ability to use. Unless we know how it currently works it will be hard to make suggestions how to improve it.

I remember a video from D:OS2, I think it was a kickstarter update. They showed that they improved the AI and suddenly enemies did stuff that even surprized the devs.

The negative record for enemy AI was an enemy who killed himself by provoking 3 different AoO from 3 different chars by walking around during one turn without doing anything but walking and getting hit. I am not sure if if was D:OS2 or PoE2.

I actually did not mean it like that. Yes it would be easy to write script what just calculate damage what everyone have made during a fight. But that would be wrong way of doing it (like in some mmorpg it is done, do not like that style)

What I mean when I wrote: “So if one archer, barbarian or mage deal huge amount of damage fast and take multiple “allies” down it is likely that them try to do something about it and fast
Was: if someone (anyone, PC, NPC, summon, pet, companion, anyone) do either for one person “big” burst damage (like let’s say 1/3 of your total HP) or manage to kill multiple people “relatively fast” be it one big spell, one arrow per turn (and one kill per turn) or barbarian who slay multiple enemies in melee or rogue who use backstab or what ever then it would be great if enemies would react for it.

Because: if you are in fight and yes, at first it would work more or less like it will be at Kingmaker or Wrath, you see enemies, you either use long range weapons / spells or get close for melee and start attacking closest opponent (it make sense, hey it is first person you see and it is enemy so you attack him/her/it) BUT:

  • If you notise that maybe you get huge beating from fellow who is someone else you most likely try to attack that person instead of person you fight now. (So go one on one against that enemy)
  • If you notise that fight is going OK you are more or less equal but hey, there is one fellow who have killed / put down many your friends then you most likely shout for your friends and you team up against that one enemy leaving only one or two to attack that one (orginal) target you first spotted. (So go multiple person against that one enemy and ignore rest if possible)

Sure finer measures come then:

  • if that fellow is at long range and you are at melee then most likely you realize that your friends need to take care of that person and you can not let enemy just attack you while you try to get melee with someone who is far behind enemy lines.
  • If that fellow is using only some odd shouts and point at your friends one at a time, then come some odd voices and your friends drop dead… …well, if anyone of your group can silence that person using magic (like that person seem to be doing) good… …if not hopefully someoen have atleast some bow or something or that single enemy can kill you all.

For example the first point were enemies prefer to attack certain characters.
Because there are tons of classes, several ways to build one class and multi classing it might be hard to tag a char as tank/arcane/divine and so on.

There’s no need to overthink it. The whole point of the “hater” tags is to prevent all the enemies locking onto the first character they see.

“Tank Hater” is simply defined as “go after any character that has an AC higher than the average of the party”. “Melee Hater” is "anyone with a melee weapon equipped. “Arcane Hater” is “Anyone who casted an Arcane spell” or “Anyone who has a arcane CL higher than the average of the party”, and similarly for Divine.

The point is not a strict algorithm to calculate who the “most hated” single character is. The point is to generate an a different list of targets for each enemy. The enemy will simply attack the closest character in its “preferred target list” if one is available, otherwise it will just do its default behaviour of attacking any nearest character.

Set piece fights with preset tags could possibly be cheesed by exploiting the “hater” tag to focus the enemy’s attention on a invulnerable tank character, but at the moment, you can do that anyways simply by making sure the tank is the closest and easiest target to reach. At least the tag system means that different members of the enemy group might have different target lists and thus encourage the enemy to split up. And the devs are free to design their set piece battle without the use of “hater” tags, and use other tags instead.

Basically pretty much anything is an improvement over the extremely rudimentary enemy behaviour we have in Kingmaker, any sort of exploit you can think of for the tag-based system, you can probably just do the exploit in Kingmaker without needing to do anything special.

I’d settle for enemies that sometimes use spells against my party—you know, the good ones—like stinking cloud, cloudkill, web, etc.

This is an interesting concept. Off the top of my head I would say two things in particular would need examination:

  1. It would be very difficult for the player to “read” enemies (i.e. determine what their hates/preferences were) in an isometric cRPG like this. In “reality” a combatant would know far more from observing foes at close quarters. The implication is it would be difficult for the player to predict likely enemy behaviours and guessing wrong could lead to catastrophic failure. It would be far harder to succedd in defeating encounters blind.

  2. Many encounters in Kingmaker where difficult and often times use of a tank or two such as Valerie to draw the aggro was pretty much essential to succeed. The same is generally true in cRPGs. If enemies where much more likely to deliberately circumvent player’s tanks in favour of squishies that might call into question the viability of squishy builds (ranged/caster) per se. It might make it so that every party member would perforce require the necessary AC and martial skill to go toe-to-toe with any potential enemy monster in the game. I.e it might close down a large array of character build options.

From what I gathered in the alpha, AI improvements were linked to Difficulty, so only players looking to be really challenged had the benefit of… being challenged.

I find the use of tanks to be a bit of a flaw in the game, really. If it was a human controlling the enemies, you would never be able to get away with having one or two unhittable tanks to draw all the fire, unless you had a doorway as a chokepoint.

I prefer the enemy behavior to be a bit less exploitable than that. Although we’ll always have doorways…

This is true but it’s equally true that if a human was controlling the enemies in even the average Kingmaker encounter you would be party wiped in seconds against any defense.