Optimization question

Discussion and feedback on Construct 2

Post » Wed Oct 08, 2014 6:59 am

IT should work if and any the images inside the spritesheet are smaller(or bigger)... say you have 3 255x63 and one 32x32 sometimes ive seen it mess up and you need to make it 31x31

it might be 2 pixels i just looked at some of mine and it looks like i made them 124x124 and the only reason i can think i would make it that way is to make the sheet correct so it might be good to try
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Wed Oct 08, 2014 11:37 am

Afaik, spritesheeting adds one pixel all around the image, so I would think 2 pixels less at least.

Also I though cocoonJS extracted all sounds on startup (maybe music too?) And dont release them during the gameplay, so that could also be a problem if your sounds are numerous and high quality.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
22
G
18
Posts: 2,123
Reputation: 17,150

Post » Wed Oct 08, 2014 1:01 pm

CocoonJS does not support memory management. It will load the entire project in to memory on startup. This makes it use considerably more memory than the C2 estimate (which applies to platforms which support memory management - all of them except CocoonJS). Despite our best efforts to help them, Ludei never fixed this. It's one of the reasons we've deprecated support for CocoonJS. As a workaround, use any exporter other than CocoonJS and it will probably use much closer to the estimated memory in C2. We recommend Crosswalk for Android.

BTW, yes, transparent pixels still take up memory! The entire image rectangle uses memory, transparent pixels is just another "color" as far as the image content is concerned.
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143

Post » Wed Oct 08, 2014 1:32 pm

Thanks Ashely, I do understand that CJS loads up everything at once. Which is fine, a majority of my project is the main game anyway, there isn't much that would take advantage of the layout by layout loading anyway. If I got as good of FPS in crosswalk as I did in CJS, I might consider switching.

Thanks for the answers and I will work it from there. I'll keep trying crosswalk to see if it improves for me.
B
101
S
32
G
12
Posts: 1,549
Reputation: 21,993

Post » Wed Oct 08, 2014 3:22 pm

Also, I keep hearing about crosswalk, but that is not an option for IOS, correct?

What is the go to solution for iOS right now that has memory management? Is it Ejecta?
B
101
S
32
G
12
Posts: 1,549
Reputation: 21,993

Post » Wed Oct 08, 2014 3:47 pm

By removing all the dead space from around my animations I was able to clear up another 6 1024x1024 images :). Isn't optimizing fun. Really makes me appreciate how amazing C2 is and the work and thought @Ashley has put into the exporting process. You probably don't get enough credit for the behind scenes stuff like this, and it's pretty freaking impressive.
B
101
S
32
G
12
Posts: 1,549
Reputation: 21,993

Post » Wed Oct 08, 2014 4:17 pm

ArcadEd wrote:Also, I keep hearing about crosswalk, but that is not an option for IOS, correct?

What is the go to solution for iOS right now that has memory management? Is it Ejecta?


It is ejecta indeed, hiwever some people had problem with it, so It might be less straitforward to use

Also phonegap will support it for iOS 8 I think, but as iOS is not my target, I suggest doing verification first if you really need to switch.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
54
S
22
G
18
Posts: 2,123
Reputation: 17,150

Post » Wed Oct 08, 2014 4:31 pm

I might try ejecta again and see, I haven't used it in a while, mostly because it was iAd only. For this app, I might actually use iAds so it might work out.

However I am getting far with optimizing. It's good to note that you do need a 2 pixel buffer for the image sheets. I had all of my graphics set to a power of 2 (256, 512, etc). This actually causes more sprite sheets than needed. If I reduce size of all of them by 2 pixels, I can squeeze more on each sheet, creating less total sheets.
B
101
S
32
G
12
Posts: 1,549
Reputation: 21,993

Post » Wed Oct 08, 2014 4:43 pm

Wow, just by making these slight changes the value in the debugger (which was 103mb during gameplay) is down to 65.

When I get back to my mac I am going to check it out and see how much changed. YaY!
B
101
S
32
G
12
Posts: 1,549
Reputation: 21,993

Post » Wed Oct 08, 2014 5:57 pm

ArcadEd wrote:Wow, just by making these slight changes the value in the debugger (which was 103mb during gameplay) is down to 65.

When I get back to my mac I am going to check it out and see how much changed. YaY!


hi,
you have done this memory usage reduce only by make sprite power of 2 ? you mean tiled background or on simple sprite too ?!!!
B
46
S
16
G
8
Posts: 802
Reputation: 8,351

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests