How do I minimize memory usage for cutscene images

0 favourites
  • 6 posts
From the Asset Store
500 monsters and creatures images for card games - Set 1
  • I'm making a game with a series of full HD cutscene-images (20-30) , meant to be displayed full screen to support the story.

    I'm thinking to switch layout when displaying each image, and switch back to main layout when done, to avoid wasting memory. However wouldn't this cause the system to reload the initial main layout objects into memory? In my game that would result in a 100-200 Mb memory reload everytime I go back to the main layout. As I see it, the optimal way would be to load and unload an object from memory. But it is my understanding this is not possible, and memory is only freed when switching layout.

    Please enlighten me



  • If you are creating this for mobiles:

    Try to reduce the overlapping area between them and never ever use large images. If you have a big object in the background, cut it into smaller images. Also crop all your images. The transparent/empty area counts as part of the image so it will use memory and cpu.

    If you are creating this for desktop:

    The same tips but you don't need to cut it too much I guess. And even if you didn't do all of this, your game should run easy in any desktop. 200mb of memory usage is nothing in a desktop.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • But as I mentioned, I'm talking full screen HD cutscene images. I don't see how that has anything to do with what you mention, though it is solid guidelines for development.

  • But I see. I don't know if you are those people that have no clue and who try to use a single/multiply full hd image on a mobile. I was one of them before reading all the Ashley's tutorials. Anyways, it has everything to do with what you mentioned. What increase memory usage on a mobile is the same on a desktop. Cutscene images are no different from a normal gameplay, with a full hd images or not. The same principles are aplied.

  • My questions was actually a little deeper. I was pondering how to avoid reloading into memory everytime I switch layout, when I choose to switch layout for cutscenes to save memory (which I of course desire if I have 20-30 individual still images). Such images pose no problem in themself, as they are just isolated images, presented on their own. I am not sure that persistent objects from the main layout are reloaded into memory when I switch back, but I assume they are (since I assume memory is cleared when switching layout - could be wrong). While not a big problem, the downside to this solution setup is not memory usage, but rather the time it takes to reload the objects into memory. A feature to load and unload an object temporarily has been suggested before on the forums, and it would be useful for this situation.

  • As you've said, images are loaded only in the layout which they are. So you have to load all of them everytime you switch layout. I think there are no other choice if you choose this way because that's how C2 works. I don't know how big is this cutscene and how it's done, but you might want to try working with layers on the same layout and load everything once. Doing this way, you will be able to run all the cutscenes with no need to wait between them.

    Edit: "since I assume memory is cleared when switching layout - could be wrong" - Yes, it is. All the objects that are not needed on the next layout that you are going to, are deleted from memory.

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