What's the best way to minimize the image memory usage?

0 favourites
  • 2 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • When you display an image (sprite) in your layout for the first time, it preloads and the memory of the images in the layout accumulates.

    So, I have some big sprites in my layout but very few of them can be viewed at the same time.

    I have thought of destroying them when not on-screen and creating them again when visible on-screen, but that will preload them over and over and preloading freezes the game for a fraction of a sec, which makes the game laggy.

    The images in the layout are 60.6mb in total (54mb of these are for the map I have in my game, 1024x1024 each image) in one of my layouts and can get up to 83.1mb once I open some windows or smth..

    That's not that bad, but it's not perfect, I want my game to scroll smoothly on mobile. Is it possible even possible in my case?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The lag of initial sprites loading is a common problem (especially on mobile devices). I made the MM_Preloader plugin to get rid of this lag . The plugin isn't free, yet it's an answer for such issues.

    Destroying the Sprite object does not release its image from the memory. So you can either toggle the visibility of instance of your sprites or create/destroy the instances. In both cases the memory use remains the same.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)