Shoot me down: A workaround for large distances (alternative to 64-bit precision)

This takes a lot of assumptions, but I have seen quite a few people ask about it myself. I’ve come up with a “hybrid” work around, but don’t have the time or equipment to test it at the immediate moment.

So, given a large area of space, eg a solar system, Unity runs into floating point precision calculation issues. Existing Solutions:

  • Double precision converted back to float for unity transforms
  • A series of grids with sub-coordinate system
  • Moving the universe around you (Futurama method)

My proposed solution (The jumpy treadmill solution):

Take unity’s “precise” area of about 10000x10000x10000, upon the player reaching one side, jump coordinates of all environmental/player objects to place them around the origin again. This removes the need to call a transform change on every single game object every frame, but may cause issues with movement and physics (would appreciate feedback here).

Additional considerations:

With a large system, there is little point in carrying out physics operations on objects that are far away, so culling the invisibly small objects would reduce the cost of calculations when hitting a triggering border at the edge of precise space.
The solution here would be to record the state of the game object as soon as it is culled and delete the game object, and restore it when it’s at it’s lowest LOD.

I’m not exactly experienced, so I would appreciate it if someone could start poking holes in my idea. If all looks good I may attempt an implementation.

While I haven’t built a game using this idea, I’ve suggested this as a good solution to the issue. When the player reaches 10k in any direction, just teleport the player back to 0,0,0 and move everything in the world by the same amount. This teleportation won’t happen frequently so shouldn’t be a significant impact to the game.

The only issue that I don’t know the best work around for is when combined with standard out of the box networking solutions. Generally these have a server running the simulation that is authoritative over most of the game world and the location in the game world of each object is important.

Exactly what are the issues that occur beyond that 10k point? not sure what floating point precision is

You might not notice the issues right away at that distance, but if you go even further you’ll see some interesting visual artifacts like parts of let say a space ship are moving in strange ways. The further you go the worse it gets.