You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm creating an RPG game where i expect to have scenes with a very high node count.
Thanks in advance for the dedicated time reading this proposal.
Describe the problem or limitation you are having in your project
I was trying to get proper loading of big scenes without holding the main thread rendering process.
I have made some tests about the topic using a scene with ~1000000 Node and they revealed that loading the resource (using load or ResourceLoader functions) is almost instant, while instancing the packed scene take all the required time.
I suppose using "real nodes" with actual data (like textures) could behave differently, but still, a big portion of the load time is used for instancing the scene.
So the feature i would like to ask it to have a way to get progresses as the instancing function keep going, so that it would be possible to make informative loading screens.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
A way to implement such feature would be to introduce a new "async" version of the same PackedScene.instantiate and, taking inspiration from ResourceLoader.load_threaded methods, creating 3 new functions:
The only difference would be that they do not require a "path" like the ResourceLoader counterpart functions, but the PackedScene object address would be used to get the associated loading thread.
(obviously the functions are just a draft, just to give the idea)
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
It would work the same as ResourceLoader.load_threaded methods:
var packed_scene: PackedScene
packed_scene.instantiate_threaded_request()
var timer = Timer.new()
timer.autostart = true
self.add_child(timer)
var timeout_callback = func():
var progress = []
if packed_scene.instantiate_threaded_get_status(progress) == THREAD_LOAD_LOADED:
var instantiated_node = packed_scene.instantiate_threaded_get()
# Running some callback and pass the instantiated node to some other system
print(progress[0])
timer.timeout.connect(timeout_callback)
It is just a draft (and inelegant) code, but it should give the idea of the result.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I think it would be possible to instantiate nodes in a packed scene one by one and rebuild the scene tree structure, but not using few lines of code.
Is there a reason why this should be core and not an add-on in the asset library?
Loading resources is part of the core features of the engine,
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
I'm creating an RPG game where i expect to have scenes with a very high node count.
Thanks in advance for the dedicated time reading this proposal.
Describe the problem or limitation you are having in your project
I was trying to get proper loading of big scenes without holding the main thread rendering process.
I have made some tests about the topic using a scene with ~1000000
Node
and they revealed that loading the resource (usingload
orResourceLoader
functions) is almost instant, while instancing the packed scene take all the required time.I suppose using "real nodes" with actual data (like textures) could behave differently, but still, a big portion of the load time is used for instancing the scene.
So the feature i would like to ask it to have a way to get progresses as the instancing function keep going, so that it would be possible to make informative loading screens.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
A way to implement such feature would be to introduce a new "async" version of the same
PackedScene.instantiate
and, taking inspiration fromResourceLoader.load_threaded
methods, creating 3 new functions:PackedScene.instantiate_threaded_get()->Node
PackedScene.instantiate_threaded_get_status(progress: Array = [])->ThreadLoadStatus
PackedScene.instantiate_threaded_request(use_sub_threads: bool = false)->Error
The only difference would be that they do not require a "path" like the
ResourceLoader
counterpart functions, but thePackedScene
object address would be used to get the associated loading thread.(obviously the functions are just a draft, just to give the idea)
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
It would work the same as
ResourceLoader.load_threaded
methods:It is just a draft (and inelegant) code, but it should give the idea of the result.
If this enhancement will not be used often, can it be worked around with a few lines of script?
I think it would be possible to instantiate nodes in a packed scene one by one and rebuild the scene tree structure, but not using few lines of code.
Is there a reason why this should be core and not an add-on in the asset library?
Loading resources is part of the core features of the engine,
The text was updated successfully, but these errors were encountered: