GML Methods of less-stuttery sprite prefetching?

Minerkey

Member
I've been using GMS2 for quite some time now, about 3 years now, and I've been trying to efficiently load sprites. I've gone from questionable methods like just loading every sprite at once with a huge block of sprite_prefetches, to loading each sprite one-by-one but I still seem to run into the issue of stuttering. I know asynchronous sprite prefetching exists but it requires a URL or a file path, but I can't use URLs and I can't use a file path because that requires putting sprites into folders and I'd rather keep all assets within the .data file like normal.

  • Is it possible to implement asynchronous sprite prefetching similar to the non-async method that already exists?
  • Is there some loading system someone's made thats superior that I don't know about?
  • Has someone made an extension that fixes this issue?
  • Is there a way to update, refactor or improve the current sprite prefetching? I heard somewhere that GMS2 will be able to export to current-gen consoles (XSX and PS5) and since its loading is insanely fast, surely they could use this as an opportunity to update the loading system already in GMS2 to improve efficiency, performance or multi-threading?

I guess I'm just annoyed that I've been running into this stuttering issue at every turn and attempting to search up loading systems for GMS2 I just get greeted with tutorials on making progress bars and visual elements, rather than an efficient underlying system for prefetching. Any help would be appreciated, as some of the games I have in development are a bit animation-heavy and leaves me with a lot of frames of animation to load in.
 

TsukaYuriko

☄️
Forum Staff
Moderator
  • Is it possible to implement asynchronous sprite prefetching similar to the non-async method that already exists?
Via extensions, yes. Natively, no, as that would require threading, which is not supported as of writing.

  • Is there some loading system someone's made thats superior that I don't know about?
  • Has someone made an extension that fixes this issue?
You mean this one? It's for 1.x, though, so it may need some adaptation.

  • Is there a way to update, refactor or improve the current sprite prefetching? I heard somewhere that GMS2 will be able to export to current-gen consoles (XSX and PS5) and since its loading is insanely fast, surely they could use this as an opportunity to update the loading system already in GMS2 to improve efficiency, performance or multi-threading?
This is probably best off being filed as a feature suggestion.
 

mr2600

Member
Super bobo, but I got around this but just got around this by putting my big hit assets on a "loading" frame during a transition or whatever. I'm considering using a sequence for this since I don't have to use a container object. That or just put all my sprites in an array and blast them on the to the screen (off screen) in a draw event to force them all into memory.
 
Top