Using yGather data to create waypoints...

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Excorio
Posts: 2
Joined: Sat Dec 19, 2009 2:14 pm

Using yGather data to create waypoints...

#1 Post by Excorio » Sat Dec 19, 2009 2:31 pm

Hello,

First off i wanna say that i LOVE MicroMacro!

Today i installed MM and i played around with it a bit.
I've read the forums posts and i know that some of u
use yGather (like me) to record resource stack locations.

I was wondering summin about the waypoints and the data
that yGather records about these resources. yGather records
the location of the resources in the SaveVariables.lua file that
is located in the Rune of Magic user directory...

MM needs coordinates, yGather has these coordinates!
(Has em if u ran the map to expose all nodes)

The data from yGather in SaveVariables.lua looks like this:

Code: Select all

yGather_Settings = {
}
yGather_data = {
	[1] = {
		[3001] = {
			[31] = {
				["y"] = 745,
				["x"] = 381.64,
			},
			[2] = {
				["y"] = 356.39,
				["x"] = 348.97,
			},
			[8] = {
				["y"] = 462.96,
				["x"] = 130.22,
			},
			[32] = {
				["y"] = 781.28,
				["x"] = 395.69,
			},
			[33] = {
				["y"] = 711.29,
				["x"] = 406.14,
			},
			[34] = {
				["y"] = 820.6,
				["x"] = 445.45,
And so on. The list is huge once u got the nodes on the maps...

Now... I don't have ANY knowledge of lua or converting or programming :oops:
whatsoever but is it possible to create a little proggie that converts these
waypoints into waypoints for MM so that MM can read it and randomly
(or at order) picks those waypoints to go there and harvest?

Just an idea ;)

useless
Posts: 5
Joined: Thu Dec 24, 2009 8:11 am

Re: Using yGather data to create waypoints...

#2 Post by useless » Thu Dec 24, 2009 8:15 am

I've looked into doing this, and have even written a conversion script.. I did notice however, after the fact, that the waypoints in yGather are significantly different than the ones used in RomBot. yGather, for instance, imposes a limitation that the waypoints must be between 0 and 1000 - and RomBot goes at least -10000 -> 10000 from what I can tell so far.

If someone can provide me more information on how to translate these points from yGather to RomBot I'll try to finish my implementation of the converter.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Using yGather data to create waypoints...

#3 Post by Administrator » Thu Dec 24, 2009 12:10 pm

Yes, yGather uses map coordinates, whereas the bot uses world coordinates. They really don't align so well.

useless
Posts: 5
Joined: Thu Dec 24, 2009 8:11 am

Re: Using yGather data to create waypoints...

#4 Post by useless » Thu Dec 24, 2009 7:18 pm

Administrator wrote:Yes, yGather uses map coordinates, whereas the bot uses world coordinates. They really don't align so well.
Shouldn't be too hard to calculate if I new what world coordinates each map begins with. I assume the upper-left corner of the map is 0,0 map coordinates and we could just add that to the x,y of the world coordinates where the map begins, right?

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Using yGather data to create waypoints...

#5 Post by Administrator » Fri Dec 25, 2009 1:07 am

No, the maps do not scale 1:1 to world coordinates. It would, however, not be too hard to calculate given the start (top-left) and end (bottom-right) world coordinates, but they start and end at arbitrary locations. Plus, it's kind of a pain to gather this information about every map. Another concern is that yGather's stored coordinates might not be accurate enough.

useless
Posts: 5
Joined: Thu Dec 24, 2009 8:11 am

Re: Using yGather data to create waypoints...

#6 Post by useless » Fri Dec 25, 2009 2:21 am

Administrator wrote:No, the maps do not scale 1:1 to world coordinates. It would, however, not be too hard to calculate given the start (top-left) and end (bottom-right) world coordinates, but they start and end at arbitrary locations. Plus, it's kind of a pain to gather this information about every map. Another concern is that yGather's stored coordinates might not be accurate enough.
Well, what about modifying yGather to store the data in a model that is more appropriate to our situation? It wouldn't hinder the operation of yGather and would definitely be a benefit to us.

Another idea might be adding a function to MM that returns the coordinates of the next closest un-harvested resource...

wil32
Posts: 36
Joined: Tue Jun 01, 2010 9:21 pm

Re: Using yGather data to create waypoints...

#7 Post by wil32 » Tue Jun 08, 2010 6:36 am

anyway to convert world and map coordinate?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Using yGather data to create waypoints...

#8 Post by rock5 » Tue Jun 08, 2010 6:53 am

Even if you converted the coordinates, there's the HUGE job of sorting them into a sequence that would actually be traversable.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

KillerTHC
Posts: 63
Joined: Tue May 25, 2010 8:49 pm

Re: Using yGather data to create waypoints...

#9 Post by KillerTHC » Tue Jun 08, 2010 10:39 am

As rock5 said these co-ordinates are not really close to each other in the sense that there will be no obstacles in between them. This means that your bot will get stuck, in order to put yGather to use I just find all the nodes then create a path that walks to each and everyone of them while avoiding obstacles, this works well.

wil32
Posts: 36
Joined: Tue Jun 01, 2010 9:21 pm

Re: Using yGather data to create waypoints...

#10 Post by wil32 » Tue Jun 08, 2010 4:26 pm

i have a script that takes all WP and make a good path -> it takes all WP put the closest to the closest one.

Im not sure if im getting understand but so far it work pretty well

KillerTHC
Posts: 63
Joined: Tue May 25, 2010 8:49 pm

Re: Using yGather data to create waypoints...

#11 Post by KillerTHC » Wed Jun 09, 2010 2:53 pm

If someone figures out a way to convert from world coordinates to map coordinates and vice versa let me know, because with this I can develop a way of moving in game that will avoid obstacles almost perfectly.

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: Using yGather data to create waypoints...

#12 Post by Administrator » Wed Jun 09, 2010 3:15 pm

Do explain. If you have some way of gathering all information needed to create a collision map, then I'd like to hear about it.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Using yGather data to create waypoints...

#13 Post by rock5 » Thu Jun 10, 2010 12:21 am

KillerTHC wrote:If someone figures out a way to convert from world coordinates to map coordinates and vice versa let me know, because with this I can develop a way of moving in game that will avoid obstacles almost perfectly.
Sounds a bit like what I did in an Excel file for visualizing waypoint files.
Basically What I did was visit 2 points at opposite corners of of each map, record the coordinates (both in-game and rombot), then calculate the dimensions of the map in rombot coordinate values. I then changed the min and max values of the axis so I could then plot the values directly to my maps.

Check it out. I also have some mob locations still included. I had to include only 1 of the maps because it was too big to upload. The 2nd tab "Calculations" is what I used to calculate the min and max values to use in the axis.
Attachments
Runes of Magic Maps_Subset.xls
(196 KiB) Downloaded 180 times
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Using yGather data to create waypoints...

#14 Post by rock5 » Thu Jun 10, 2010 3:01 am

KillerTHC, I'm working on a highly precise conversion using GetPlayerWorldMapPos to get precise in-game coordinates.

I'll finish it after the servers come back online.

In the mean time I need to ask you something. You mentioned in another thread "I have found a method to walk around in RoM that avoids obstacles, the only problem is that it uses the map coordinates". Does your "method" have to use the current map coordinates or can it use world coordinates? Because GetPlayerWorldMapPos (9999) will give world coordinates which would mean I would only have to do 1 conversion. Otherwise I will have to come up with a solution that would require a database of all the min and max values for each map. Can be done but would need a lot more work.

And, like Administrator asked, what is this method?

Edit: Here is an example of how accurate my method is. It is for Thunderhoof Hills. Put this in any waypoint file and run it. It will display the coordinates as reported by the in-game function GetPlayerWorldMapPos() and the calculated values from rombots player.X and player.Z values. Move around and press DELETE to recalculate at the new location. You will see that it yields values that are correct to about 6-7 decimal places and that was from using 2 points that were only about 500 from each other, very close.

Code: Select all

<onLoad>
	while true do
		xdimension={}
		zdimension={}
		xdimension.min=-20340.028388314
		xdimension.max=9000.0241336583
		zdimension.min=-4095.0192965768
		zdimension.max=17910.019899253
		
		xd=(player.X-xdimension.min)/(xdimension.max-xdimension.min)
		zd=(1-(player.Z-zdimension.min)/(zdimension.max-zdimension.min))
		
		printf("In-game coords    : %.14f, %.14f\n", RoMScript("GetPlayerWorldMapPos()"))
		printf("Calculated coords : %.14f, %.14f\n", xd, zd)
		player:sleep()
	end
</onLoad>
Now, KillerTHC, if you tell me your method can use in-game world coordinates using GetPlayerWorldMapPos() then I can just modify it to work with those values otherwise I've already planned how I will use a database of map min and max values to create a function you can use in any zone.

So hurry up and answer!
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

KillerTHC
Posts: 63
Joined: Tue May 25, 2010 8:49 pm

Re: Using yGather data to create waypoints...

#15 Post by KillerTHC » Sat Jun 12, 2010 4:50 pm

Good work on the conversion, the problem is the function requires map coordinates and not world ones. I didn't make the function I just noticed that in game you can right click on the map and select "move to" or "move here" and it will walk you there without walking into most obstacles. So what I thought we could do is edit the walking function so that it tries to use the RoM command WorldMap AutoMove to navigate the waypoints, however sometimes if the point on the map is to far away then it will not be able to auto walk and in that case then RoM Bot will just use the previously used method. Using this method means that if you resurrect at the wrong place you will still be able to get back to the nearest waypoint and keep going as well as the obvious applications of not walking into fences, logs, rocks, etc...

Sorry for the late reply too, you know school plus after prom party makes for a busy weekend.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Using yGather data to create waypoints...

#16 Post by rock5 » Sat Jun 12, 2010 5:22 pm

KillerTHC wrote:So what I thought we could do is edit the walking function so that it tries to use the RoM command WorldMap AutoMove
That's exactly what I thought you were going to say. You can specify the map to use so we can use the world map id of 9999 so I can use the same function as before but change the min and max values to the world values.

There's still a couple of problems with that. 1 is it sometimes can't work out a path to the destination and some zones it just doesn't work, the new continent for example.

It might be worth exploring, though, maybe for specific purposes.

I'll update the code and post it soon.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

KillerTHC
Posts: 63
Joined: Tue May 25, 2010 8:49 pm

Re: Using yGather data to create waypoints...

#17 Post by KillerTHC » Sat Jun 12, 2010 5:39 pm

Hmm I didn't think of that. Also if it can't find a path then the bot will just use the normal method that it uses now, this way we get the best of both worlds.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Using yGather data to create waypoints...

#18 Post by rock5 » Sat Jun 12, 2010 6:08 pm

Here's the function to convert to ingame world coordinates;

Code: Select all

function ConvertToWorldMapPos(X, Z)
	xdimension={}
	zdimension={}
	xdimension.min=-46080.001323271
	xdimension.max= 41760.003443535
	zdimension.min=-28319.998453998
	zdimension.max= 37560.000064441
	
	xd=(X-xdimension.min)/(xdimension.max-xdimension.min)
	zd=(1-(Z-zdimension.min)/(zdimension.max-zdimension.min))
	
	return xd, zd
end
To use it with WorldMap_AutoMove you could use it like this.
If x, z hold the rombot coordinates you want to go to, then;

Code: Select all

gamex, gamez=ConvertToWorldMapPos(x,z)
sendMacro("WorldMap_AutoMove( 9999, " .. gamex ..", " .. gamez .. " )")
I think some thought still needs to be put into when and how to use it before it could become practical.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

KillerTHC
Posts: 63
Joined: Tue May 25, 2010 8:49 pm

Re: Using yGather data to create waypoints...

#19 Post by KillerTHC » Sat Jun 12, 2010 6:14 pm

Have you tested this way of walking? I will try to test it soon but I'm a little busy right now.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Using yGather data to create waypoints...

#20 Post by rock5 » Sat Jun 12, 2010 6:29 pm

KillerTHC wrote:Have you tested this way of walking? I will try to test it soon but I'm a little busy right now.
Well I've tested the function and the command but I haven't done any further testing. I haven't tried it in a "real world" scenario because I'm not sure how or where you would use it.

Also it's getting late for me (or should I say early, in the morning that is). I should get some sleep.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest