4

I'm playing in the void with Minecraft when I suddenly realised that my Y gradually stopped working (exact value:Y=-36 028 797 018 963 968, can't really find the exact value). See this video:

First the decimal places start to stop updating. Then the whole Y co-ordinates update starts to slow. Then finally it freezes there and sometimes I get a lag spike. Why is this happening? What is the explanation behind this? Is the data too big to handle? Is my computer too slow to handle?

  • you went outside world bounderies. – codermaster Dec 22 '14 at 15:49
  • Of course I AM. But the Y is gradually slowing (sorry I have now edited the question) to stop instead of just stopping at one point. First the decimal places start to stop functioning, then the Y co-ordinates update slows down, and then it freezes. – 54D Dec 22 '14 at 15:52
  • because you cant go there and it just won't let you fly any further. You just don't see that your not moving because you are in the void – codermaster Dec 22 '14 at 15:53
  • But I can still teleport myself even further. And I can move, by the way. I can still go down, without Y updating. Why I know I'm moving? Because I see the sky moving up and down when I press and release Shift.(Sorry, I don't really understand your point...) – 54D Dec 22 '14 at 15:56
  • Someone smarter than me can confirm my suspicion that this is some kind of variable lenght limit on MinecrafT? The number is longer than a 32-bit Integer variable, and far too low for a 64-bit int, any ideas? – FullMetal AlcheBlitz Dec 22 '14 at 16:27
14

Because computers store numbers in limited precision.

With bigger numbers the precision gets worse and worse, because the numbers are stored something like 1.2345·10123 (but in binary... it's a long story).

Here, I try to decrease a big floating point number by different amounts. Notice how changing it by smaller amounts doesn't do anything.

>>> a = -360287969785042688.0
>>> a = a-1; format(a, 'f')       
'-360287969785042688.000000'
>>> a = a-5; format(a, 'f')       
'-360287969785042688.000000'
>>> a = a-10; format(a, 'f')  
'-360287969785042688.000000'
>>> a = a-15; format(a, 'f') 
'-360287969785042688.000000'
>>> a = a-20; format(a, 'f')  
'-360287969785042688.000000'
>>> a = a-25; format(a, 'f') 
'-360287969785042688.000000'
>>> a = a-30; format(a, 'f')  
'-360287969785042688.000000'
>>> a = a-35; format(a, 'f') 
'-360287969785042752.000000'
>>> a = a-35; format(a, 'f')
'-360287969785042816.000000'
>>> a = a-35; format(a, 'f')
'-360287969785042880.000000'
>>> a = a-35; format(a, 'f')
'-360287969785042944.000000'

Notice how the difference between numbers isn't actually 35. It is the smallest possible difference between two such huge numbers in binary floating-point representation.

The same happens in the game. Multiple times per second it tries to decrease your Y position by vertical speed, which is apparently less than this minimal difference between two neighboring numbers.

But if you teleport by a larger amount, you obviously can break that limit.

This is clearly outside the scope of this site. But there is plenty of information on floating-point numbers.

  • Ha! So my suspicions were correct, thank you sir, +1 to you :) – FullMetal AlcheBlitz Dec 22 '14 at 16:46
  • An active explination like i haven't seen before. Also yay for doing science with python interactive. – StarWeaver Dec 27 '14 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.