#Loading Assets Forever

18 messages · Page 1 of 1 (latest)

wise totem
#

i've got a custom asset loading system, using events; i wait until everything is loaded before spawning in the entire map.

the problem is, assets never load. its a bit difficult to show off my code concisely, but i'm essentially loading the handles into a resource where they stay until a level is loaded that no longer depends on them.

  • the handle is not being dropped; the whole point of the resource is keeping handles around until they should be dropped.
  • yes the resource actually exists
  • and its not empty
  • i am not calling .load() every frame, it is only called on the first event (and followup events to check the load state use server.is_loaded_with_dependencies())
  • when i used the function above, i get 'Loading' state forever.
  • i know the paths are right, because i get errors when i fuck it up, and i haven't fucked it up. these meshes also loaded fine when i was manually loading shit outside of the loading system.
  • please do not try to explain to me that i should be using a plugin or doing something else, my asset loading system otherwise functions fine
  • using bevy 0.14.2 with default plugins, multithreaded on, etc in a FixedUpdate system

is there some kind of problem with handles getting dropped if you stick them in a resource immediately instead of using them? i have no idea what the problem is here.

im saving them as Handle<Mesh>, and calling them as server.load("path.gltf#Mesh0"), if that helps.

deft kernel
#

do you have a system to start the loading and one system to wait, or are you doing it on one single system?

#

if the handle were being dropped the is_loaded_with_dependencies method would return None i believe

wise totem
#

basically i have these events that one system reads & writes itself (with the very first event being sent in from somewhere else)

#

and then at the end of the system it sends this to itself next frame

#

as far as i understand, the system is working Fine. i put printlns at every stage, and it never reaches LevelFinishedLoading because it never loads. when i remove the loadcheck, it does get there just fine, and only once, etc

#

its also fine receiving more than one of the same event though it might be redundant. if it gets events with different levels to load it will explode but thats not happening here lol

#

& im using drain() and everything, though i'd notice if it were repeating the start event because of the printlns anyway

deft kernel
#

are you locking the scheduler by doing an infinite loop on you wait system? the asset server only advances in between frames

wise totem
#

i dont think so, it sends the event at the end of the system and checks them the start which should be the next frame

#

there are other systems in update but this is failing just after startup so nothing is actually loaded

warped crater
#

The easies explanation is that you either droping and restarting it every frame or that you have froze bevy with your own loop when checking status. If you are sure neither of those is correct we will probably need to see the code to help any further.
Could you check if your loading system work for something other than a mesh? for example just a regular .png image?

wise totem
#

what i think is happening is i've tried to load meshes instead of scenes and thats whats fucking up

#

despite it not throwing errors

#

i do not understand this mesh loading shit well enough

#

...yeah it loads fine when i make it all scenes

#

whoops! oh well

deft kernel
#

#Mesh0 type is GltfMesh, not Mesh