CocoonJS HELP ASAP!

Discussion and feedback on Construct 2

Post » Wed Mar 26, 2014 3:47 pm

We are not using any 3rd party plugins. In construct, the memory use in the status bar says our game is using 382.3mb. If this gets multiplied by 4 when exporting using Cocoon and played on the phone, I can clearly see why the game is crashing. Is there any way to lower the amount of memory used by the game?
B
3
Posts: 5
Reputation: 185

Post » Wed Mar 26, 2014 4:07 pm

Silverforce wrote:It's not the file size but the memory usage.

Compressed PNG 8bit or JPG don't use much filesize, but once they load into memory as a texture, they become massive. A blank 1280 x 720p sprite for example, is probably a 1kb JPG, but its actually a 16MB texture in memory due to being placed into 2048 x 2048 texture.

My Ninja game is only 17mb exported but CocoonJS loading all the assets into memory = 450MB into ram on start, crashing devices with 768MB or less ram.


Are there any decent methods to cut down on the memory usage of pngs? That's what all of our images are.
B
3
Posts: 5
Reputation: 185

Post » Wed Mar 26, 2014 11:33 pm

aem215 wrote:We are not using any 3rd party plugins. In construct, the memory use in the status bar says our game is using 382.3mb. If this gets multiplied by 4 when exporting using Cocoon and played on the phone, I can clearly see why the game is crashing. Is there any way to lower the amount of memory used by the game?


Holy crap, Construct is saying you use 382MB?!!! Mother of god... how big are your background and sprite images?!

The only way to lower the memory use is to use smaller sprites, instead of 512 x 512 or 256 x 256, consider using 128 x 128 pixels. Also do not have the background as one large image file, it's insane to do that for many different backgrounds.

If your game is 1280 x 720, each background image of that size is 16MB into memory as a texture 2048 x 2048, because it will not fit in a 1024 x 1024 texture as its width is too large, it has to go up to the next power of 2 texture.

READ THIS: https://www.scirra.com/blog/112/remembe ... our-memory

And read it again and again til you understand.

When you design for mobiles, target a device and aim to have less than half its total ram taken by your game, because mobiles have a lot of junk running in the background it consumes nearly half a device's ram. ie. a 1GB phone typically only have 500MB free for apps. If you want your game to run good on 512MB devices, don't let it consume more than 256MB ram etc.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Thu Apr 10, 2014 7:35 am

i have same error with just 2 sprites on 1 layer !?
B
26
S
11
G
2
Posts: 669
Reputation: 5,038

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: tarek2 and 9 guests