Page 1 of 1

World vs map coordinates

Posted: Tue Sep 10, 2013 5:38 pm
by morbydvisns
Is there any possible way we can get a more... uniform conversion between map and world coordinates? The current way, there are 256 tiles, and 3,000,000 map coordinates in each the x and y axis. That is 11718.75 world points per tile. This makes it difficult for precise world/map coordinate conversion in scripting, because the parser does not do decimals.

Posted: Tue Sep 10, 2013 7:47 pm
by zaroba
math might be off off

have 2 buildings on zoric, one at 25,25 and one at 26,26
their world cords are x,y 56152,56152 and 58398,56152
comes out to 2246 world points per tile in each axis.

had the same results with a default 256x256 map and a 2x tile sized 1024x1024 map

Posted: Tue Sep 10, 2013 8:49 pm
by morbydvisns
make a &command to *say your playerworldx and y, go to the far up/left corner and run it, see what you get

Posted: Tue Sep 10, 2013 9:30 pm
by morbydvisns
Nevermind, I see what's going on.. at 1200 landscape scale, there are 3 million world coordinates per axis, at 400 landscape scale there are 1 million.

Posted: Tue Sep 10, 2013 9:43 pm
by zaroba
ahh, my tests must not have had a large enough difference in tile size

Posted: Tue Sep 10, 2013 11:45 pm
by Mit
does the script function sysMapToWorld help?
i.e.

Code: Select all

$worldX = sysMapToWorld( $mapX )
the world size is basically the position in cm (or tenths of a cm, whatever.. it depends how tiny people are.. ). The tile size/landscape scale is an arbitrary number that affects how big each tile is. Hence the relative scale of map coordinates - i.e. tile coord - and the world coordinates are variable.

Posted: Wed Sep 11, 2013 1:30 am
by morbydvisns
Not bad, i'm sure that will come in handy. I just learned of getting more than 256 tiles on the map today =) so that resolved a big chunk of issue for me.