Hello, to start off I am making an infinite runner game and the infinite terrain is a landscape. This landscape has been painted and painted with foliage. Now, since I’m making an infinite runner I know how to generate obstacles and stuff. My landscape is made in such a way that it could loop. So basically, I am using blueprints and I need to be able to duplicate and generate the landscape over and over again in front of the player. Does anybody know anything, that would help get me started?
For something like an infinite runner, I would take a look into “Object Pooling”, unfortunately I wasn’t able to find any amazing blueprint tutorials for pooling - but it’s a pretty simple concept.
Rather than continually duplicating your landscape (assuming when you talk of the landscape you mean the environment the player will run on), you can instead create enough terrain chunks to fill up the screen ( plus a couple extra) and re-use them in front once they are off screen.
This Tutorial shows some object pooling with bullets.
The trick would be keeping track of what is in front of the player, and what they have passed is both off screen and no longer needed. If the terrain is properly separated into chunks, you could potentially detect when a chunk is activated ( stepped on by the player or something similar ), which would tell you where the player is in the list of environment chunks. From there you could move the “oldest” chunk in the list to the front.
I know object pooling very well, I’m just confused on how I can actually create more of the landscape and reference the chunks in my code.
EDIT: Also the “LandscapeStreamingProxy” I assume is what you are calling the chunks, their position is not editable in the Details Panel.
Does anybody know if there is a way maybe I could save the landscape as a blueprint or export it saving all of the painted textures and foliage? Doing this would solve the problem.
Sorry, I’ve not done any environment work in Unreal, so I wasn’t aware that when you said landscape it was an actual component.
All good.