When I was just starting to learn Playcanvas and gamedev in general, I didn’t know how to handle infinite scrolling, so I implemented my game in a way that the camera and the floor are actually static, while everything else moves out of view. This works, but makes it hard to add new content, e.g. I cannot place a static decoration, because I would need to move it as well. That closes the door for baked lights and other optimizations for me.
First, I thought, perhaps a stupidly large plane could do the trick. But I immediately rejected that, since I don’t know how to handle it later, when I add textures or shaders to it. Plus, it doesn’t feel elegant or fail proof.
Another way, which I am currently more keen to, is to probably have a few fixed size planes, and then spawn a neighbor plane next to it, as the view gets closer to the edge of one of them. Once the old plane is out of the view, I can return it to the pool.
Elaborating on that method further. My game currently restricts the directions the game can “crawl” to. The isometric view can move either (abs) X or Y (kind of towards top left and right corners of the screen), randomly chosen. To easier visualize it, think of a chess board infront of you, turn it 45 degrees, so its a shape of rhombus. Now place a chess piece at the closest cell to you, at the bottom corner of the rhombus and start progressing the chess piece up the rhombus, one random cell at a time.
This way, I could, for example, spawn a fixed amount of cells (planes) around the player, so no matter which direction it goes, it will be able to move infinitely. However, I don’t know how to handle the view frustum on different devices. How many of cells would I need to spawn to make sure they cover the frustum on all resolutions? Or, I could probably, make them pretty large, so even one would cover the whole view, and I simply spawn another 3 (top-left, top, top-right) or even 5 (extra 2 for left and right) to make sure the player will not see an edge of the cell, if he randomly ended up constantly moving only in 1 direction.
I’m pretty sure this is not a unique problem in game design, but simply my inexperience in it to know the common approach. Please, advice.