rdInst Tutorial 51 – Support in Very Large Worlds
Last Updated: 1st October 2024
Tutorial created using rdInst version 1.50
Now that the Unreal Engine supports extreme sizes of levels – using a singleton instance manager located at 0,0,0 can start to exhibit rounding issues when the instance is over 40 kilometers away – they can jitter and shimmer – the further away the worse it is. (somewhere between 40km and 50km they start exhibiting from what I can tell)
To solve this issue a new function has been added that can shift the manager and re-seat all current instances. It’s also possible to rotate the manager if needed to support some 3rd party platforms.
This tutorial is a simple test with 2 floors spaced apart from each other by 100 kilometers – the first is centered at 0,0,0 and the second at 10000000,0,0. Some instances are placed on each floor to exhibit the long-distance-jitter.
Step 1. Create a new level based on the Basic template and duplicate the floor.
Start by creating a Basic level.
Now Duplicate the floor, and change the X value of its location to 10000000.
Step 2. Create simple Prefab with a mesh
Now create a new Blueprint Subclassed from rdActor.
Open the new BP in the Editor and in the details panel, tick the “Create from Array”s option. Add a new element to the InstanceFastArray and select a Mesh. Then just add one transform, leaving it as the default at 0,0,0.
Step 3. Add a new Function to the Prefab
Now add a new function (tick “Call in Editor”), call it something like “Reseat”. Add the code below.
Step 4. Enable “WorldSpace Instancing” in the rdInstSettings
Now select the rdInstSettings actor in the outliner and tick the “Worldspace Instancing” in the details panel. This is slightly slower than relative as each instance needs to calculate it’s relative position from the worldspace ones, but is needed when moving your rdInstBase actor around (unless you’re adding instances relative to your location).
Step 5. Add a Prefab to each Floor
The last thing to do is add the prefabs to the level. Add one on each of the floors (tip: double click on the floor in the outliner to focus the camera on it).
Step 6. Done
Now move to the instance exhibiting the jitter (no need to play) – select it and click the “Reseat” button in the details panel to fix the jitter.