Marching-Cubes-Terrain
Marching-Cubes-Terrain copied to clipboard
Player far from origin jitter issue
I stumbled into an issue. I was testing out a project and I noticed that when the player goes really far from the origin (0,0,0) position, like hundred of thousands units away, everything starts to jitter. So much that the game is basically unplayable.. How do you fix that? Do you move the world instead of the player? Wouldn't that be really bad for performance?
I know this is not really the project issue, but more of a feature, but feel like something that the infinite procedural terrain should avoid. 🤷
This is because of an Integer limit, and this happens in Minecraft too, when you reach 32,000,000 blocks aka the 32-bit signed Integer limit. 64 bit 32 bit 16 bit 8 bit
@BlackStarMachine This problem is more related to game logic than terrain generation. You can search for "Floating Point Error" on this topic. The simplest solution for this problem is to move your player back to the origin point after a certain limit and continue your terrain generation with that offset.