Coordinates to minimap translation

This is guide mostly for website tools and code, for example CMS or registration scripts.
There can also be tools.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Coordinates to minimap translation

Postby Calder on Sun Aug 13, 2017 6:05 pm

Does anyone come here any more?

I'm trying to wrap my head around the coordinate to minimap pixel translation. I've got it really close but it's off on each map and not always in the same direction, so something is wrong here.

The Zant minimap for example is 384 x 384 pixels.
Spero's coordinates are approximately 5273,5265

Anyone have any idea how these coordinates can be translated to pixels for each map? There has to be a universal translation because there isn't any data (at least outside the actual source) that changes by map. I've generated HTML maps for AP and Zant using the calculations I could best figure out, and they are damn close but not bang on. The worst part is the Zant map places the NPCs up and to the left, the AP map using the same calculations places them down and to the left.

Thoughts?
Calder
Clown
Clown
 
Posts: 503
Joined: Fri May 09, 2008 12:28 am

Re: Coordinates to minimap translation

Postby PurpleYouko on Mon Aug 14, 2017 3:18 pm

i had to use offsets in my online compendium.
There is a conversion formula but it often comes out slightly different on each map size
This is my lookup table.
  1. $xoffset = 5680; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;
  2.         if($mapname == "Valley of Luxem Tower"){$xoffset = 5510; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Valley of Luxem Tower
  3.         if($mapid == 1){$xoffset = 5720; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //ZANT
  4.         if($mapname == "Forest of Wisdom"){$xoffset = 5680; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;}
  5.         if($mapname == "Anima Lake"){$xoffset = 5680; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;}
  6.         if($mapname == "Birth Island"){$xoffset = 5680; $yoffset = 5630; $scalex = 2.5; $scaley = 2.5;}
  7.         if($mapid == 2){$xoffset = 6030; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Junon Polis
  8.         if($mapid == 9){$xoffset = 5720; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Junon Clan Fields
  9.         if($mapid == 10){$xoffset = 5680; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Junon Clan Fields
  10.         if($mapid == 11){$xoffset = 5820; $yoffset = 6420; $scalex = 3.5; $scaley = 3.5;} //Junon Clan Fields
  11.         if($mapid == 12){$xoffset = 5520; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Junon Clan Fields
  12.         if($mapid == 13){$xoffset = 5520; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Junon Clan Fields
  13.         if($mapid == 21){$xoffset = 5720; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Luxem
  14.         if($mapid == 22){$xoffset = 6030; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Adventurers Plains
  15.         if($mapid == 23){$xoffset = 5720; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Breezy Hills
  16.         if($mapid == 24){$xoffset = 5880; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //El Verloon Desert
  17.         if($mapid == 25){$xoffset = 5880; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Anima Lake
  18.         if($mapid == 26){$xoffset = 5880; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Forest of wisdom
  19.         if($mapid == 27){$xoffset = 6030; $yoffset = 5770; $scalex = 2.5; $scaley = 2.5;} //Kenji Beach
  20.         if($mapid == 28){$xoffset = 6030; $yoffset = 5790; $scalex = 2.5; $scaley = 2.5;} //Gorge of Silence
  21.         if($mapid == 29){$xoffset = 6030; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} // DOD
  22.         if($mapid == 31){$xoffset = 5720; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Goblin Cave B1
  23.         if($mapid == 32){$xoffset = 5720; $yoffset = 5770; $scalex = 2.5; $scaley = 2.5;} //Goblin Cave B2
  24.         if($mapid == 33){$xoffset = 5880; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Goblin Cave B3
  25.         if($mapid == 37){$xoffset = 5360; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Sunshine Coast
  26.         if($mapid == 41){$xoffset = 5510; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Oblivion Temple
  27.         if($mapid == 42){$xoffset = 5875; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Oblivion Temple B2
  28.         if($mapid == 43){$xoffset = 5715; $yoffset = 5615; $scalex = 2.5; $scaley = 2.5;} //Oblivion Temple B3
  29.         if($mapid == 44){$xoffset = 5720; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Oblivion Temple B4
  30.         if($mapid == 51){$xoffset = 5880; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Eucar (LUNA)
  31.         if($mapid == 52){$xoffset = 6360; $yoffset = 5630; $scalex = 2.5; $scaley = 2.5;} //Mana Snowfields
  32.         if($mapid == 53){$xoffset = 6520; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Arumic Valley
  33.         if($mapid == 54){$xoffset = 6050; $yoffset = 5780; $scalex = 2.5; $scaley = 2.5;} //Crystal Snowfields
  34.         if($mapid == 55){$xoffset = 6050; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Freezing Plateau
  35.         if($mapid == 56){$xoffset = 5880; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Forgotten temple B1
  36.         if($mapid == 57){$xoffset = 6035; $yoffset = 5610; $scalex = 2.5; $scaley = 2.5;} //Forgotten temple B2
  37.         if($mapid == 58){$xoffset = 6360; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Mount Eruca
  38.         if($mapid == 59){$xoffset = 5720; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} // luna Clanfield
  39.         if($mapid == 61){$xoffset = 6040; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Xita refuge
  40.         if($mapid == 62){$xoffset = 6840; $yoffset = 5610; $scalex = 2.5; $scaley = 2.5;} //Shady Jungle
  41.         if($mapid == 63){$xoffset = 6360; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Forest of Wandering
  42.         if($mapid == 64){$xoffset = 5880; $yoffset = 5630; $scalex = 2.5; $scaley = 2.5;} //Marsh of Ghosts
  43.         if($mapid == 65){$xoffset = 5875; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Sikuku Underground Prison
  44.         if($mapid == 66){$xoffset = 6360; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Sikuku Ruins
  45.         if($mapid == 71){$xoffset = 5520; $yoffset = 5800; $scalex = 2.5; $scaley = 2.5;} //City of Muris
  46.         if($mapid == 73){$xoffset = 5520; $yoffset = 5800; $scalex = 2.5; $scaley = 2.5;} //City of Muris
  47.         if($mapid == 74){$xoffset = 5560; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Crash Site
  48.         if($mapid == 75){$xoffset = 5720; $yoffset = 5630; $scalex = 2.5; $scaley = 2.5;} //Desert 01
  49.         if($mapid == 76){$xoffset = 5720; $yoffset = 5630; $scalex = 2.5; $scaley = 2.5;} //Desert 02
  50.         if($mapid == 77){$xoffset = 5720; $yoffset = 5630; $scalex = 2.5; $scaley = 2.5;} //Desert 03
  51.         if($mapid == 78){$xoffset = 5880; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Desert 04
  52.         if($mapid == 79){$xoffset = 5880; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Desert 05
  53.         if($mapid == 80){$xoffset = 5680; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Oasis Shrine
  54.         if($mapid == 81){$xoffset = 5720; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Ruins Path
  55.         if($mapid == 82){$xoffset = 5555; $yoffset = 5620; $scalex = 2.5; $scaley = 2.5;} //Gates of Muris
  56.         if($mapid == 94){$xoffset = 5555; $yoffset = 5615; $scalex = 2.5; $scaley = 2.5;} //Ruins Path


I couldn't find any better way to do it. That was before I acquired the source code though so there may be something better in there. I haven't actually gone looking for it.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Coordinates to minimap translation

Postby Calder on Mon Aug 14, 2017 9:18 pm

Cheers,

Your numbers don't work with my display method, but I figured out a way to do it that does. It means I have to write an offset to the database but that's no big deal.

BTW the Compendium is back up, I just switched that lone folder to use a different PHP version.
Calder
Clown
Clown
 
Posts: 503
Joined: Fri May 09, 2008 12:28 am

Re: Coordinates to minimap translation

Postby lazypenguin on Mon Aug 14, 2017 10:18 pm

Link to the compendium?
lazypenguin
Pomic
Pomic
 
Posts: 78
Joined: Mon Aug 10, 2009 6:51 am

Re: Coordinates to minimap translation

Postby PurpleYouko on Mon Aug 14, 2017 10:19 pm

lazypenguin wrote:Link to the compendium?

It's in my signature
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Coordinates to minimap translation

Postby xSloots on Tue Aug 15, 2017 10:02 pm

Add me on skype calder, i might have someone who is able to assist. xSloots
xSloots
Jelly Bean
Jelly Bean
 
Posts: 14
Joined: Mon Jul 28, 2014 3:07 pm

Re: Coordinates to minimap translation

Postby PurpleYouko on Thu Aug 17, 2017 2:18 pm

Calder wrote:Cheers,

Your numbers don't work with my display method, but I figured out a way to do it that does. It means I have to write an offset to the database but that's no big deal.

BTW the Compendium is back up, I just switched that lone folder to use a different PHP version.


Thanks for getting it online again :D
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: Coordinates to minimap translation

Postby Calder on Sun Aug 20, 2017 5:10 pm

Not a problem PY

Thanks to xSloots and his team I have the calculations I needed too!
Calder
Clown
Clown
 
Posts: 503
Joined: Fri May 09, 2008 12:28 am


Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 7 guests