So, I’m working on an endless runner that takes place in 3D with the camera behind the player (Think subway surfers with some swinging physics mechanics instead of three lanes) and this issue has been plaguing me pretty much since I started.
As the player moves “forward” the map is actually moving towards them while the player sits still. The floor is made of of large tiles lined up end to end. When one tile gets far enough behind the player and out of camera, it’s moved far into the distance and begins its journey all over again. Each piece should line up right against the back edge of the next piece in front of it, and usually, it does
The problem is that sometimes I get gaps between the tiles, and as the game has become more detailed, they’ve become harder to hide. It’s not every tile, and it never seems to be the same tile every time. So it’s not like it’s ever 3, 4, here’s the gap, 5 every cycle. Sometimes it’s dozens of tiles apart, sometimes it happens back to back. It happens whether I’m using the physics system to apply a force to make the object move, or doing it pixel by pixel, doing the math to put it exactly where I want it, never a half pixel off or anything because of remainders.
What do you think? Am I running up against the limitations of the engine on cheap hardware, and this is just the result of stutters and staggers at the wrong time? These tiles shouldn’t be landing on odd fractions of pixels that create a gap, but I’m open to suggestions if you think that’s the problem. The only solution I’ve come up with that I haven’t tried yet is using the same external layout system I use to spawn in the layouts of obstacles/powerups etc. Mostly because it’s the same every time, tile 1 followed by tile 2, by tile 3 etc, and because if it is just a framerate/sync issue, I’d imagine this issue repeats.