Download

Is World Origin Rebasing working?

Hi, I am using World Composition and enabled World Origin Rebasing in World Settings. My world is close to 64kmx64km with 16 tiles. Since I enabled origin rebasing, the engine goes with tons of logs like the following:



LogLevel: WORLD TRANSLATION BEGIN {-397825058, 1352878516, 0} -> {-387412943, 1366202854, 0}
LogLevel: WORLD TRANSLATION END {-387412943, 1366202854, 0} took 0.0589 ms
LogLevel: WORLD TRANSLATION BEGIN {-387412943, 1366202854, 0} -> {-377000828, 1379527192, 0}
LogLevel: WORLD TRANSLATION END {-377000828, 1379527192, 0} took 0.0841 ms
LogLevel: WORLD TRANSLATION BEGIN {-377000828, 1379527192, 0} -> {-366588713, 1392851530, 0}
LogLevel: WORLD TRANSLATION END {-366588713, 1392851530, 0} took 0.0913 ms
LogLevel: WORLD TRANSLATION BEGIN {-366588713, 1392851530, 0} -> {-356176598, 1406175868, 0}
LogLevel: WORLD TRANSLATION END {-356176598, 1406175868, 0} took 0.0721 ms
LogLevel: WORLD TRANSLATION BEGIN {-356176598, 1406175868, 0} -> {-345764483, 1419500206, 0}
LogLevel: WORLD TRANSLATION END {-345764483, 1419500206, 0} took 0.1010 ms
LogLevel: WORLD TRANSLATION BEGIN {-345764483, 1419500206, 0} -> {-335352368, 1432824544, 0}
LogLevel: WORLD TRANSLATION END {-335352368, 1432824544, 0} took 0.0730 ms
LogLevel: WORLD TRANSLATION BEGIN {-335352368, 1432824544, 0} -> {-324940253, 1446148882, 0}
LogLevel: WORLD TRANSLATION END {-324940253, 1446148882, 0} took 0.0631 ms
LogLevel: WORLD TRANSLATION BEGIN {-324940253, 1446148882, 0} -> {-314528138, 1459473220, 0}
LogLevel: WORLD TRANSLATION END {-314528138, 1459473220, 0} took 0.0769 ms


And this is taking an enormous amount of time, I didn’t even let it finish, it was still not complete after several minutes. I do not have lots of actors into the world, it is mostly empty. Is this a bug? I am using 4.18.2.

Update: I looked at the code and rebasing is occuring on UWorld::Tick() upon the following condition:



    if (OriginLocation != RequestedOriginLocation)
    {
        SetNewWorldOrigin(RequestedOriginLocation);
    }


Problem is that RequestedOriginLocation is constantly changing, so it never ends…

Looking further into it, here is what is happening:
UWorld::Tick() is calling UpdateStreamingState() itself calling EvaluateWorldOriginLocation(ViewLocation), this leading to calling RequestNewWorldOrigin() with a new value, hence the constant recalculation of world origin. ViewLocation is not changing value though, so this is the following code into UWorldComposition::EvaluateWorldOriginLocation which is causing the constant rebasing:



    // Request to shift world in case current view is quite far from current origin
    if (Location.SizeSquared() > FMath::Square(RebaseOriginDistance))
    {
        OwningWorld->RequestNewWorldOrigin(FIntVector(Location.X, Location.Y, Location.Z) + OwningWorld->OriginLocation);
    }