Help with decrypting coordinate system...

Ask questions about cheating in any games you would like. Does not need to pertain to MicroMacro.
Post Reply
Message
Author
User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Help with decrypting coordinate system...

#1 Post by MiesterMan » Thu Oct 17, 2013 7:56 am

Ok so, this is something I'm going to need to figure out eventually. The coordinate system has a few parts to it, first there are two sets of x and y coordinates, big ones and little ones.

The little x coordinates go from 0 to 160 and the big ones go from 0 to some huge number. The function that decrypts the location information into the general map location is this:

Code: Select all

function Waypoint:ConvertToPlayer( dev_coordinate )
	-- You are at: r1 lx904 ly975 ox18.49 oy142.90 oz418.52 h140.6
 	-- You are at: r1 lx1046 ly1147 ox129.00 oy75.72 oz417.78 h358.6 
    -- You are at: r1 lx959 ly921 ox153.80 oy36.75 oz381.56 h199.7
	local x = (( math.floor( dev_coordinate.lx / 8 ) * 160 + dev_coordinate.ox ) - 29360) / 200;
	local y = (( math.floor( dev_coordinate.ly / 8 ) * 160 + dev_coordinate.oy ) - 24880) / 200;
        --Turbine.Shell.WriteLine('x: ' .. x .. ' y: ' .. y);
	return { x = round(x,3), y = round(y,3) };
	
end
Now, when you walk the distance of 0 to 160 of any section, it covers 8 points of the big coordinates. I have tried every calculation I can think of, the only thing left is an y times x plus some tail piece calculation but I don't know how to guess how wide across x is.

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

Re: Help with decrypting coordinate system...

#2 Post by Administrator » Thu Oct 17, 2013 5:32 pm

I'm a bit confused with how you worded that.

You have two X variables (lets not even get into Y yet), lets call those x1 and x2; x1 spans from 0 to 160 and x2 spans from 0 to some unknown integer.

If x1 is 0, does that mean you're on the far left of the map, and does 160 mean the far right? Does x2 roll over back to 0 ever or does it's max value indicate the far right of the map?


The only thing I can think of, based of such limited information, is that the map is split into smaller chunks of 20 units (160/8). x2 is your "true" X value while x1 indicates your movement across chunks.

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

Re: Help with decrypting coordinate system...

#3 Post by rock5 » Thu Oct 17, 2013 8:15 pm

I think I'm starting to wrap my head around it. You're saying you have a large scale range that breaks up each square into 8 parts. And while you are in those squares you also get a 0-160 coordinates that tells you where you are in that square. That means when you go out of one square and into another the little scale goes from 160 back down to 0 right?

So now, what exactly are you asking for? You're not really clear about that.
  • 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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Help with decrypting coordinate system...

#4 Post by MiesterMan » Thu Oct 17, 2013 9:32 pm

rock5 wrote:I think I'm starting to wrap my head around it. You're saying you have a large scale range that breaks up each square into 8 parts. And while you are in those squares you also get a 0-160 coordinates that tells you where you are in that square. That means when you go out of one square and into another the little scale goes from 160 back down to 0 right?

So now, what exactly are you asking for? You're not really clear about that.
That is correct and it has both X and Y coordinates with in the same way. So the "big X" and "big Y" are the integers that have subsections of 8 by 8 squares. In each 8 by 8 square the "small x" and "small y" span 0 to 160 and when moving from one 8 by 8 square to the next, it resets to either 0 or 160 depending on the directions you are going.

I was able to find the small x and small y but the big X and big Y are being tracked in some other way. I've tried all sorts of calculations to try and figure out where the values are in memory but I just don't know how they are tracking it.

The way I'm imagining it, is that the map is broken up into blocks in an array and that they are numbered from 0 to some big number and they wrap around either each row or each column. But all I have to go on is that clip from an in-game addon that lets you set waypoints and gives you an arrow to follow.

Sorry, I'm not good with words and this system is very confusing.

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

Re: Help with decrypting coordinate system...

#5 Post by rock5 » Thu Oct 17, 2013 10:17 pm

It's possible it is saving the coordinate in memory differently than what the game shows you so don't expect to find a certain value. I would, though, expect it would save the dev_coordinate, from your example, in memory. I think that's what you call the "big" values.

Usually, coordinates are easy to find. You start with an "Unknown initial value" scan. Then you move to the right and do an "Increased value" scan. Then you move to the left and do a "Decrease value" scan. Keep doing that until you have your result for your x coordinate. y should be near by.
  • 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
Administrator
Site Admin
Posts: 5306
Joined: Sat Jan 05, 2008 4:21 pm

Re: Help with decrypting coordinate system...

#6 Post by Administrator » Thu Oct 17, 2013 10:46 pm

Are you sure they are even integers? It is possible they are floats or doubles.

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

Re: Help with decrypting coordinate system...

#7 Post by rock5 » Thu Oct 17, 2013 10:53 pm

If you did 4 byte searches they are floats they'd still increment right? So when you get your result, if the values look like they might be floats then display them as floats and see if it makes a more reasonable and expected value. Doubles seem unlikely but if 4 byte searches aren't working I guess you could try that too.

I think the function above indicates that it is saved as an int. Otherwise they wouldn't need to add the ox and oy values to return a more accurate value, they could just convert the dev value.

By the way if it is saved as the dev values and all you have is the value returned from that function, I think you can calculate the dev values by the following formulas.
  • devx (big x) = 10*x +1468
    dey (big y) = 10*y + 1244
  • 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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Help with decrypting coordinate system...

#8 Post by MiesterMan » Thu Oct 17, 2013 11:31 pm

The dev_coords variable has the info parsed from a slash command like prompt so it's the same value as you get from /loc like commented in the code:

Code: Select all

    -- You are at: r1 lx1046 ly1147 ox129.00 oy75.72 oz417.78 h358.6
    -- You are at: r1 lx959 ly921 ox153.80 oy36.75 oz381.56 h199.7

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Help with decrypting coordinate system...

#9 Post by MiesterMan » Fri Oct 18, 2013 1:12 am

rock5 wrote:If you did 4 byte searches they are floats they'd still increment right? So when you get your result, if the values look like they might be floats then display them as floats and see if it makes a more reasonable and expected value. Doubles seem unlikely but if 4 byte searches aren't working I guess you could try that too.

I think the function above indicates that it is saved as an int. Otherwise they wouldn't need to add the ox and oy values to return a more accurate value, they could just convert the dev value.

By the way if it is saved as the dev values and all you have is the value returned from that function, I think you can calculate the dev values by the following formulas.
  • devx (big x) = 10*x +1468
    dey (big y) = 10*y + 1244
From the code snippet I above, dev_coordinate.lx is big X, dev_coordinate.ly is big Y, dev_coordinate.ox is little x, and dev_coordinate.oy is little y. As I stated in my last post, dev_coordinate is a variable created by the addon to store the parsed information from a chat statement like those posed in the comments. What is calculated is the map style coordinates that coincide with the whole map. These are used to calculate a direction to a set of coordinates a player enters to help direct him to a manually entered waypoint.

It's a tiny addon, you can browse through the files in a couple of minutes (attached):
Attachments
ThatOneThing.zip
Changed the name so people won't end up here after searching for it.
(25.22 KiB) Downloaded 326 times

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

Re: Help with decrypting coordinate system...

#10 Post by rock5 » Fri Oct 18, 2013 2:44 am

So were you able to find any coordinates in memory?
  • 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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Help with decrypting coordinate system...

#11 Post by MiesterMan » Fri Oct 18, 2013 6:44 am

rock5 wrote:So were you able to find any coordinates in memory?
Ok, using slash command I can get the same information the addon gets and stores in dev_coordinates. Yes, I was able to find the little x and little y, but I was not able to find the big x or big y. I tried every variation (every step through the equation) of every type (float, int, short, double) and came up with nothing. That's why I know it has to use a different system to reference which square you are in.

Ok, working with the big X and Y, let's downsize so I can explain this simpler. Let's say the world is made of 10 blocks by 10 blocks. Those blocks are displayed in a square and you walk across that square. Well, as a programmer, I personally would store all of the blocks in a single array, row by row and use a multiplier to reference the position. So, our 10 block by 10 block map is actually stored in array from 0 to 99. When we are given big X = 3 and big Y = 4, the block number is actually 10*Y+X or in this case 43.

This is my theory as to why the values aren't appearing anywhere in memory. As such, I'm trying to figure out the dimensions so I can calculate the correct block number. The problem is, the calculation (from the addon) confuses me and I can't figure out how many blocks are in the map or the dimensions of it.

Edited to clarify last sentence.

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

Re: Help with decrypting coordinate system...

#12 Post by rock5 » Fri Oct 18, 2013 7:09 am

MiesterMan wrote:Ok, using slash command I can get the same information the addon gets and stores in dev_coordinates. Yes, I was able to find the little x and little y, but I was not able to find the big x or big y. I tried every variation (every step through the equation) of every type (float, int, short, double) and came up with nothing. That's why I know it has to use a different system to reference which square you are in.
Did you try the method I described? http://www.solarstrike.net/phpBB3/viewt ... 309#p53309. If that didn't work I don't know what to say. Maybe the coords are reversed?
  • 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: Help with decrypting coordinate system...

#13 Post by rock5 » Fri Oct 18, 2013 7:49 am

I just thought of something. When using my method, remember that the big values are a lot less accurate than the little ones, ie. 8 vs 160, so you might have to move a lot for it to change in memory.
  • 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: Help with decrypting coordinate system...

#14 Post by rock5 » Fri Oct 18, 2013 11:44 am

Found something.
  • Big X (byte) = lotroclient.exe+14EA5AD
    Big Y (byte) = lotroclient.exe+14EA5AC
    Little X (float) = lotroclient.exe+14EA5B4
    Little Y (float) = lotroclient.exe+14EA5B8
    Little Z (float) = lotroclient.exe+14EA5BC
And, yes, I did download it just to look.

It was hard. Turns out the memory for the big values only changes every 8 dev units. So, for example, the big X = int(devx/8). So 160 little units = 1 big unit.
  • 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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Help with decrypting coordinate system...

#15 Post by MiesterMan » Fri Oct 18, 2013 2:55 pm

rock5 wrote:Found something.
  • Big X (byte) = lotroclient.exe+14EA5AD
    Big Y (byte) = lotroclient.exe+14EA5AC
    Little X (float) = lotroclient.exe+14EA5B4
    Little Y (float) = lotroclient.exe+14EA5B8
    Little Z (float) = lotroclient.exe+14EA5BC
And, yes, I did download it just to look.

It was hard. Turns out the memory for the big values only changes every 8 dev units. So, for example, the big X = int(devx/8). So 160 little units = 1 big unit.

Good god, do you know how many days I searched for those!!!!

I feel I haven't expressed myself enough, QQ QQ QQ qq QQ. :cry:

Hang on, did you say byte values? OMG, I DIDN'T TRY BYTES!!! I thought there was no way possible that the value represented could be that small! Awwwwwwwww....

Edit: Yea, it can't be a byte can it? There's way more blocks to the map then that.

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

Re: Help with decrypting coordinate system...

#16 Post by Administrator » Fri Oct 18, 2013 5:34 pm

You said it goes to 160, right? A byte can store 256 values.

User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Help with decrypting coordinate system...

#17 Post by MiesterMan » Fri Oct 18, 2013 11:09 pm

Administrator wrote:You said it goes to 160, right? A byte can store 256 values.
No, the small x and y go from 0 to 160, but 256 may be enough for the block count. That's 256 by 256 which is pretty big. It's just that if you see the size of the world map, it begs the question.

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

Re: Help with decrypting coordinate system...

#18 Post by rock5 » Fri Oct 18, 2013 11:32 pm

Actually I initially found the value as an int that incremented by 256 when I changed squares. When I looked at the memory I realized it was a byte value and the first byte of the integer was the other axis.

So do you have everything you need? Do you need anymore math done? What values do you need to move? How are you going to move?

I remember noticing, in an initial instance that I had to complete to leave the starting area, that the lx,ly values didn't change and the ox, oy values extended beyond the 0-160 range. So I don't know if that is going to cause problems.
  • 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
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: Help with decrypting coordinate system...

#19 Post by MiesterMan » Sat Oct 19, 2013 1:36 am

Yea, changing instances look like it's going to be an issue so I'm still trying to figure some stuff out. What I do have are the player hp and target hp which have relevant information close by but I was unable to find a target pointer or any structure... this is what I have:

Code: Select all

addresses = {
    baseModule = "lotroclient.exe",
    player = {
        staticBase = 0x0173ECF0,
        baseOffs = { 0xc, 0x4, 0x28, 0x10 },
        hpType = "float",
        HP = 0x34,
        maxHP = 0x38,
        mpType = "float",
        MP = nil,
        maxMP = nil
    },
    target = {
        staticBase = 0x0173ECF0,
        baseOffs = { 0xc, 0x4, 0x0, 0x4 },
        hpType = "float",
        HP = 0xb4,
        maxHP = 0xb8,
        mpType = "float",
        MP = nil,
        maxMP = nil
    }
}
So, am I done? No. But you've solved this trying mystery that's been holding me in place since the last two time I tried to make a bot for this game. I can now at least make a bot to farm out areas so I can complete deeds which give in game store currency upon completion. (That doesn't spin in place, lol)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests