Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 11-28-2007, 04:58 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default Experimental Code: Stop mobs hopping when pathing - FindBestZ tweaks

This is for those people who don't like to see mobs hopping vertically when pathing.

I've spent the past few days tweaking the 'FindBestZ' code so that mobs stay on the ground when moving. It seems to work quite well, so I thought I would put it out there for anyone interested to try it out.

(For those that don't know, the FindBestZ code attempts to use the geometry data in the zone .map file to ensure mobs stay on the ground while moving).

Diffs against the 1062 source, along with the three changed source files
(Map.cpp, waypoints.cpp and features.h) can be found here:

www.rama.demon.co.uk/BestZPatch.zip

No Windows binaries as I use Linux for playing with EQEmu.

The changes in features.h are just to enable the defines related to fixing pathing when moving, along with a new define I added, ASSIGN_BESTZ_WAYPOINTS_ON_LOAD, which, if defined, causes BestZ to be applied to waypoints as they are loaded from the database.

Notes:

What I did find while testing was that the Facelist array in the eastwastes map appears to be corrupt. This was causing a crash, so I added a check for this in FindBestZ, in the same way that is currently done in the LOS code.

Of course, this means that FindBestZ won't work for Eastern Wastes. There may be other map files that are 'corrupt' in a similar manner, although I didn't come across any others in my limited testing.

I guess this code will break pathing in underwater zones, e.g. Kedge, where mobs are actually not meant to move along the floor. I guess you could add a column to the zone table to enable/disable this code on a per zone basis. This could also be helpful to reduce CPU load for zones where the pathing correction isn't required, e.g. zones that are mostly flat or zones where the waypoints have been made by hand to avoid hopping.
Reply With Quote
  #2  
Old 11-28-2007, 12:45 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Just in case anyone was curious what the MAP files actually contain, during my work on this I wrote a little Visual C++ 8.0 / OpenGL app so I could visualise it (3D geometry is not really my thing).

The image below shows the triangles contained in the dreadlands.map file, looking from the tunnel to Firiona Vie out across the zone (the box in the middle is Karnor Castle).

The text shows the X,Y,Z position you are viewing from, along with the Node (bounding box). The next line shows some info about the bounding box and finally the BestZ, i.e. the elevation of the ground at the X,Y position you are at.

The app is not user friendly (need to hard code the path to the zone file as well as the X,Y,Z position you want to look from, otherwise I would have posted the code for that too.

Reply With Quote
  #3  
Old 11-28-2007, 01:00 PM
mattmeck
Guest
 
Posts: n/a
Default

Nice work!!
Reply With Quote
  #4  
Old 11-28-2007, 06:26 PM
moydock
Discordant
 
Join Date: Jun 2005
Posts: 286
Default

Very nice, does this also fix mobs going under the world while attempting to path over hills? If so, you are my hero! If not, still very nice .
__________________
-Croup (the rogue)
Creator of Pandemic (PvP-Racewars)
Reply With Quote
  #5  
Old 11-29-2007, 01:10 AM
Diuretic
Sarnak
 
Join Date: Oct 2007
Posts: 30
Default

Aye, this is fascinating work! The problem's obviously less easy to solve than I originally thought.

Thanks again for the eye opener.
Reply With Quote
  #6  
Old 11-29-2007, 09:30 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by moydock View Post
Does this also fix mobs going under the world while attempting to path over hills?
I hope so, however I can't say for sure that it fixes all such occurrences as I only checked a limited number of mobs in a limited number of zones.

If you can give me some specific examples of where this occurs, I can check those out for you.

Last edited by Derision; 11-29-2007 at 05:35 PM..
Reply With Quote
  #7  
Old 11-29-2007, 01:20 PM
Zandig's Avatar
Zandig
Hill Giant
 
Join Date: Jun 2006
Location: New York City
Posts: 180
Default

Awesome!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!

I've wanted to see some solid work on this for quite a while.
Excellent job.

Now we need some Windows binaries
Reply With Quote
  #8  
Old 12-04-2007, 12:42 PM
moydock
Discordant
 
Join Date: Jun 2005
Posts: 286
Default

Working great, only problem i've noticed is when a mob goes up a steep hill or maybe it's just a certain change in his z coordinate, he goes under the world. However he does pop back up after a couple seconds. Still a huge improvement.

I may have not set it up right though, not exactly sure what the 'rule system' is.
__________________
-Croup (the rogue)
Creator of Pandemic (PvP-Racewars)
Reply With Quote
  #9  
Old 12-06-2007, 05:24 AM
Zandig's Avatar
Zandig
Hill Giant
 
Join Date: Jun 2006
Location: New York City
Posts: 180
Default

Quote:
Originally Posted by moydock View Post
I may have not set it up right though, not exactly sure what the 'rule system' is.
It has to be set up in the database.

Here is how I have mine set up (working very well):

rule_sets


rule_values


Thats all there is to it!

Last edited by Zandig; 12-06-2007 at 01:27 PM..
Reply With Quote
  #10  
Old 12-06-2007, 05:50 PM
moydock
Discordant
 
Join Date: Jun 2005
Posts: 286
Default

Sweet thanks, got it working, still seeing them go under when climbing steep hills. Not sure if that's fixable. I haven't upgraded to the newest build though, didn't see any fixes in the log. Btw do you know what the Map:FixPathingZatWaypoints is for?
__________________
-Croup (the rogue)
Creator of Pandemic (PvP-Racewars)
Reply With Quote
  #11  
Old 12-07-2007, 10:19 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by moydock View Post
still seeing them go under when climbing steep hills. Not sure if that's fixable.

I've seen this happen in Dreadlands where one waypoint is on one side of a large mountain
and the next waypoint is on the other side. The movement code plots a vector between the
two waypoints which goes right through the middle of the mountain (under the world).

The BestZ code as currently implemented takes the mobs current Z position and looks downward to find the ground. If the mob is already under the world, it will either do nothing, or in the worst case, e.g. Dreadlands, which for some reason has an invisible 'floor' under the world at Z=-210, it will push the mob even further down.

I just made a quick hack to the code to make the BestZ code look up instead of down, and in the
case of the particular mob I was looking at in Dreadlands which pathed over a steep hill, it seemed
to have the desired effect of stopping it going under the world, i.e. if it was under the world, it pushed
it back up to the ground level.

The next step is to have the code look up AND down and decide which direction to push the mob.

I don't have a lot of time to play with this much at the moment, but if I find something which seems
to work reliably, I'll post a further patch.
Reply With Quote
  #12  
Old 12-07-2007, 02:16 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by moydock View Post
still seeing them go under when climbing steep hills. Not sure if that's fixable.
If you're using the PEQ Ykesha DB could you give me some test cases of mobs that path under the world, i.e. which zone they are in, then target them and do #npcstats and #wpinfo and give me the NPCID and Grid number ?
Reply With Quote
  #13  
Old 12-07-2007, 06:36 PM
moydock
Discordant
 
Join Date: Jun 2005
Posts: 286
Default

Quote:
Originally Posted by Derision View Post
If you're using the PEQ Ykesha DB could you give me some test cases of mobs that path under the world, i.e. which zone they are in, then target them and do #npcstats and #wpinfo and give me the NPCID and Grid number ?
I'm actually using a custom db so no help there. But I can tell you this, there seems to be a height which they reach, and they always go through the hill at that height. It also seems to be the height they would normally 'hop' up to before the fix. I'm guessing this point is the z coord of the WP they're headed to.

So what if you forced the z coord of the waypoint a mob is headed to always be the highest point in the zone. Then they wouldn't go through hills and the z-fix already in place would keep them on the ground. Would that work?
__________________
-Croup (the rogue)
Creator of Pandemic (PvP-Racewars)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:59 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3