[FIXED] NPC Attack Behavior

Here we stuff all the bugs we've managed to squash/squish/squelch.
Locked
LeoX9
UOX3 Novice
Posts: 55
Joined: Fri Nov 18, 2011 9:19 am
Location: Arizona, USA
Has thanked: 0
Been thanked: 0

NPC Attack Behavior

Post by LeoX9 »

I've noticed that on my server, If I kite a few mobs, than when they get to me to attack, they line up , instead of going around each other to get to the various positions around my character to attack.... Thus, seeming as if they are lining up to die haha. Any idea's on how to fix this?
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

A problem with the pathfinding code in UOX3, unfortunately. While it can (when advancedpathfinding is turned on) pathfind through the most complex of labyrinths, it currently does not seem to take into account any characters blocking its path - just retries the same path over and over and over because it _seems_ valid.

I'm not sure how to fix this. I _have_ found a few funky workarounds, one of which makes the NPCs circle-strafe you and never stand still (lol), and one that throws in a few random changes of direction every now and then, but they are kinda hacky and can lead to some weird-looking NPC movement. :/
-= Ho Eyo He Hum =-
LeoX9
UOX3 Novice
Posts: 55
Joined: Fri Nov 18, 2011 9:19 am
Location: Arizona, USA
Has thanked: 0
Been thanked: 0

Post by LeoX9 »

Something interesting that I just found out:

I went into the 'uox.ini' file and changed the NPC movement speed a tiny bit... by .1 or .2.. This seems to have made them smarter in a way... Haha... Probably didn't really do that but their behavior for attacking seems to be more how it used to be back in the day...

Just something interesting.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Yep. And you can also adjust the speeds at which they walk, run (in combat) and flee, either globally or individually per NPC. :)

From https://www.uox3.org/docs/server-settings.html:
CHECKNPCAI=1 - How often (in seconds) NPCs can execute an AI routine.
NPCMOVEMENTSPEED=0.4 - Allows customization of NPC movement speed. Can be overridden by WALKINGSPEED tag in NPC-DFNs
NPCRUNNINGSPEED=0.2 - Allows customization of NPC running speed. Can be overridden by RUNNINGSPEED tag in NPC-DFNs
NPCFLEEINGSPEED=0.4 - Allows customization of NPC fleeing speed. Can be overridden by FLEEINGSPEED tag in NPC-DFNs
-= Ho Eyo He Hum =-
LeoX9
UOX3 Novice
Posts: 55
Joined: Fri Nov 18, 2011 9:19 am
Location: Arizona, USA
Has thanked: 0
Been thanked: 0

Post by LeoX9 »

That's good to know because I have a few 'main boss mobs' that I'd like to give an edge over all other aggressive NPC's....
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Fixed on CVS and in UOX3 0.99.
-= Ho Eyo He Hum =-
Locked