Download

How to Avoid Endless Runner to Reach the World Limit?

Hello all!:smiley:

I am working on an endless runner game based on this tutorial series: [https://www.youtube.com/watch?v=yS-yQfo0lc0&list=PLZlv_N0_O1gbY4FN8pZuEPVC9PzQThNn1&index=1](Endless Runner Tutorial Series)
But I think with the “method” of generating tiles one after another the game could/would reach the limit world size (1048575.0 from the world origin (0,0,0)), so according to this how can avoid reaching the world limit?

I have thought to move tiles towards the player and give the effect that the player is moving and the world is endless, but, in reality the player is just standing still (or at least moving in a small local space) and everything is moving towards the player. Does someone have any idea on how to do this?

Or just at some point recreate the generated world at the world origin and teleport the player back.

ultimate solution is:

You make the world run around runner, not runner run in the world.

Or: make coordinate system around player, not player coordinate in the world.

But easier solution is:
coordinate can be up to full long int number, last time i checked it was about as far as orbit of Pluto (counted in 1 unit = 1 cm). Granted there are several funny glitches when you get too far (like physics acting weird etc)
But i think you can do some warping code when player gets outside bonds.

personally after running 6.5 miles or 10.48 km, I would hope the game would end because I’d be very tired of running, endless or not. (using the 1048575.0 cm from your post)

I think this situation would take care of itself. Presuming you ran straight & didn’t turn.
And if it was straight then you could start at -1048575.0 & make the poor old player run twice as far: 13 miles or 20.96 km

so just make it win, fail, or go on to the next level.
(assuming you don’t eventually make it turn around in some way)

Easiest is to circle around so you never get too far away from the center.
Slightly harder is to walk through every actor in the level, and offset them by a fixed amount towards the center (turn on teleport, turn off sweep)
Hardest is to keep the runner in place and move the geometry, because moving all the geometry every tick will be cumbersome.