I created some blueprints to get the world location of my mouse. An actor follow my cursor on my terrain. No problem so far.
But, I’m in trouble! The world location seems to be inaccurate: at the center of the world, locations are very precise, to the nearest comma. But near bounds, the precision is very weak!
This is a representation of my sensation of “grid” with the trace:
I tried to trace cursor in a blank project, without starter content, and the problem is the same
I also tried to use directly a “Get Hit Result under Cursor by Channel” instead of Convert+Trace. The result is exactly the same.
This is a float precision error. No double precision float in blueprints. Yet.
In UE4, after around 500000 units, you will start noticing inaccuracy. It is not engine specific, really. That’s why you do not have big worlds in games. Not as is. Things are often faked. In UE4 you can shift world origin, so the location at X: -1,250,500.0 | Y: 2,000,000.0 becomes 0,0 and you calculate things from there on.
You should also consider dividing your world into smaller chunks and take advantage of level streaming and world composition:
Oh ok! I see. I suspected this was a problem about the size, but not about double precision!
Thank you for your explanations, and for the link to Computerphile channel on youtube!