COnquer coordinate in cartesian coordinate ?

01/02/2011 16:38 gorgone#1
i m working on my minimap in pro4never proxy, i cleaning map from coquer site and put in picture box

now i want to locate my char in this minimap likes in game :) but the coordinate in game are different view of classic cartesian coordinate :)

some1 had module to trasform Conquer coordinate in cartesian coordinate ?

or explain me why cood traslation in math not work :// :handsdown:

i m working on this sistem

X e Y are coordinate in CO and MX, MY are coordinate in my picture

i have a system like :

MX = a + X sin 30° - Y cos 30°
MY = b + X cos 30° + Y sin 30°

i suppose there isn t a normal traslation becouse i don t have a cartesian coordinate in game ( the view is isometric or similare 120°)


thx so much for the help ^^
01/03/2011 03:50 pro4never#2
Quote:
Originally Posted by gorgone View Post
i m working on my minimap in pro4never proxy, i cleaning map from coquer site and put in picture box

now i want to locate my char in this minimap likes in game :) but the coordinate in game are different view of classic cartesian coordinate :)

some1 had module to trasform Conquer coordinate in cartesian coordinate ?

or explain me why cood traslation in math not work :// :handsdown:

i m working on this sistem

X e Y are coordinate in CO and MX, MY are coordinate in my picture

i have a system like :

MX = a + X sin 30° - Y cos 30°
MY = b + X cos 30° + Y sin 30°

i suppose there isn t a normal traslation becouse i don t have a cartesian coordinate in game ( the view is isometric or similare 120°)


thx so much for the help ^^
I don't have any math systems for it but here's a picture I made when I was working on documenting how conquer maps work.


[Only registered and activated users can see links. Click Here To Register...]

That's the ACTUAL coords attached to that using a image chunk from the client. Those lines represent the actual coords used (iirc it was something like 32 degree rotation)

[Only registered and activated users can see links. Click Here To Register...]

and that's the layout for the grid obviously... they were just tools to help myself visualize stuff.
01/04/2011 16:41 gorgone#3
this is the solution

x1 = xo+ (float)(Owner.X * Math.Cos(o) - Owner.Y * Math.Sin(o));
y1 = yo+ (float)(Owner.X * Math.Sin(o) + Owner.Y * Math.Cos(o));

where angle o must be between 32.00 / 32.45 and xo yo are the origin of master plain of minimap
^.^ thx to give me the idea to try on a paper !!!
01/04/2011 18:19 unknownone#4
You can do the conversion without using trig at all if you know the size of the map and size of the image. (These are obtainable from the map files).

I described how in a previous post [Only registered and activated users can see links. Click Here To Register...].

Code:
    public Point MapCoordinateToScreenPoint(Point mapCoordinate) {
        return new Point(
            (mapCoordinate.X - mapCoordinate.Y) * map.Cells.Height + (puzzle.Width / 2), 
            (mapCoordinate.X + mapCoordinate.Y - (map.Bounds.Height - 1)) * (map.Cells.Width / 2) + (puzzle.Height / 2)
        );
    }
This should apply to the minimaps too, but you'll just need to scale the result to the size of the minimap.
01/04/2011 18:23 IAmHawtness#5
Edit: ^ unknownone beat me to it :(

This is way too difficult an approach, if you ask me. You should take a look at [Only registered and activated users can see links. Click Here To Register...]
Making your own minimap by reading from Conquer's map files (.dmaps) would be the right way to do it. That way you can easily just plot your character on the map using the actual Conquer coordinates.

Example:
You're in a map that's 1200x1200 tiles. You read the .dmap that belong to that map, create your own image (bitmap) with the same width/height as the in-game map, and for each invalid coordinate you read from the .dmap file, you paint it black and the valid coordinates white.
You then place the bitmap you just created on an Image control or whatever it's called, can't remember, but this way, you get a map that equals the actual in-game map
02/07/2011 02:28 gabrola#6
Quote:
Originally Posted by unknownone View Post
You can do the conversion without using trig at all if you know the size of the map and size of the image. (These are obtainable from the map files).

I described how in a previous post [Only registered and activated users can see links. Click Here To Register...].

Code:
    public Point MapCoordinateToScreenPoint(Point mapCoordinate) {
        return new Point(
            (mapCoordinate.X - mapCoordinate.Y) * map.Cells.Height + (puzzle.Width / 2), 
            (mapCoordinate.X + mapCoordinate.Y - (map.Bounds.Height - 1)) * (map.Cells.Width / 2) + (puzzle.Height / 2)
        );
    }
This should apply to the minimaps too, but you'll just need to scale the result to the size of the minimap.
This didn't work tbh. However this did:

Code:
    public Point MapCoordinateToScreenPoint(Point mapCoordinate) {
        return new Point(
            (mapCoordinate.X - mapCoordinate.Y - 1) * map.Cells.Height + (puzzle.Width / 2), 
            (mapCoordinate.X + mapCoordinate.Y - map.Bounds.Height) * (map.Cells.Height / 2) + (puzzle.Height / 2)
        );
    }
Sorry for the slight bump too, I just thought it was necessary.