Why are the XML coordinates offset?

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

Moderators: Global Moderators, 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?
Image
Whodunnit? map now looking for gameplay comments.
User avatar
Colonel degaston
 
Posts: 385
Joined: Fri Apr 01, 2011 10:12 am
Medals: 12
Standard Achievement (1) Doubles Achievement (2) Triples Achievement (1) Manual Troops Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (1) Ratings Achievement (2) General Achievement (2)

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
Colonel Gilligan
Cartography Assistant
Cartography Assistant
 
Posts: 12704
Joined: Thu May 11, 2006 4:59 pm
Location: Providence, RI
Medals: 197
Monthly Leader Bronze (1) Most Improved Silver (1) Standard Achievement (4) Doubles Achievement (3) Triples Achievement (3)
Quadruples Achievement (3) Terminator Achievement (3) Assassin Achievement (3) Manual Troops Achievement (3) Freestyle Achievement (4)
Polymorphic Achievement (2) Nuclear Spoils Achievement (3) Fog of War Achievement (4) Trench Warfare Achievement (3) Speed Achievement (4)
Teammate Achievement (3) Random Map Achievement (3) Cross-Map Achievement (4) Beta Map Achievement (2) Battle Royale Achievement (3)
Bot Achievement (2) Ratings Achievement (4) Tournament Achievement (30) General Achievement (29) Clan Achievement (8)

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
Colonel degaston
 
Posts: 385
Joined: Fri Apr 01, 2011 10:12 am
Medals: 12
Standard Achievement (1) Doubles Achievement (2) Triples Achievement (1) Manual Troops Achievement (1) Fog of War Achievement (2)
Trench Warfare Achievement (1) Ratings Achievement (2) General Achievement (2)

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. ;)

Give every man your ear, but few thy voice. Take each man's censure, but reserve thy judgment.
show
User avatar
Corporal 1st Class thenobodies80
 
Posts: 5558
Joined: Wed Sep 05, 2007 4:30 am
Medals: 70
Standard Achievement (3) Doubles Achievement (2) Triples Achievement (1) Quadruples Achievement (2) Terminator Achievement (2)
Assassin Achievement (2) Manual Troops Achievement (2) Freestyle Achievement (2) Nuclear Spoils Achievement (2) Fog of War Achievement (3)
Speed Achievement (2) Teammate Achievement (1) Cross-Map Achievement (3) Bot Achievement (1) Ratings Achievement (4)
General Achievement (8) Map Contribution (7) Tournament Contribution (6) General Contribution (17)


Return to Tools & Guides

Who is online

Users browsing this forum: No registered users

Login