 |

07-28-2005, 03:35 PM
|
 |
A Griffon
|
|
Join Date: Nov 2004
Server: Guk
Posts: 536
|
|
How to Calculate ZoneRect - The whole story
I have spent the last week getting up to speed on mapping. Despite all the wonderful tools and turorials, one topic continued to confuse me: Zonerect.
What ZoneRect Represents
Zonerect represents the in-game /loc of the edges of the displayed map image. Not the edge of the map's internal lines, but the actual edges of the bitmap*. The implications of this are that, except in extreme cases, you will not actually be able to move your character to these /loc extents. Also, you don't actually want your map to touch the edges of the bitmap - that's ugly.
How can I calculate it if I can't get there?
MATHS, my son, MATHS!
We DO know the in-game /loc of some points of the map (hopfully all of them). We also can find out the coordinates of the same location in your generated bitmap. Because we know how the game calculates your cursor's position, we can work it backwards to determine the extents of the map and thus the Zonerect.
You can see from the illustration below, we can determine the upper left and lower right coordinates by taking the cooridnates of other known points on the map. Then just punch them into Taco's 'leet tool and you're good to go.
Sanity Check:
Remember that the ZoneRect describes the /loc extremes of the bitmap.
-159, -29, 143, -380
x min = -159
The leftmost point shows as -150 and is pretty close to the edge, so that's good.
y max = -29
The topmost point is at -32 and is REALLY close to the edge, so that's good.
x Max 143
The rightmost point is at 132 and is kinda close to the edge, so that's good.
y min = -380
The bottommost point, -329, is a fair ways from the edge, so that looks good.
Of course, these numbers are pretty close, but probably not perfect. You'll probably have to tweak them a bit by one or two points.
* NOTE: When I say Bitmap, I'm refering to the .JPG or .DDS file that is displayed on the map screen.
__________________
|

07-29-2005, 05:12 PM
|
|
A Grizzled Badger
|
|
Join Date: Apr 2005
Server: Antonia Bayle
Posts: 45
|
|
A couple of questions and comparisons.
Wow, nice work! I love the graphical representation. I appreciate the effort you put into this. Except, I am unlclear as to how you came up with some of the numbers.
You have the northern most coordinates being: -62.73, -32.88 (x and y)
You have western most coordinates being: 150.94, -152.79
My coordinates show northern most should be: 50.92, -330
My coordinates show the western most should be : 145.79, -145.21
Projecting those coordinates, I get 145.79, -330 for the NW corner of my bitmap. You have -150.94, -32.88 I can see you may have added a little to the western coordinate, but what about the northern coordinate? A miss placed decimal point?
Even if I Negate the western and eastern coordinates (-W,N,-E,S) like tonyis3l33t's post says, I do not come up with the same numbers as you. I get -145.79, -330 for the NW corner of the bitmap.
You have the eastern most coordinates being: -132.86, -100
You have the southern most coordinates being: 52, -329.81
My coordinates for eastern most are: -130.82, -100.90
My coordinates for southern most are: -113.52, -45.44
Projecting those coordinates I get: -130.82, -45.44 for the SE corner of my bitmap. You have -132.86, -329.81 Again, I can see your eastern coordinate being close, but the southern coordiante is no where near what I have.
Now, if I negate the E/W coordinate, I get 130.82, -45.44 for that SE corner of the bitmap.
Futher, I tried the zone Erect from your post and it doesnt work. My cursor moves backwards, even though I am moving forward and does not follow the map.
How do I get the BM coordinates? You have 12,5 for NW corner and 421, 433 for SE corner of bitmap. I need to have those to get the zone erect. Or I need the zone erect to get the map image location on the bitmap.
This is the Zone Erect that I get from using Open Office with the map.svg file: -150.94, -329.81, 132.86, -32.88 which is wrong, we know because the coordinates from /loc did not reach the extremities.
Northern most coordinates: 50.92, -59.95, -330.06
Southern most coordinates: -113.52, -70.38, -45.44
Eastern most coordinates: -130.82, -68.21, -100.90
Western most coordinates: 145.79, -63.39, -145.21
I think I almost have this figured out, if you could explain how you got those number. Thanks so much for you work on this and your effort to help me understand this.
Trip
|

08-01-2005, 06:45 PM
|
 |
A Griffon
|
|
Join Date: Nov 2004
Server: Guk
Posts: 536
|
|
Ok, lemme try again.
Where the "BM" or "Bitmap" or "Image" Coodinates come from:
You have created a custom image. The actual position of the "map" portion of that image is selected entirely by you. Because of that, the leftmost, rightmost, topmost, and bottomost sections of the map are variable. You need to use an image editor to determine the these.
I use Adobe Photoshop. As you can see from the image below, I pull down a "Guide" line until it just touches the topmost portion of the map. I can tell from Photoshop's cursor position display that it is exactly 5 Pixels from the top of the image.
Now I can pull a guide over to the leftmost portion of the image. That is 9 pixels from the left side of the image.
I use the same process to get the rightmost and bottommost coordiantes. See those in my image as "Image coordinates."
Where the /loc Coordinates come from:
When you ran around the map, spamming /loc, you created a big log of in-game coordinates. My Mapper2 tool, and other's various tools, scan through those coordinates and determine what the largest and smallest X and Y coordinates are. These are the furthest extents of the in-game coordinates for the map. We know that: The largest X is the leftmost, Smallest is Rightmost. Smallest Y (Mathmatically) is Topmost, Largest is bottomost.
Now we've got all the data to plug into Tony's tool.
The mistake I made last time was forgetting that ZoneRec is in the format -W, N, -E, S -- I got the W and E's signs reversed.
Hope that explains it better.
__________________
|

08-01-2005, 07:30 PM
|
|
A Grizzled Badger
|
|
Join Date: Apr 2005
Server: Antonia Bayle
Posts: 45
|
|
Now I get it! Count the pixels from the edge! Yes, Yes! Very clear now! I had no idea it was that easy.
Thanks alot SaintPeter. I really appreciate you taking the time to clear this up for me.
Trip
|

08-02-2005, 09:41 AM
|
 |
A Griffon
|
|
Join Date: Nov 2004
Server: Guk
Posts: 536
|
|
Quote:
|
Originally Posted by Trip
Now I get it! Count the pixels from the edge! Yes, Yes! Very clear now! I had no idea it was that easy.
|
Note, it's not from any edge - it's from the top left corner.
And yes, it's that easy. I've been pleased when I am able to get a correct ZoneRect on the very first try. In fact, the biggest problem I've had is accidentally transposing numbers when entering them into the tool. Measure Twice, Zonecheck once.
__________________
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:09 AM.
|
 |