How do I minimize memory usage for cutscene images

Get help using Construct 2

Post » Fri Feb 20, 2015 5:13 am

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 :)

Cheers,
thegrind
B
26
S
9
G
2
Posts: 78
Reputation: 2,524

Post » Fri Feb 20, 2015 5:21 am

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.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Fri Feb 20, 2015 5:28 am

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.
B
26
S
9
G
2
Posts: 78
Reputation: 2,524

Post » Fri Feb 20, 2015 6:00 am

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.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Fri Feb 20, 2015 6:28 am

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.
B
26
S
9
G
2
Posts: 78
Reputation: 2,524

Post » Fri Feb 20, 2015 6:58 am

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.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests