Map coord to unit coords and back

Map coord to unit coords and back

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
johanhagelback
Posts: 13
Joined: 17 Sep 2009, 10:49

Map coord to unit coords and back

Post by johanhagelback »

Hi,

This might have been answered before but I couldnt find any good info about it.

The map size on my test map is 512x512. The coordinate for my units are something like (x=3660.1147, z=3502.4683).

How do I convert coordinates from units to map and back?

Cheers,
Johan
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Map coord to unit coords and back

Post by imbaczek »

multiply or divide by 8, depending on what you want where.
User avatar
Error323
AI Developer
Posts: 237
Joined: 28 Nov 2006, 16:46

Re: Map coord to unit coords and back

Post by Error323 »

Relation between all the maps is:

slopemap 1:2 heightmap 1:8 realmap

GetMapWidth() and GetMapHeight() give map dimensions in heightmap resolution.
Post Reply

Return to “AI”