NPC Pathing

Discussion in 'The Veterans' Lounge' started by Thronk, Apr 3, 2013.

  1. Thronk New Member

    I have played EQ since Luclin, first as a Mage and more recently as a Zerker. When I was a Mage, I learned that pets have a terrible time pathing when their master is on an incline. As a Zerker, I notice that tank/dps mercs do the same. Can anyone tell me why NPCs and inclines have never gotten along? It seems impossible that this hasn't come up before, so I think that it may be one of those unsolvable problems, but if anyone can at least shed some light as to why it happens, it would be much appreciated.
  2. Dzarn Developer

    Every zone created during or after Omens of War contains 'pathing boxes' that NPCs use when they are in combat. Mercenaries and pets use these boxes both in and out of combat. The boxes are generated algorithmically to fill what the game considers movable space. The image below gives a basic example of what these boxes look like against a hillside.

    [IMG]
    The blue boxes are 'air' spaces.
    The green boxes are 'ground' spaces (places where an NPC can run.)

    The green boxes don't extend evenly up the hillside because the minimum size of the box is larger than the slope of the hill. The reason the boxes aren't made smaller is because the file that contains the pathing data becomes very large very quickly and this causes zones to run slower and everyone generally has a bad time in laggy zones.

    The behavior you'll typically see when you have aggro on an NPC then walk up a steep incline is that NPC trying all means to resolve a path to you. Sometimes this involves the NPC running in the opposite direction first because he does not have boxes that indicate that there is valid movable space between it and you. What will often end up happening is that if the NPC cannot resolve a path to its target after a number of seconds it will simply teleport to its target (if its target isn't moving.)

    The thing I find interesting about this pathing is the zones that were built prior to Omens of War. NPCs in these zones use the non-combat pathing system both in and out of combat which is why you'll notice very obvious differences in how these NPCs move in combat.

    [IMG]

    Say for example I'm standing on the wall above the arena in the good version of Freeport and aggro a guard. The guard doesn't run straight lines through the street in order to reach my position because he does not have a concept of moveable space (defined by boxes.) He has to make use of the hand placed paths in the zone to reach his target. So he will run down the blue path then the green path in order to get as close to me as possible. At that point he may or may not break off of the path to try and hit me. If I back up he will likely run up the green path to the red path in order to reach me again.

    Getting back to the original point though. It's not 'impossible' to fix areas of steep inclines so that NPCs can path nicely on them, but it is a time intensive process because finding those areas is a somewhat manual endeavor. When we identify specific problem areas in zones we are able to put a 'refinement box' around that area which causes the path generator to generate smaller more-detailed boxes within the refinement area. Unfortunately, it's such a time intensive endeavor to regenerate pathing data for a zone that it really only gets done on newer zones (in some rare cases it's done for particularly egregious areas of older zones.)
    Fury, Yther, Mykaylla and 19 others like this.
  3. Falos Augur

    That's how i walk in real life.
  4. Elizabeta Augur

    That is a fantastic reply-posting.

    Can stuff like this be placed somewhere, like your new fangled wiki, under pathing or something.
  5. Endiment Scale Tailed

    :eek: "good version of Freeport"
    Zanarnar, Dzarn and Rouan like this.
  6. Obiziana Augur

    Thanks Dzarn, so cool to see some of the inner workings of EQ!
    -----Cinexa----- likes this.
  7. Axxius Augur

    Oh, this explains a lot! And not only about inclines. There is often a very noticeable difference in mob pathing depending on whether the player is levitating or not.

    Example: in Beast Domain, near the Sarith zone, aggro one of the plants and run into the valley while levving. The ground is not really steep, but you stay in the air and don't sink much, you hover pretty high above the ground. And at some point the mob turns around and starts running AWAY from you (to try and get closer to your Z-coordinate first?). It runs to a wall and climbs it to the same height as you and then start running on the wall side to side. As long as you keep moving. And the moment you stop - it warps to you. This also happens in RoF Xorbb, except that it's far worse there.

    From this picture I can conclude that the hover height is larger than the default height of the pathing box. And when you are levitating you are in the 'air space' and therefore cannot be reached by pathing. So what you need is taller pathing boxes! They should be at least as tall as the maximum height where you don't sink while levving (the hover height). OR the hover height should be lowered (this way you won't have to re-generate the pathing for existing zones). The pathing system was created for OoW and it became broken in SoFaydwer with the change to lev.

    This shouldn't be very hard to fix, right? Somebody light the Bat-Frog-Coder signal! ;)
    -----Cinexa----- likes this.
  8. Sinestra Augur

    This kind of reply with great easy to understand explanations and pictures is what we need more of. Thanks Dzarn!
    -----Cinexa----- likes this.
  9. Endaar Augur

    Thanks for the detailed explanation. These type of posts go such a long way to generating goodwill with the community, not to mention it is fascinating to see some of the inner workings of the game engine. It seems like the past few weeks we've had a bit more dev communication; I hope that trend continues.

    Endaar
  10. Tarvas Redwall of Coirnav, now Drinal

    Awesome explanation!
  11. Xirtket Augur

  12. Zzlaarr Elder

    Thanks Dzarn, very much appreciated!
  13. Tharkis Princess

    I can give Dzarn one of his likes back !

    *likes this*
  14. -----Cinexa----- Elder

    So the person doing the pathing.....he/she is the one crying in the corner? =) Very nice explanation - thank you!
  15. Recnarp Augur

    Dzarn... do more of these behind the scenes of EverQuest in the future.

    Also, you obviously have access to the old freeport files... you should put those back in the game. =)
  16. Mykaylla Augur

    He did!

    ... Well, in the SK epic ornament quest, anyway. ;)