How to make a very long level (on railsesque)

So what’s the most efficient way to go about creating levels that are long like in StarFox, Panzer Dragoon or the last Halo 1 level?
Surely all the assets aren’t loaded. Are there any example projects or anything for how to accomplish long vehicle levels?

Ive never used this feature, but i think you are looking for the Level Streaming feature in UE4

description of the feature from the documentation:
“The Level Streaming feature makes it possible to load and unload map files into memory as well as toggle their visibility during play. This makes it possible to have worlds broken up into smaller chunks so that only the relevant parts of the world are taking up resources and being rendered at any point. If done properly, this allows for the creation of very large, seamless games that can make the player feel as if they are playing within a world that dwarfs them in size.”

Disclaimer: Haven’t actually tried this, just making an educated guess based on a few minutes of utilizing my google-fu.

You can place objects 10 kilometers away from the origin in any direction, so effectively you have a 20 kilometer world. This means that to make these levels all you have to do is just make them, none of the examples you’ve shown come even close to being 20 kilometers long.

One thing you might want to consider is rebasing the coordinate system onto the player every so often. That will ensure you don’t get any floating point errors. However, I haven’t tried manual rebasing without world composition turned off so I am not 100% certain that it works. If you test it out do report back.

As for asset loading - there really aren’t that many unique assets in a level such as that, so it’s not really a memory concern. You just hide them when they’re far away (again, I am not sure, but I think you can have a movable occlusion volume attached to your player, alternatively just do the hiding logic in your game code).

Adding on to this, this is exactly what I’m planning on doing with my racing game, I made one large race map section with full detail, and simply copied it several times and made them seamless. Then I’m using level streaming to remove maps that the player has already passed, and remove maps that are ahead that the player cant even see yet to drastically reduce lag and make it appear endless.

What happens at 20km? I have some levels in space that seem larger than 20km, they still run just fine because 99% of the map is just empty area. Is there a hardcap on map size?

Level streaming loads and unloads sub-levels.