godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.22k stars 20.23k forks source link

Subscenes are loaded as a single resource using interactive loader #32115

Closed Tugsav closed 4 years ago

Tugsav commented 5 years ago

Tested on Godot_v3.1.1-stable x11 64 bit Ubuntu 18.04.3 LTS

When using the interactive loader to load a scene, any subscenes will apparently be regarded as a single stage. Thus the poll() method will block until the entire subscene is loaded. This can result in lags when background loading a scene with large subscenes We expected the loading of the subscene to be divided into individual stages for each resource.

Example project In this example project a scene (MainScene1.tscn) is loaded which includes a subnode with 3 different sprites When played the time in ms for each poll call is printed to the console To reproduce the bug change the loaded scene (exported as a path to a file in Loader.tscn) to the 2nd main scene (MainScene2.tscn) and run again. In this scene the subnode has been saved as a seperate scene file. You should notice less polls, with 1 of them being roughly equal in duration to the entire load time of the 3 textures added together

KoBeWi commented 4 years ago

No longer relevant for 4.0, as there's new threaded loading.