Download

General precision guidelines? how far up or down in world units before problems arise?

I have an idea for a game and and I know that there is tiled world support for large worlds in horizontal terms. But what about vertically? My game would would mostly exist in a small vertical slice. Almost like a vertical platformer you could say. I want to know how far up or down can one be before the shaky precision stuff starts happening.

For instance would 100 miles straight up be an issue?

At default setting of 100 “centimeters” that is over 16 million units in +Z!

Would going to 1 unit = 1 Meter? Instead of the default of 100 “centimeters” help?

Limit is 20KM, though remember you don’t necessarily have to actually move up, the world can move and come in/out as needed depending on what your goal is
you could scale down, though note that physics won’t work the same and could potentially have problems

Unreal 4 uses 1 unit = 1 centimeter scheme.

Also, unless I’m mistaken, by default it uses single precision floats. ( Single-precision floating-point format - Wikipedia )

That means 6 decimal digits precision.

So, in general with this kind of scale you shouldn’t have significant precision problems within ±10 km cube from zero coordinates (20km * 20km * 20 km cube).

You can certainly model significantly bigger maps (maximum representable value with single precision is 3.402823 × 10^38 which (in centimeters) is 4 billion times bigger than universe), but in that case you’ll be losing precision as you move away from the center (your object will start to shake).

For HUGE worlds you’ll need to implement your own coordinate systems, where you have coordinates for world “cell” and coordinates within “cell” (which is actually loaded map). Basically, you’ll need to work around floating point rounding errors and move the world around you as you go in order to avoid the issues.