How does this generator work?
Hello guys,
From long time, I was thinking on how this website generates exactly:
http://chyaki.kilu.de/coord.php
I have tried to think how does it do ... but no use, my mind is powered off ....
It is generator the warp of an specific area from X & Y coordinate ...
it just taking X and Y, and generate:
- Region
- MiniCoorX
- MiniCoorZ = 0 (Which is not generated by X and Y)
- MiniCoorY
I have got the some idea on how does the PosX and PosY generated not really, but how does Region generated??
each 10 MiniCoorX = 1 X Coordinate
each 10 MiniCoorY = 1 Y Coordinate
each 1920 MiniCoorX = 1 X Position
each 1920 MiniCoorY = 1 Y Position
Started X&Y Coordinate is = 0,0
Started X&Y Position is = 135,92
Not saying come help me, just saying share me with your opinion ;)
Cheers
Re: How does this generator work?
I just know the reverse step, generate x and y map cords from the region id.
Region 25000 (Jangan).
mod(25000/256) = 168 (X region)
25000/256 = 97 (Y region)
Dunno if this can help you.
Re: How does this generator work?
xpos = Mod($silkroad_x, 192) * 10
ypos = Mod($silkroad_y, 192) * 10
xsec = ($silkroad_x - $xpos / 10) / 192 + 135
ysec = ($silkroad_y - $ypos / 10) / 192 + 92
dunno if /warp uses sectors or positions or both
Re: How does this generator work?
Quote:
Originally Posted by
kaperucito
I just know the reverse step, generate x and y map cords from the region id.
Region 25000 (Jangan).
mod(25000/256) = 168 (X region)
25000/256 = 97 (Y region)
Dunno if this can help you.
Quote:
Originally Posted by
NoNStop
xpos = Mod($silkroad_x, 192) * 10
ypos = Mod($silkroad_y, 192) * 10
xsec = ($silkroad_x - $xpos / 10) / 192 + 135
ysec = ($silkroad_y - $ypos / 10) / 192 + 92
dunno if /warp uses sectors or positions or both
YEAPEEEE !! AT last I got the idea how does Region generated :D
Thank you a lot guys :thumbup:
Re: How does this generator work?
Quote:
Originally Posted by
megaman963
YEAPEEEE !! AT last I got the idea how does Region generated :D
Thank you a lot guys :thumbup:
can you share the way it generated?
btw I found something what can be useful for you:
PHP Code:
;calculate sector, xpos and ypos to ingame x and ycoordinates
$xSector = BitAND(_WinAPI_LoWord($aSplit[1]), 0xFF) ;lobyte
$ySector = BitShift(_WinAPI_LoWord($aSplit[1]), 8) ;hibyte
$xCoord = Round(($xSector - 0x87) * 0xC0 + $aSplit[2] / 0x0A, 0)
$yCoord = Round(($ySector - 0x5C) * 0xC0 + $aSplit[4] / 0x0A, 0)
;calculate x and y coordinates to x and y pixels on map
$vGetX = Round(($xCoord + 13248) / 6) - ($vPixelSize / 2)
$vGetY = Round((-$yCoord + 4218) / 6) - ($vPixelSize / 2)
Full source:
http://www.mediafire.com/?lfjcaghx33wlmyg