What are some good ways to optimise long game levels?

Godot Version

4.7.1

Question

So i am making the game with a pretty big level, in terms of 3d models. VRAM already is about 2-3 gigabytes when i play thru it. I aint gonna like my assets kinda mostly suck, cuz they are either ai generated or random ahh models from sketchfab. What is the best way(besides from remodelling everything) to optimise this? I mean i know that there is basically no vram overflow limit whatsoever in godot and there is no asset streaming like in unity. Soo, what is the best way? Maybe dynamically load objects when they are needed? Or are there any good plugins out there to solve this? Or in general if u encountered something like this, how did u figure it out?

Split into multiple scenes and load/unload as needed.

You can use ResourseLoader’s load_threaded_request() function to load the assets at run-time. It won’t freeze the game like a typical load() would. With this in mind, you can set up Area3Ds in your scene, and when the player enters those, load the upcoming assets and queue_free() the assets that are far behind.

eh i mean yeah, but i kinda want it to be continious

Thanks! Thats a good idea! Will try that

Define “continuous”. The key is to load stuff in the background (in a thread) so it becomes available just at the time you need it. It’ll make it appear “continuous” to the player.

oh i see what u meant, sorry i misread it. I thought u meant like to split a level in different scenes and change between them. Now i see that u said what other guy said, and i mean i kinda know that, i was just wondering whats the best way to do it. Thanks

Apologies in advance, I’m pretty tired so may not be fully coherent.

There’s not really a “best way” to handle culling, it will come down to your project, your intended system requirements, and your preferences.

In all instances, using load_threaded_request() like what Vachivenza suggested will likely be the best option for loading stuff in. However, if you’re deleting and loading parts of levels, you may run into persistence issues. As in, things your player done to affect the level (killing enemies, for example) will be reset every time they’re deleted then reloaded if you don’t factor that into your system.

I recommend you try occlusion culling first as this only unloads the textures and shouldn’t cause persistence issues. There’s a tutorial for occlusion culling here: Occlusion culling — Godot Engine (stable) documentation in English

If that doesn’t work for you, then the scene/area unloading methods that have been suggested by others should work well. Those methods remove more from memory than occlusion culling would. If you’re unloading/reloading scenes wholesale I recommend looking into persistence keys if you haven’t done so already. It’s a technique where you save some information about how your player has changed the scene, so things like enemies and pickups don’t reset if the player backtracks.

Occlusion culling doesn’t remove anything from memory. It just potentially renders less geometry. It’s used to optimizes performance, not to save storage space.