- Home /
The question is answered, right answer was accepted
[SOLVED] Huge terrains: how about player's coordinates precision?
Salut!
I browsed several discussions about huge terrains (mine idea is an aviasim, e.g. 5000x5000km), and found out that:
It is recommended to create a tiled land of several terrains, while activating only these tiles where the player is present.
That's okay, so far (boring, but surmountable).
But terrain tiles cannot be farther than 100km from the Centre of the World. Because float numeric precision will surely destroy game physics/mechanics thus far.
How can I develop a flight simulator when I it is not recommended to fly farther than 100km?
Should I teleport player to 0.0.0 every time he approaches a next country (i'm afraid the app would freeze while reloading lands)?
Or scale aircrafts down to 1:10000000000 (i'suppose that physx will be distorted beyond reasonable affairs)?
Or What?
Thank you!
You could also consider keeping the plane at 0 and moving the terrain.
You mean I should rotate terrain over my head when doing a barrel roll? :D
It is impossible. Terrain would not rotate.
$$anonymous$$ore efficient to rotate the camera ins$$anonymous$$d of the terrain. But it is possible to rotate the terrain completely around your plane if it is required. Very little is impossible in program$$anonymous$$g.
Please post another question if you require assistance on world rotation. :)
Duly noted. But no one says you have to make terrain out of terrain. I'm way off topic now so I'll drop out.
Answer by karljj1 · Jun 21, 2014 at 07:49 AM
Its called a floating origin. Search the forums, there have been plenty of discussions on it.
Ouch... It hurts. :-)
Ins$$anonymous$$d of Unity3D to migrate to double precision coordinates, I must create my own precise physics from scratch and translate rounded values to Unity3D's floating origin... Besides, I must voodoo on the server side to provide floating origins for every one of multiple players!
$$anonymous$$aximal integer could be stored in float is 16'777'216, and with physics precision down to millimetres it means that maximal flight range is 16 kilometres. It means I can stuck to world limits even running afoot!
With Unity3D double in math (with 9'007'199'254'740'992 max int), one could simply and transparently allow to fly 9 milliards kilometres away with no problems.
What a nasty move from Unity3D. :(
However, floating origin is an answer meanwhile. $$anonymous$$eanwhile I pray Unity3D will migrate to normal physics before I finish beta version.
Thank you very much! :-)
It is recommended to create a tiled land of several terrains, while activating only these tiles where the player is present.
Additive loading. Stitch your terrains together this way and the effect is the same as infinite terrain.
Follow this Question
Related Questions
Why cant I do this? Incorrect number of values(terrain and array related). 1 Answer
Random Float Variable 2 Answers
Make a simple tree 1 Answer
Keep height at edge TerrainToolkit 0 Answers
[Closed] Cannot convert types? 2 Answers