I’m breaking up the game map into chunks to minimize loading times.
But rather than dealing with many cells across a very large space, I’m just moving things around.
The basic gist of it is, anytime the camera tries to go beyond a certain point, the matrix that holds the data for terrain and objects has to “slide” one step in the direction the camera is going. The camera is then sent back to the opposite side of the map. Err… my english might be failing me in the explanation, so here’s a video of what’s going on.
The world loops around. If I add more cells, then it takes longer to get back to the start.
Good thing is, one could create a massive open world and never see a loading screen beyond the one that initializes the world. Problem, and what I want to ask, is even though it is not so obvious from the video the camera doesn’t smoothly snap back into place after the matrix pulls objects in the corresponding direction.
So my math goes something like,
new_position.axis = -(old_position.axis) + (camera_speed.axis + max_distance)
Where max_distance is a float that denotes how far away from the origin of the grid the camera can go. I oversimplified it here but the formula is rough, though it mostly does what I need it to do.
Point of this thread: Any ideas on how to get the camera smoothly across the other side, so that the transition isn’t quite as obvious?