okay so here's an example:
X:251 Y:3200
compress:
251 * 1,000,000 = 251,000,000 + 3200 = 251,003,200
unpacking:
first number:
251,003,200 / 1,000,000 = 251.0032 (use floor to get 251)
second number:
251,003,200 / 1,000,000 = 251.0032 (use floor to get 251)
251 * 1,000,000 = 251,000,000
251,003,200 - 251,000,000 = 3200 (or just use mod)
works perfect!
for negative numbers:
X:4 Y:-8
compress:
4 + 100,000 = 100,004
-8 + 100,000 = 99,992
100,004 * 1,000,000 = 100,004,000,000 + 99,992 = 100,004,099,992
blackhornet so far this is a problem right? does this go beyond the highest value? isn't it int32: 2,147,483,647?