How do I optimize memory usage .

Get help using Construct 2

Post » Mon Feb 15, 2016 9:39 pm

Hi guys, I am making a PC game. from what i understand, since almost all laptops have MINIMUM 4 GB of ram, I was thinking that a Pc game can have arround 2GB of ram usage ...is that ok in ur opinion ???
I have really maaany sprites with many frames.... the max size is arround 500*500 pixels...but mainly arround 270*270.... any tip to optimize ?


thanks :)
B
37
S
16
G
2
Posts: 447
Reputation: 4,865

Post » Mon Feb 15, 2016 10:06 pm

You might have confused RAM with VRAM. The amount of VRAM available to a system is generally significantly less than the total RAM available.

Even so, 2GB of free RAM out of 4GB is pretty optimistic, maybe if the user has nothing else open.

This article has many tips on reducing memory usage in images - https://www.scirra.com/blog/112/remembe ... our-memory

Some quick tips:

Use power of 2 image sizes - your 270*270 image takes up the same amount of memory as a 512*512 image (actually Construct helps you out a little here, but it is still a good idea to do it manually). If you reduced the size to 256*256, it would be 4x less.

Try to group up your images into layouts - don't use images you don't need for that particular layout. Anything that isn't used in each layout is not loaded into memory.

Avoid transparencies as much as possible. Even if you don't see anything, it still takes up memory.

Cut down on animation frames. A professional artist can convey a LOT of information in just a few frames with technique. Someone posted this video a little while ago and its a great way to see how pros do it. https://www.youtube.com/watch?v=Mw0h9WmBlsw

Similarly, check if some parts of your animations can be broken off into their own objects. For example, if you have 10 animation sets for when a character swings 10 different swords, instead make one "swing" animation for the character, and have the swords as separate sprites.
Mistakes were made.
B
52
S
26
G
108
Posts: 1,606
Reputation: 61,133

Post » Tue Feb 16, 2016 6:43 am

thanks a lot 4 ur Help...very informative !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
B
37
S
16
G
2
Posts: 447
Reputation: 4,865


Return to How do I....?

Who is online

Users browsing this forum: ditocruz, dop2000, mcscooter and 24 guests