Using Atlas without long wait times between scenes

Galdon2004

  • *
  • Posts: 313
Hey everyone,

So, some of my projects are starting to get sort of "up there" in memory usage, and are starting to demand enough RAM that it is causing images to fail to load; or at least from my research this is what causes the issue of black boxes appearing in place of actors.

I tried splitting my files into different atlases to help reduce how much needs to be loaded at once; but this seems to have had the effect of adding long waiting times between screen transitions when switching to a scene using a different atlas.  I am wondering if there are any "best practices" tips for atlases that are not mentioned in the stencylpedia, or other tricks that I can use to reduce RAM usage while minimizing load times between scenes.

Any advice would be useful, as I want my projects to be accessible on as many systems as possible, and not just particularly high end PCs. xD

merrak

  • *
  • Posts: 2726
Stencyl (or any game engine, really) provides a "one size fits all" approach to memory management, but it isn't optimized for any particular kind of game. At some point you might have to take more control of asset loading/unloading to see any gains in speed.

For example, suppose you have a platformer and a player moving right. You can load images used only in the next screen as the player moves through a certain point--thus, smoothing out the loading. Note--If you load and unload assets too frequently, you'll start to run into the "opposite" problem: too much garbage collection activity. Also, the additional complexity of the programming might even give you worse performance, or be too bulky to manage.

I think a better place to start would be to make sure you've configured your atlases as efficiently as possible.

I don't know the answer to this question, but I think it'd be worth exploring: how much of the load time is spent processing images? All of the images are stored as .png files, which have to be decompressed. Would replacing the .png files that Stencyl generates with files saved with less compression improve load times? If you have ImageMagick, you could run a batch recompression on all of the .png files. This would increase the file size of course, but disk storage on PCs is cheap so it may be a worthwhile trade-off (assuming this "experiment" works at all, that is)