multilevel game - memory issue

Get help using Construct 2

Post » Sat May 04, 2013 9:15 am

I am making multilevel game .The backgrounds , which I am using in my game is size of 2048*1536 .
Some level have common backgrounds. So, I just copy background object from one layout to another layout. This doesn't affect on game size.
But it lead to increase the memory usage. Whenever I copy such backgrounds It increased the memory usage. and the increase is about 7 MB.
My game Size is 13 MB. But memory usage is 67 MB.

How to reduce memory usage? due to large background this happens? or something else?
B
6
S
1
Posts: 29
Reputation: 763

Post » Sat May 04, 2013 9:51 am

[QUOTE=rambop91] I am making multilevel game .The backgrounds , which I am using in my game is size of 2048*1536 .
Some level have common backgrounds. So, I just copy background object from one layout to another layout. This doesn't affect on game size.
But it lead to increase the memory usage. Whenever I copy such backgrounds It increased the memory usage. and the increase is about 7 MB.
My game Size is 13 MB. But memory usage is 67 MB.

How to reduce memory usage? due to large background this happens? or something else?
[/QUOTE]

I can't be sure at 100%, but a browser having to render such big images may have problems, maybe if you cut them into different tiles (aka: images).

PS:Why are you displaying so High Quality images?

https://www.scirra.com/forum/viewtopic.php?t=152506

And that is why you shall respect the bug reports guidelines, not only giving a capx is making the bug reproductible in one click in a situation they can work with (less time wasted trying to reproduce vague instructions) but also it helps filtering false positives.

Game design is all about decomposing the core of your game so it becomes simple instructions.
B
42
S
17
G
16
Posts: 2,094
Reputation: 15,355

Post » Sun May 05, 2013 9:49 am

I have to support all screen size iphone to ipad, Samsung galaxy s4 to desktop pc.
so,I kept this.
Tiles property repeats the pattern. But My background is little bit natural scene type. So it cant be tiled.
B
6
S
1
Posts: 29
Reputation: 763

Post » Sun May 05, 2013 10:08 am

[QUOTE=rambop91] I have to support all screen size iphone to ipad, Samsung galaxy s4 to desktop pc.
so,I kept this.
Tiles property repeats the pattern. But My background is little bit natural scene type. So it cant be tiled. [/QUOTE]

When I said "tiled", I suggested you don't display One big Image, but you cut it multiple times and place them, like a complete puzzle, so the display will not be different, but the browser will have to support multiples medium sizes images instead of one Big picture, not sure it will work though
https://www.scirra.com/forum/viewtopic.php?t=152506

And that is why you shall respect the bug reports guidelines, not only giving a capx is making the bug reproductible in one click in a situation they can work with (less time wasted trying to reproduce vague instructions) but also it helps filtering false positives.

Game design is all about decomposing the core of your game so it becomes simple instructions.
B
42
S
17
G
16
Posts: 2,094
Reputation: 15,355

Post » Sun May 05, 2013 2:54 pm

I was struggling with the same issue for mobile. I was thinking of loading the background dynamically, and storing a ton of sizes and aspect rations on the server as images. If there is not an exact fit, I would either get a larger one and crop or scale down, or smaller and up.

However, what I found was that although my game only displayed a few sprites at a time, there were so many outside the game (as you need to have sprites for every thing which can be touched or moved). The core game was fast, but when I added all the dumb info screens and their backgrounds, buttons, settings and all the stuff you need to put round the game, it was too slow and the code unattainable so abandoned the project even though the games themselves were complete (it was a suite of slot machines for real money for an existing online casino).

However, I'm keeping my eye on construct 2's progress, hoping that one day it will have more support for native html 5 mobile, e.g. the ability to swipe in a settings form and a better solution for multiple screen sizes/ratios without black letterbox bars (which is currently possible, but extremely difficult when you add swipe navigation). When It does, the world we be at our feet.nutmix2013-05-05 14:56:26
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Mon May 06, 2013 12:08 pm

Is there any solution to reduce memory usage??
And increase in memory is due to large backgrounds??
B
6
S
1
Posts: 29
Reputation: 763

Post » Mon May 06, 2013 1:11 pm

New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793

Post » Mon May 06, 2013 1:58 pm

Another good idea is if you use multiple times the same background to make it global and spawn it just in the "On Start of Layout" event ;) This helped me much at my "diablo" like game
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Mon May 06, 2013 10:00 pm

See @Kyatric's link. It's almost impossible to design efficient using large tiles like that.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Mon May 06, 2013 10:08 pm

Having you thought of releasing an iPad specific version, a PC specific version and so on? You don't need just one file.
B
50
S
14
G
12
Posts: 813
Reputation: 16,764

Next

Return to How do I....?

Who is online

Users browsing this forum: fredriksthlm, MPPlantOfficial and 18 guests