Noticed that PvE enemies always seem to target whoever is highest level. Not only is this meta-gaming on the NPCs part, it's not even sensible. My lvl 21 bard/rogue is in NO way a bigger threat than the lvl 20 tank I was with, but yet she was getting pounded on. My lvl 30 swash is not a bigger threat than the 500+ hp lvl 27 warmace wielding barbarian I was with, but yet my swash was every npcs biggest concern.
Suggestion: Change the AI as follows:
If the npc intelligence is below 10, then it will attack whoever is closest regardless of level. If someone does in one round more than 30% of the npcs max hit points in damage, then the npc will shift focus to that person.
If the npc intelligence is above 10, then have it instantly look for the spellcaster. (Everyone with brains knows the spellcaster is the biggest threat). Have it check first for characters with low hp and no armor, and then if it finds no matches act like the low intelligence ones do UNTIL it sees someone cast a spell, then it should switch focus to that person.
ETA In my specific case with these exact recommendations my swash would probably become the enemy npcs focus anyway after the first flanking sneak attack, but the point is my swash wouldn't LOOK like a serious threat until that happened. The barb is a serious threat and looks it. So it would be more realistic and therefore help immersion if they took that character more seriously than mine. At least at first.
Enemy AI
Moderators: Moderator, Quality Control, Developer, DM
- Hullack
- Recognized Donor
- Posts: 148
- Joined: Tue May 03, 2022 4:56 pm
Re: Enemy AI
I'll add to this that enemies seem to have some psychic knowledge of whether my character is immune to certain elements or spells. For example, I noticed this is the under city. The wights spam the hell out of fireballs but if you have fire resistance or immunity they somehow know and just magic missile the hell out of you.
Also (more annoyingly) if an enemy tries to attack you and you go invisible or stealthed, the enemy AI will keep auto following you around the map even though they shouldn't be able to know your location. This sometimes provokes AoOs and breaks your stealth/invis.
Also (more annoyingly) if an enemy tries to attack you and you go invisible or stealthed, the enemy AI will keep auto following you around the map even though they shouldn't be able to know your location. This sometimes provokes AoOs and breaks your stealth/invis.
Jak Dimburrow : House Vale (Character Biography/Journal)
Playtimes: 7:30 PM - 11:00 PM Eastern Standard Time (EST) / UTC/GMT -5
Items Wanted and Offered in Exchange
Playtimes: 7:30 PM - 11:00 PM Eastern Standard Time (EST) / UTC/GMT -5
Items Wanted and Offered in Exchange
-
- Recognized Donor
- Posts: 331
- Joined: Mon Feb 11, 2019 3:04 am
Re: Enemy AI
Hullack wrote: ↑Fri Jul 22, 2022 4:47 pm I'll add to this that enemies seem to have some psychic knowledge of whether my character is immune to certain elements or spells. For example, I noticed this is the under city. The wights spam the hell out of fireballs but if you have fire resistance or immunity they somehow know and just magic missile the hell out of you.
Also (more annoyingly) if an enemy tries to attack you and you go invisible or stealthed, the enemy AI will keep auto following you around the map even though they shouldn't be able to know your location. This sometimes provokes AoOs and breaks your stealth/invis.
YUP! Noticed both of these also. In the goblin tunnels in the UD the goblin sorcerers love to spam fire spells, so I got my UD char a ring of fire resist 10/-. They instantly switched to magic missile. Used a broach of shielding and they switched back to fire
In Reaching Woods with my HiPS main character, those blood whatsis gnolls wielding the dual claw weapons will automatically attack my char with their first flurry if they spot her before she uses hips , even though I know they cannot see my character because she gets sneak attack on them when she fights back. And all of them will follow her around after she uses hips.**
**Pro tip: hold still and let them come right to you, then after that they will start wandering around since there's no target for their action. Except the claw weapon ones. They will hit you in spite of being unable to see you
- DaloLorn
- Posts: 2466
- Joined: Tue Mar 26, 2019 2:44 am
- Location: Discord (@dalolorn)
Re: Enemy AI
... Do you want to write us a new AI? 
More seriously... yeah. The AI cheats in so many ways it's not even funny, but it's been like this for years, and the AI scripts are probably the most complicated we have on the server. (And most likely inherited from BW/OEI, with minimal or no alteration from the vanilla scripts.)
Wouldn't hold my breath here.

More seriously... yeah. The AI cheats in so many ways it's not even funny, but it's been like this for years, and the AI scripts are probably the most complicated we have on the server. (And most likely inherited from BW/OEI, with minimal or no alteration from the vanilla scripts.)
Wouldn't hold my breath here.

European player, UTC+1 (+2 during DST). Ex-fixer of random bits. Active in Discord.
Active characters:
Active characters:
- Zeila Linepret
- Ilhara Evrine
- Linathyl Selmiyeritar
- Belinda Ravenblood
- Virin Swifteye
- Gurzhuk
- Zanniej
- Posts: 2454
- Joined: Sat Jan 11, 2014 11:28 am
- Location: The dark parts of the forum
Re: Enemy AI
If I'm not mistaken, a lot of these behaviours are hard-coded, meaning you can't alter them.
More weirdness in that same vein is the AI getting better rolls on full PVP, for example. I believe someone even took the time to check the actual difference, and on average, the AI got more critical hits than the player
But all of that is stuck in the game engine, and can't really be made to run differently, if I'm not mistaken.
However, I am no developer, so I might be mistaken
More weirdness in that same vein is the AI getting better rolls on full PVP, for example. I believe someone even took the time to check the actual difference, and on average, the AI got more critical hits than the player

But all of that is stuck in the game engine, and can't really be made to run differently, if I'm not mistaken.
However, I am no developer, so I might be mistaken

Off to greener pastures
- DaloLorn
- Posts: 2466
- Joined: Tue Mar 26, 2019 2:44 am
- Location: Discord (@dalolorn)
Re: Enemy AI
A lot of the AI is very much not hardcoded... but it's huge and convoluted, and making it stop metagaming would require someone to understand it and then make it more huge and convoluted.Zanniej wrote: ↑Sat Jul 23, 2022 6:41 am If I'm not mistaken, a lot of these behaviours are hard-coded, meaning you can't alter them.
More weirdness in that same vein is the AI getting better rolls on full PVP, for example. I believe someone even took the time to check the actual difference, and on average, the AI got more critical hits than the player![]()
But all of that is stuck in the game engine, and can't really be made to run differently, if I'm not mistaken.
However, I am no developer, so I might be mistaken![]()

European player, UTC+1 (+2 during DST). Ex-fixer of random bits. Active in Discord.
Active characters:
Active characters:
- Zeila Linepret
- Ilhara Evrine
- Linathyl Selmiyeritar
- Belinda Ravenblood
- Virin Swifteye
- Gurzhuk
- izzul
- Posts: 970
- Joined: Wed Jun 23, 2010 8:12 pm
Re: Enemy AI
the metagaming AI is predictable after some time and experience, so we will eventually learn how to overcome the difficulties
ex: pepare mind blank, or hips while the giant is charging while clicking S button to retreat, then wait until the flurry is finished so we dont auto attack breaking hips
ex: pepare mind blank, or hips while the giant is charging while clicking S button to retreat, then wait until the flurry is finished so we dont auto attack breaking hips
Azzizuleia Tyrielmrande-[Permadeath PC]
Eilondruil Eldanyar-Corellon Larethian[Battle Historian]
Iz Azul-Red Knight[Active]
Krueger-Trader viewtopic.php?f=55&t=56617
Mystera Electra-Mystra[Goat Girl]
"give to yourself, took from others-Integrity and Justice"
Eilondruil Eldanyar-Corellon Larethian[Battle Historian]
Iz Azul-Red Knight[Active]
Krueger-Trader viewtopic.php?f=55&t=56617
Mystera Electra-Mystra[Goat Girl]
"give to yourself, took from others-Integrity and Justice"
-
- Posts: 1947
- Joined: Sat Jul 28, 2018 8:51 am
Re: Enemy AI
One of our QC members analyzed about 300 000 log entries through several years of play and it showed that AI does roll nat 20 approximately 1% less often than player and they roll nat 1 approximately 1% more often than player. Overall, things were in margin of +-1% from base 5% chance we have for natural 1 and natural 20.Zanniej wrote: ↑Sat Jul 23, 2022 6:41 am If I'm not mistaken, a lot of these behaviours are hard-coded, meaning you can't alter them.
More weirdness in that same vein is the AI getting better rolls on full PVP, for example. I believe someone even took the time to check the actual difference, and on average, the AI got more critical hits than the player![]()
But all of that is stuck in the game engine, and can't really be made to run differently, if I'm not mistaken.
However, I am no developer, so I might be mistaken![]()
Speaking of AI, it's possible to redo most part of it. But, it's like 15+ files each sporting 4000+ lines of code which are cross-referenced in almost every action.
Here is a function call diagram for single attack function of AI code. I made those when i worked on my pet project that didn't see the light of day and i still remember amount of headache those function jumps across files gave me.
Also, AI does attack things that it finds as biggest threat with lowest defences, not reall just "higher level pc". While it may look like it attacks higher level PCs all the time, it's not really true, the logic behind targeting is way more intricate.
Hidden: show