UE4 Implementation of Origin Shifting Makes No Sense

Hi,

I’ve been slogging through the engine source, trying to figure out how origin shifting is done. I think I get what it’s doing but it doesn’t make sense why. I’m hoping I missed something.

(Please note, when I say ‘object’, I mean a actor/component/etc with a location in the world.)

I thought the whole point of origin shifting was to make the object location smaller in magnitude so there was more room for precision. In the UE4 source, all I see is the origin shift being added to the location. That doesn’t seem right to me. You’ll be making the locations larger in magnitude and losing precision.

For example, with world tiling, the tile origin should be subtracted from the location of each of the objects that reside on that tile. Then their coordinates will all be relatively small and they will have the bits to handle small movements. When you need to translate coordinates between two objects on different tiles, you just have to subtract the tile A’s origin from tile B’s origin and then add that to the object B’s location. Then you have object B’s location relative to tile A’s origin (and in object A’s coordinate frame).

I would think that could get you much bigger worlds than you can get with the current implementation. And this is all before I even touch on how its been implemented for multiplayer. There’s an easy way to get much larger multiplayer worlds, too, if it was done a bit differently. In fact, you could have a multiplayer world just as big as you could get with a standalone game world.

But I have to consider I am missing something, so please, let’s discuss.

Thanks,

I refused to believe that Epic would do it the way I was reading into the code, so I kept digging through the source. I see now that the offset part is just adjusting the local position so it remains relative to the new world position.

I’ve also come to realize that the primary goal was not to implement world offsets to its maximum potential but rather to maintain backwards-compatibility. I can respect that.

So I stand self-corrected. It would have been less painful with some responses but oh well, this is the Unreal forums after all…

Hey!

What I’m thinking there begins with one of two options. Either the clients update the server when their world origins change or the server and clients use the same algorithm to figure out the world origin so they are synchronized. Then the server can use the client’s world position and do the translation before the positions are sent. That way you avoid the rebasing to the “zero origin” in the current MP implementation.

I think it should work but it means changing the engine source and besides being a pain the first time, it would have to be added to every engine update (unless it was officially adopted).

Cheers,