Here’s it done on a very small scale, skip to 4:30 if my link doesn’t go to that time. Basically you just need the environment to repeat over and over again, which is pretty simple to do, just duplicate the scene so it repeats, you can also teleport the player seamlessly back to any place the scene tiles so you don’t have to duplicate the scene hundreds of times, or to make it seem like they walked forever but never went anywhere. Tricks like this are also done in Antichamber to create impossible situations like never ending staircases that you can go up or down, hallways that should self intersect but don’t, a doughnut shaped room that’s starting location looks different every time you complete a lap, etc. You could also tile the scene in multiple directions, depending on your exact goals and needs.