Thread Tools Display Modes
09-09-09, 11:42 PM   #1
Ambeco
A Murloc Raider
Join Date: Sep 2009
Posts: 6
Routing

The option to find a route through the current gathering nodes is nice, but frequently has me fly up one side of a valley, and then back down the other side when one sweep up the middle would show them all. I assume this is the case because it tries to find the shortest path between the points. I believe that if it is set to treat the distance between each node as 80 yards shorter (or whatever is the tracking distance) with a minimum of zero, that should cause it to "path" an entire valley in one swoop instead of two or three, leading to more optimal loops through the zone. I'll dig through the code and see if I can test it myself, and will post my findings IF I can get it.
 
09-10-09, 12:14 AM   #2
Ambeco
A Murloc Raider
Join Date: Sep 2009
Posts: 6
Followup

I replaced line 9615
Code:
local dis=(x-pt.X) ^ 2+(y-pt.Y) ^ 2
with:
Code:
local dis=(x-pt.X) ^ 2+(y-pt.Y) ^ 2 - 80
if dis<0 then dis=0 end
I didn't move between testing the original code and my code, but the original path was 72 nodes with 12136 yards, and my code was 72 nodes with 11319 yards. It only saved about 817 yards, but also had much less doubling back than the original code, which I found very nice.

Obviously, this isn't really a bug, but I feel that the "feature" could use this easy optimization.
 
09-10-09, 12:35 AM   #3
Ambeco
A Murloc Raider
Join Date: Sep 2009
Posts: 6
I should also mention that I can't really read the code easily around there, and I don't see a square root function, so you guys can probably implement a similar change that is more accurate or efficient.
 
09-10-09, 01:01 AM   #4
Ambeco
A Murloc Raider
Join Date: Sep 2009
Posts: 6
Nevermind on that change, I actually read more of the code, and that's totally the wrong place/code. I don't know why it shows a shorter path. The correct change is at line 24767, but I haven't quite interpreted enough to implement my suggestion.
 
09-10-09, 01:10 AM   #5
Jigain
A Molten Giant
 
Jigain's Avatar
Join Date: Jul 2009
Posts: 732
...or you could just change the options in the game?

Right click the map, Route... then adjust the sliders you see there.

And for future reference, the Blizzard tracking distance is 80 yards.
 
09-10-09, 01:34 AM   #6
Ambeco
A Murloc Raider
Join Date: Sep 2009
Posts: 6
After studying the code, and getting only the vaguest idea of how the path optimizer works (Nx.Map:RoO and Nx.Map:RoS), and testing to see that subtracting 80 from each distance formula didn't work, I've determined that this is a little harder than I thought. I just wish I didn't go through Thunderfall, Dun Niffelhim, and Brunnhildar twice each for each loop through the Storm Peaks.
 
09-10-09, 01:35 AM   #7
Ambeco
A Murloc Raider
Join Date: Sep 2009
Posts: 6
OMG.
I can apparently read through the code and interpret their unformatted LUA code better than read the options menu that I've been using to test.
 
09-14-09, 03:33 PM   #8
carboniteaddon
A Pyroguard Emberseer
 
carboniteaddon's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 2,245
Originally Posted by Ambeco View Post
I should also mention that I can't really read the code easily around there, and I don't see a square root function, so you guys can probably implement a similar change that is more accurate or efficient.
We don't need a square root function for that since we are comparing squared distances for closeness, which is the same as doing it on the root of the distance, but faster. Subtracting 80 won't work since you are doing it on the square. You need to do that after a square root or using 80*80. That would give different results than the UI distance, which is a check after the route is calculated.
__________________
faatal
 
 

WoWInterface » Featured Projects » Carbonite » Carbonite Archive » Routing


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

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