What is it?
If the player moves far enough from origin position [0, 0, 0] then they will start to experience precision problems due to the limited ability of 32-bit floating point numbers to be simultaneously very large and very precise (they can only be one or the other). Precision problems are visible as jittery movement, jumpy shadows, and errors in physics system.
A floating origin setup is one way to minimise this problem by moving everything in the world back towards origin when the player moves far enough away. Daggerfall Unity's streaming world has supported floating origin for years now, but it only worked in the X-Z (horizontal) plane.
This means player can still encounter precision problems if they manage to go high enough. This is currently possible in the mountainous areas and is exacerbated if using a mod (like far terrain) that increases terrain vertical scale. The solution is to upgrade floating origin to support all three axes: X, Y, Z.
Why fix it now?
Besides correcting precision problems in mountainous regions right now, this upgrade unleashes the potential for more vertical play in future. I'm talking potential for deep oceans and floating cities, if that's your kind of thing.
There are already mod creators starting to add custom locations (see Uncanny_Valley's work) which has the potential to be broken by this kind of change. So I feel it's important to get this working before the game is much further developed and the mod scene grows to the point this issue is embedded and unworkable.
I just play the game without any mods - am I affected?
You shouldn't need to do anything. The base game will have all the support required to load save games created prior to floating y upgrade and will save new information after you upgrade. All of your loot and world state will be exactly where you left it. You just won't be able to take your new save games backwards reliably to an older version (which is already the case most of the time). I'll post more details on this before the upgrade drops in Live Builds. And you'll have a test build available well beforehand to check.
I play the game with mods - am I affected?
It's possible that mods created before the floating y upgrade will not function afterwards. Anything that places objects into the world with a fixed height coordinate will need to be made "floating y aware" to continue working. If your favourite mods continue to work, then awesome! Otherwise let the creator know so they can fix it.
I'm a developer or mod creator - what do I need to know?
The gist of things is the Y axis is no longer tied to a static elevation in world. The player can be 10km in the air and still positioned at [0, 0, 0] in scene. So if you need to place something into the world there are a few rules to follow.
- Dungeons - Are instanced separately to exterior world, nothing special to do here.
- Interiors - When placing objects into interiors, please place them relative to the interior parent object (i.e. transform.parent=interiorParent.transform and transform.localPosition=relativePosition). If serializing objects to interiors, you will also need to store local position and possibly some other state to correctly restore. If you are already serializing state for interiors, the deserialization process will need to handle migration of legacy Y positions in addition to saving floating Y aware positions. I've already developed some solutions for this that can be adapted to your work.
- Exteriors - The biggest change is that terrain elevation is no longer equal to Y position and terrain object placement can change as the player levitates up and down, enters and exits buildings, or saves and loads a game. Objects placed to exterior will need to account for StreamingWorld.WorldCompensation to get correct position in scene. And if deserializing to exterior, you need to know the previous and current WorldCompensation values to calculate actual placement. Some of you are probably already familiar with this. The only real difference is now all three axes X, Y, Z need to be observed.
This probably sounds more dramatic than it really is. At the end of the day, we just need to calculate a few new vertical positions. We're talking simple addition and subtraction here, nothing major. And I'm taking care of the base game so everything just keeps working on that front.
Developers and mod creators can test the floating Y branch in progress right now and see how well their mods work. If your mod isn't storing storing objects in the world, or it's already using things like relative coordinates in interiors, then probably very little needs to be changed. And keep in mind this is still a work in progress.
Please use this thread for any questions and I'll do my best to support you all to help get your mods ready. Once I've wrapped up the first pass at floating y support, I'll make a test build available for everyone to check and help find problems before changes are merged to master.