Game Development Community

Why is there so much jittering/choppiness at larger distances?

by Chad Hall · in Torque 3D Professional · 11/22/2014 (6:10 pm) · 10 replies

So, I was messing around with large worlds in T3D when I noticed how significantly bad movement jittering/choppiness became at certain distances. I've tried looking this up and I've found threads talking about floating point inaccuracies once the numbers become large-enough but I don't think that's the case here... maybe?

It becomes barely noticeable once you reach x 3000 y 3000 and definitely noticeable when you hit x 10,000 y 10,000. Once you go beyond that it just becomes ridiculous. I've tried looking anywhere I can think to check accuracy but I just can't figure it out. Is this really supposed to be happening at these distances? Is there anything I can try to mitigate this effect short of reducing the scale of everything in the game?

#1
11/22/2014 (6:33 pm)
3000 seems pretty small, but I'm pretty sure 10000 is a known rule-of-thumb limit. See this thread for why scaling down doesn't work. I'll quote myself:
Quote:When you scale down your distances and sizes, you make the tiny errors that exist in floating point numbers more visible. Imagine you're a human, and a small rock at your foot jumps a millimetre to the left. You don't notice, it's a tiny error. But now imagine you're an ant next to the rock. Suddenly, the rock moves half your body length!
I get the impression that most games that really need continuous spaces bigger than 10x10km will recenter the world when you get too far from the origin.
#2
11/22/2014 (6:50 pm)
Well, that is interesting and a bit disappointing. What I was confused by was why the jittering gets so much worse without shifting by another decimal. I thought it would be consistent from 10,000 to 99,999 but I guess it isn't due to the inaccuracy. I'll poke around a bit more knowing this and try to understand it better. Thanks for the super fast reply.
#3
11/22/2014 (7:21 pm)
If you want to understand why precision becomes worse with larger whole numbers see this, especially look at the second table for relevant distance and resolution comparisons: randomascii.wordpress.com/2012/02/13/dont-store-that-in-a-float/
#4
11/23/2014 (9:32 pm)
So then whats the way to fix it? redo how all the numeric values are stored - from what to what?
#5
11/24/2014 (6:11 am)
The way to fix it is to make it camera-centric (move the world, not the camera) and page terrain in - endless worlds limited only by hard drive space. But then multiplayer becomes really tough. Changing to 64 bit storage just delays the inevitable - and won't work now anyway because graphics systems are still using floats to store this data.
#6
11/24/2014 (10:44 am)
so that's how all the MMOs and all the other engines nowadays do this?
#7
11/24/2014 (2:13 pm)
majority of MMOs used zones but some use smaller chunks of land with own coordinate system.

some reference herE:

scottbilas.com/games/dungeon-siege/

gamedev.stackexchange.com/questions/3935/in-what-kind-of-variable-type-is-the-pl...
#8
11/24/2014 (2:15 pm)
I've seen some posts mentioning that UE4 has a client-centric coordinate system, but other posts make it sound like you have to do that yourself. Not sure how other games handle it.

Storing positions as 64-bit will get you high precision out to many times Pluto's orbit. You can then do client-centric rendering based on absolute positions - see this for details. You basically do all your position calculations in doubles, then convert that to floats for rendering because as Richard says, hardware works on single precision for now.
#9
11/25/2014 (11:41 am)
UE4 has functionality for this but it only works client-side. It recenters the origin when you walk into another chunk.

I think what people sometimes forget is that you have to populate the world too and make it interesting. Look at WoW, it uses zones really but people get the impression it's more complicated because the world seems so large. That's because it's populated. Each continent has its own zone.
#10
11/25/2014 (3:05 pm)
It does depend on your gametype - for example, a flight sim needs a lot less ground detail.