Conquer Club

maps/Classic_Shape.xml coordinates seem off

Topics that are not maps. Discuss general map making concepts, techniques, contests, etc, here.

Moderator: Cartographers

Forum rules
Please read the Community Guidelines before posting.

maps/Classic_Shape.xml coordinates seem off

Postby cspare on Fri Jan 09, 2009 12:29 pm

The coordinates given in the maps/Classic_Shape.xml file dont seem to match those on the .jpg files (maps/Classic_Shapes.L.jpg).
I've drawn the coordinates from the xml in the jpg here:
Image
red: n1, blue: a1 green: o4
as you can see they don't line up. Any idea why and how to determine the correct jpg coords for the giving xml coords?
Last edited by cspare on Fri Jan 09, 2009 12:40 pm, edited 1 time in total.
Sergeant 1st Class cspare
 
Posts: 101
Joined: Sun Apr 08, 2007 12:56 pm

Re: maps/Classic_Art.xml coordinates seem off

Postby Optimus Prime on Fri Jan 09, 2009 12:37 pm

Ummm... that doesn't look anything like the XML should look on the map. Are you sure you did it right? Not to mention, you have the Classic Shapes map image, not the Classic Art one.

EDIT: I just went and looked at both maps in active games where the XML was generating army numbers. They look right to me.
User avatar
Cadet Optimus Prime
 
Posts: 9665
Joined: Mon Mar 12, 2007 9:33 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby ZeakCytho on Fri Jan 09, 2009 12:42 pm

Since the 88s display fine on the map, I think the problem must be in how you plotted your coordinates.
User avatar
Captain ZeakCytho
 
Posts: 1251
Joined: Wed Sep 12, 2007 4:36 pm

Re: maps/Classic_Art.xml coordinates seem off

Postby cspare on Fri Jan 09, 2009 12:48 pm

Optimus Prime wrote:Ummm... that doesn't look anything like the XML should look on the map. Are you sure you did it right? Not to mention, you have the Classic Shapes map image, not the Classic Art one.

EDIT: I just went and looked at both maps in active games where the XML was generating army numbers. They look right to me.

I accidentally wrote classic art instead of classic shapes in my post, i checked both the xml with the jpg for classic shapes.
The problem isn't visible in the CC site itself, games are showing the maps correctly. The problem I'm having is when doing the xml coordinates mapping myself.

For example what I did to draw the red line:
From the XML:
<territory>
<name>N1</name>
<borders>
<border>N2</border>
<border>N5</border>
<border>A12</border>

</borders>
<coordinates>
<smallx>46</smallx>
<smally>86</smally>
<largex>57</largex>
<largey>98</largey>

</coordinates>
</territory>

So the Coordinates are: X: 57 and Y: 98
I then simply draw a line with that coordinates on the jpg i downloaded with the result as i posted before.
Sergeant 1st Class cspare
 
Posts: 101
Joined: Sun Apr 08, 2007 12:56 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby gimil on Fri Jan 09, 2009 12:52 pm

http://www.conquerclub.com/mapmaker/index.php

There is no problem with the current coordinates. All numbers are generated from the XML file on http://www.conquerclub.com/maps So if they appear correct ingame and on the map tool then they are correct on the XML.

This must be a purly human error this time round :)
What do you know about map making, bitch?

natty_dread wrote:I was wrong


Top Score:2403
User avatar
Corporal 1st Class gimil
 
Posts: 8599
Joined: Sat Mar 03, 2007 12:42 pm
Location: United Kingdom (Scotland)

Re: maps/Classic_Shape.xml coordinates seem off

Postby cspare on Fri Jan 09, 2009 12:55 pm

gimil wrote:http://www.conquerclub.com/mapmaker/index.php

There is no problem with the current coordinates. All numbers are generated from the XML file on http://www.conquerclub.com/maps So if they appear correct ingame then they are correct on the XML.

This must be a purly human error this time round :)

Yea i know. human error seems most likely but I don't see what I am doing wrong. In fact I still am expecting for something like the Y coordinates from the XML have to be subtracted by an offset 30 pixels.

edit: to clarify, the X coordinates are always accurate, but the Y coordinates are exactly 30 pixels off. I also checked this with the World 2.1 map with the same result, so I guess it goes for all maps.
Last edited by cspare on Fri Jan 09, 2009 3:37 pm, edited 1 time in total.
Sergeant 1st Class cspare
 
Posts: 101
Joined: Sun Apr 08, 2007 12:56 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby MrBenn on Fri Jan 09, 2009 3:32 pm

The coordinates are for the centre of the army number... and they start from the top left ;-)
Image
PB: 2661 | He's blue... If he were green he would die | No mod would be stupid enough to do that
User avatar
Lieutenant MrBenn
 
Posts: 6880
Joined: Wed Nov 21, 2007 9:32 am
Location: Off Duty

Re: maps/Classic_Shape.xml coordinates seem off

Postby cspare on Fri Jan 09, 2009 3:42 pm

MrBenn wrote:The coordinates are for the centre of the army number... and they start from the top left ;-)

Hmm I'm not sure I understand. The Y coordinates don't really seem to be in the center of anything. Also the X coordinates are just a bit off to be the center. You can see it here:
Image
This is a similar image as I posted before, but now with actual army numbers. I resized it 200% to make it easier to see.
Sergeant 1st Class cspare
 
Posts: 101
Joined: Sun Apr 08, 2007 12:56 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby ZeakCytho on Fri Jan 09, 2009 3:44 pm

It is possible that you have your x and y coords flippped? The coordinates you showed in the sample look like they could be okay if you flip the x and y.
User avatar
Captain ZeakCytho
 
Posts: 1251
Joined: Wed Sep 12, 2007 4:36 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby chipv on Fri Jan 09, 2009 3:49 pm

I'm also interested in the answer to this. I had the exact same problem when plotting my highlights for the Turn Watch maps.

I ended up having offsets of 8 for x and 33 for y.
User avatar
Major chipv
Head Tech
Head Tech
 
Posts: 2817
Joined: Mon Apr 28, 2008 5:30 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby cspare on Fri Jan 09, 2009 3:50 pm

ZeakCytho wrote:It is possible that you have your x and y coords flippped? The coordinates you showed in the sample look like they could be okay if you flip the x and y.

Nah, then the green line (from the startpost) for O4 wouldn't have been possible as the map is wider than tall.
Sergeant 1st Class cspare
 
Posts: 101
Joined: Sun Apr 08, 2007 12:56 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby chipv on Fri Jan 09, 2009 3:55 pm

Ah, wait a sec- what are the dimensions of the territory number graphics? (88 etc)
User avatar
Major chipv
Head Tech
Head Tech
 
Posts: 2817
Joined: Mon Apr 28, 2008 5:30 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby cspare on Fri Jan 09, 2009 3:58 pm

chipv wrote:I'm also interested in the answer to this. I had the exact same problem when plotting my highlights for the Turn Watch maps.

I ended up having offsets of 8 for x and 33 for y.

Yea I guess I'll have to go for that solution as well. I can't really understand how I seem to be the first one asking this while mapmakers are making these XML files all the time. They would have to be aware of the offset, right?

chipv wrote:Ah, wait a sec- what are the dimensions of the territory number graphics? (88 etc)

I was thinking about that too yea. but then these graphics have to be about 2 or 4 times (if the y coordinate is really the center of the graphic) its visible size. And I've never seen any army count wrapping to a new line.
Sergeant 1st Class cspare
 
Posts: 101
Joined: Sun Apr 08, 2007 12:56 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby MrBenn on Fri Jan 09, 2009 4:01 pm

The centre of an 88 is (8,6), so that explains why one coord would be offset by 8px.

Not too sure about the 33px offset though... although it could be something to do with a blank space above the map - that is sometimes filled with tournament descriptions?
Image
PB: 2661 | He's blue... If he were green he would die | No mod would be stupid enough to do that
User avatar
Lieutenant MrBenn
 
Posts: 6880
Joined: Wed Nov 21, 2007 9:32 am
Location: Off Duty

Re: maps/Classic_Shape.xml coordinates seem off

Postby chipv on Fri Jan 09, 2009 4:04 pm

Well, the offsets are related to the size of the object positioned, which is why I was asking for the 88 size.
As MrBenn says you have to measure from top left.

So my offsets are ok with the divs I was using.
User avatar
Major chipv
Head Tech
Head Tech
 
Posts: 2817
Joined: Mon Apr 28, 2008 5:30 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby cspare on Fri Jan 09, 2009 4:58 pm

Ok I did some brainstorming with chipv and got the following conclusion: The top-left coordinates of the image is in fact (x, y) -4, 22. So this would have to be the offset for calculating from XML files to images and the other way around.
example given a coordinate from an XML file:
Code: Select all
   <territory>
      <name>N1</name>
      <borders>
         <border>N2</border>
         <border>N5</border>
         <border>A12</border>

      </borders>
      <coordinates>
         <smallx>46</smallx>
         <smally>86</smally>
         <largex>57</largex>
         <largey>98</largey>

      </coordinates>
   </territory>

The coordinates in the jpg images will be: x: 57 + 4 = 61 and y: 98 - 22
Sergeant 1st Class cspare
 
Posts: 101
Joined: Sun Apr 08, 2007 12:56 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby chipv on Fri Jan 09, 2009 5:04 pm

To relate this with offsets, the 33 offset comes from the following:

My div is 23px high. To move it to the top left of the centre should require shifting by 23/2 =~ 11.

22(y offset) + 11 = 33
User avatar
Major chipv
Head Tech
Head Tech
 
Posts: 2817
Joined: Mon Apr 28, 2008 5:30 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby Gilligan on Fri Jan 09, 2009 5:07 pm

Well, here's my two cents...

When working on the XML for WWII Europe, I went through it all only to find out that they were completely wrong. The X value was two too big, and the Y value was something like 24 too small, so I had to go back and add/subtract the respective numbers for each territory. Seems to be the same with others too.
Image
User avatar
Captain Gilligan
 
Posts: 12478
Joined: Thu May 11, 2006 4:59 pm
Location: Providence, RI

Re: maps/Classic_Shape.xml coordinates seem off

Postby MrBenn on Fri Jan 09, 2009 5:46 pm

Jota's Map Assistant must take the shift into account... I've never had a problem with it, except for it's imprecision... which I have devised a work-around for: viewtopic.php?f=127&t=74500
Image
PB: 2661 | He's blue... If he were green he would die | No mod would be stupid enough to do that
User avatar
Lieutenant MrBenn
 
Posts: 6880
Joined: Wed Nov 21, 2007 9:32 am
Location: Off Duty

Re: maps/Classic_Shape.xml coordinates seem off

Postby oaktown on Sun Jan 11, 2009 2:15 am

MrBenn wrote:Jota's Map Assistant must take the shift into account... I've never had a problem with it, except for it's imprecision... which I have devised a work-around for: viewtopic.php?f=127&t=74500

Indeed, Jota's map assist gets it right. On the first map I made I tried doing the XML using coordinates generated from within Photoshop, and it came out all skewed. The first thread in which I remember this being discussed is here...

viewtopic.php?f=127&t=14299&p=265339&hilit=coordinates#p265339

Note that at the time we came up with +22 Y and -4 X for shifts.
User avatar
Captain oaktown
 
Posts: 4451
Joined: Sun Dec 03, 2006 9:24 pm
Location: majorcommand

Re: maps/Classic_Shape.xml coordinates seem off

Postby chipv on Sun Jan 11, 2009 7:45 pm

What is the extra shift in the y-axis for? 25 pixels is used for something.

For an 8x6 territory number image, we would ordinarily need to shift by -4 and -3

Well we have -4 in the x axis but a +22 in the y axis meaning a total shift of 25px.

The Tournament label that goes above it is not measured in absolute pixels (try changing the page text size).
User avatar
Major chipv
Head Tech
Head Tech
 
Posts: 2817
Joined: Mon Apr 28, 2008 5:30 pm

Re: maps/Classic_Shape.xml coordinates seem off

Postby yeti_c on Tue Jan 13, 2009 3:56 am

Ya - this offset is also in BOB.

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am


Return to Foundry Discussions

Who is online

Users browsing this forum: No registered users