- Edited
POST-MORTEM
if you're looking for useful caching information, there's something in this xyz answer.
if you're looking for my real problem, it's unrelated to caching. a @preload
variable cached a scene when a certain node was readied, causing the bizarre caching behavior. i was unaware of this variable.
test in a dedicated, minimal environment to reduce variables.
share knowledge, don't be greedy
science 101
past this point is a quickly modified rendition of the question. it's been edited for education's sake.
the unedited post was written in a haze of caffeine withdrawal and sinus headaches, so you're welcome.
REASON I'M POSTING HERE
none of the results below makes sense to me, nor is any of it expected, which means i clearly don't have a clue how caching works, and that bothers me.
i'm asking smart people to shed light, or offer advice to debug this better if "debug" is the right word. feel free to rip into this formatting too. i promise i never aced an essay in my life for a good reason.
SCENE TREE DETAILS HERE
There is a 'Mother' node that's handling the loading of child nodes.
It loads child nodes into the SubViewport
node pictured below using ResourceLoader.load_threaded_request()
.
ResourceLoader.load_threaded_get_status()
is used to make sure it doesn't break while loading. It's also used to draw a loading animation in the Label
under the LoadScreeen
node, and then to call $SubViewport.add_child(ChildScene)
once it returns that the loading has finished.
note: Control nodes and Node3Ds pictured above are absent during testing. they are shown here to make very clear where nodes are being added during runtime.
PROCEDURE HERE
Trial A: Scene1 loads in automatically
On launch, it loads Scene1
featuring a very vertex heavy icosphere mesh imported as a .glb from Blender. It's instanced to Scene1
and made local.
Result:
Scene1
takes a while to load in.
Trial B: Scene1 loses mesh, Scene2 is introduced with the same(different instance) mesh
The mesh is removed from Scene1
, and added to Scene2
, made local, and MainMenu
is introduced by Scene1
that will signal to Mother
that it should Scene1.queue_free()
and load Scene2
in its place, only when the player(me) hits the right(directional) arrow key.
Result:
Scene1
takes just as long to load, but Scene2
is instant. The mesh is totally absent from Scene1
.
Trial C: Scene1 and Scene2 do not have the mesh, Scene3 gains mesh but never appears during runtime
I made a Scene3
that never enters the scenetree at any point. It exists inaccessible to the player during runtime. The mesh is removed from Scene2
, added to Scene3
and made local.
Result:
same as Trial B.
ResourceLoader.load_threaded_request() called with ResourceLoader.CACHE_MODE_IGNORE results in all scenes taking a long time to load. because nothing is cached. i think.