Page 1 of 1

Why are the XML coordinates offset?

PostPosted: Wed Jan 15, 2014 1:41 pm
by degaston
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?

Re: Why are the XML coordinates offset?

PostPosted: Wed Jan 15, 2014 2:21 pm
by Gilligan
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.

Re: Why are the XML coordinates offset?

PostPosted: Wed Jan 15, 2014 3:28 pm
by degaston
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.

Re: Why are the XML coordinates offset?

PostPosted: Sun Jan 19, 2014 8:50 am
by thenobodies80
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. ;)