All pastes #64937 Raw Edit

Untitled

public text v1 · immutable
#64937 ·published 2006-06-12 20:34 UTC
rendered paste body
grid 20_18   is 0_0 ingame


(real ingame  X / 32768 ) + 20 for X
(real ingame  Y / 32768 ) + 18 for Y

and round down to nearest int

the bloacks are stored like so in the file.

1  9 17 25 33 41 49 57
2 10 18 26 34 42 50 58
3 11 19 27 35 43 51 59
4 12 20 28 36 44 52 60
5 13 21 29 37 45 53 61
6 14 22 30 38 46 54 62
7 15 23 31 39 47 55 63
8 16 24 32 40 48 56 64

104304	= 3.183105469  = 23.183105469 (round to lowest int)
200608  = 6.183105469  = 24.183105469 (round to lowest int)

we can see we are at grid 23_24

now work out the 0,0 values for 23,24

x = 98304
y = 196608

we can now subtract the 0,0 from the real players x,y

104304 - 98304 = 6000
200608 - 196608 = 4000

next we divide these by 4096 ( the grid size we use in our files)

(6000/4096) = 1.46 (round to lowest int) = 1
(4000/4096) = 0 (round to lowest int) = 0
so we KNOW that our block is at 2,1

to get the block we ( 1 ) + ( 8 * 0 ) = 1