I think storing my player’s position in a view matrix may have been a mistake. This happens at around x/y 16 million. #gamedev

@exoplanetary Just use doubles instead of floats! 😉

Matrices are just prone to this kind of imprecision at large distances. IMO for a chunked-voxel game storing the positions of things as hierarchical (eg: integer chunk position/index & floating point position relative to the chunk origin). It could also help speed up things like physics, too; you can easily determine which chunks you need to check collisions with for both the terrain and other entities.

@brycedixon Yep, that's the planned fix. I'm thinking I'll probably try and keep the player at (0,0,0) and move the chunks around based on that instead - that way the vertices won't get particularly wacky from the view matrix.
@exoplanetary Well, technically that's kinda what's happening, no? Either way, you're multiplying all the vertices to draw by a matrix to get them within a cube from (0,0,0) to (1,1,1); it's just a matter of conceptualizing "does the player move around the world or world around the player."