Conquer Club

Why are the XML coordinates offset?

How to make a map. Official Handbook, Guides, Tutorials and more...

Moderator: Cartographers

Forum rules
Please read the Community Guidelines before posting.

Why are the XML coordinates offset?

Postby degaston on Wed Jan 15, 2014 1:41 pm

I wasn't happy with the map making tools out there, so I was working on my own. When I tested displaying troops at the territory coordinates using a CC xml file, all of the numbers appeared far away from where they should have been. Looking at the xml files revealed some strange numbers. For example, in Oasis, the Marlo territory coordinates contain <smally>489</smally> and <largey>646</largey>, but the small and large maps are only 476 and 635 pixels high, respectively. After some experimentation, it appears that the coordinates for every territory are offset from where they should be by +4x and +22y. I can compensate for this, now that I know it's there, but does anyone know why it's like this?
universalchiro wrote:@degaston: whatever dude you win, you have it all figured out. You have out smarted even God.
User avatar
Brigadier degaston
 
Posts: 969
Joined: Fri Apr 01, 2011 10:12 am

Re: Why are the XML coordinates offset?

Postby Gilligan on Wed Jan 15, 2014 2:21 pm

degaston wrote:I wasn't happy with the map making tools out there, so I was working on my own. When I tested displaying troops at the territory coordinates using a CC xml file, all of the numbers appeared far away from where they should have been. Looking at the xml files revealed some strange numbers. For example, in Oasis, the Marlo territory coordinates contain <smally>489</smally> and <largey>646</largey>, but the small and large maps are only 476 and 635 pixels high, respectively. After some experimentation, it appears that the coordinates for every territory are offset from where they should be by +4x and +22y. I can compensate for this, now that I know it's there, but does anyone know why it's like this?


There's a good program I use for coordinates...Let me see if I can find a link. Not sure why that is happening to you, though.
Image
User avatar
Major Gilligan
 
Posts: 12478
Joined: Thu May 11, 2006 4:59 pm
Location: Providence, RI

Re: Why are the XML coordinates offset?

Postby degaston on Wed Jan 15, 2014 3:28 pm

Gilligan wrote:
degaston wrote:I wasn't happy with the map making tools out there, so I was working on my own. When I tested displaying troops at the territory coordinates using a CC xml file, all of the numbers appeared far away from where they should have been. Looking at the xml files revealed some strange numbers. For example, in Oasis, the Marlo territory coordinates contain <smally>489</smally> and <largey>646</largey>, but the small and large maps are only 476 and 635 pixels high, respectively. After some experimentation, it appears that the coordinates for every territory are offset from where they should be by +4x and +22y. I can compensate for this, now that I know it's there, but does anyone know why it's like this?


There's a good program I use for coordinates...Let me see if I can find a link. Not sure why that is happening to you, though.

Here is a section of the xml from USA 2.1:
Code: Select all
<territory>
   <name>Miami</name>
   <borders>
      <border>West Palm Beach</border>
    <border>Tampa</border>
    <border>Key West</border>
   </borders>
   <coordinates>
      <smallx>747</smallx>
      <smally>743</smally>
      <largex>898</largex>
      <largey>887</largey>
   </coordinates>
 <neutral>2</neutral>
</territory>
<territory>
   <name>Key West</name>
   <borders>
      <border>Miami</border>
   </borders>
   <coordinates>
      <smallx>717</smallx>
      <smally>758</smally>
      <largex>859</largex>
      <largey>905</largey>
   </coordinates>
 <neutral>2</neutral>
</territory>

Notice that for Key West, the y coordinates are larger than the size of the map images (750 & 901).

Here are a couple of shots from the small and large versions of the map with the Miami coordinates turned purple:
Small map:
Image
Large map:
Image
Both "XML Wizard" and "Conquer Club Map Maker" display the numbers where you would expect them to be. But XML Wizard doesn't support the latest XML features, and Map Maker doesn't allow any editing. If you have something else, I'd be interested in seeing it.

I'm guessing that this is just a "feature" left over from some very early code, and all map utilities created since then have just had to adjust for it.
User avatar
Brigadier degaston
 
Posts: 969
Joined: Fri Apr 01, 2011 10:12 am

Re: Why are the XML coordinates offset?

Postby thenobodies80 on Sun Jan 19, 2014 8:50 am

Also the xml wizard coords had that issue, if there's no more is probably because chipv has fixed it. As you said it can be easily adjusted.
And yes you're not crazy, you have to compensate those exact values to have coords that suit for CC if you use your own program. Don't ask me why since i can't see the code, but i know it's in that way.

Said that I strongly suggest you to be patient, we are looking in having a serious, professional and official toy for mapmakers. Promised. ;)
User avatar
Sergeant 1st Class thenobodies80
 
Posts: 5399
Joined: Wed Sep 05, 2007 4:30 am
Location: Milan


Return to Tools & Guides

Who is online

Users browsing this forum: No registered users

cron