How to reduce the number of crashes (mobile)

Discussion and feedback on Construct 2

Post » Tue Mar 17, 2015 9:53 am

Thanks again for the help. I already reduced the memory usage by splitting one layout into two (was using container layout already).

Now I've got a question about music.
For some reason, on an iPad, music only starts when touching the screen once the layout has started. This cause massive music problems in Healer Quest, and it happens when exported both with XDK and Phonegap Build. FYI there is no such music problems on android, and I think it's correct on iPhones, too (problem iPad only AFAIK, experienced on iPad Air 2 and iPad Mini 2).

To counter this, the only solution I found was to add the music into the sound folder, and here is my question : Does making this increases the memory usage even if the music is not played?

Another question : Is there any "clean" way to play music correctly on the iPad?

Thanks!
B
21
S
5
G
1
Posts: 317
Reputation: 2,291

Post » Thu Mar 19, 2015 12:47 pm

I really would like to know if there is a clean way to play music on the iPad without having to put all the music in the sounds folder. Anyone has music working without nedding to click before it starts playing?
B
21
S
5
G
1
Posts: 317
Reputation: 2,291

Post » Wed Apr 08, 2015 7:13 am

Ashley wrote:In other words, the image file size/format has no effect on memory use. It's effectively decompressed and loaded in to memory as a 32-bit ARGB bitmap.


Does it means that if I have a 1024x1024 pixel spritesheet in my "image" folder, whether it is full of sprites, or just plain transparent with only a few sprites on the top half of it, it will use the same memory during the game?
B
21
S
5
G
1
Posts: 317
Reputation: 2,291

Post » Wed Apr 08, 2015 10:10 am

Rable wrote:Does it means that if I have a 1024x1024 pixel spritesheet in my "image" folder, whether it is full of sprites, or just plain transparent with only a few sprites on the top half of it, it will use the same memory during the game?


Yes.

1024 x 1024 images in vram is 4MB of memory, regardless of the original format or whats on it.

2048 x 2048 = 16MB of memory.
B
67
S
24
G
19
Posts: 1,754
Reputation: 17,526

Post » Wed Apr 08, 2015 10:13 am

Rable wrote:Thanks again for the help. I already reduced the memory usage by splitting one layout into two (was using container layout already).

Now I've got a question about music.
For some reason, on an iPad, music only starts when touching the screen once the layout has started. This cause massive music problems in Healer Quest, and it happens when exported both with XDK and Phonegap Build. FYI there is no such music problems on android, and I think it's correct on iPhones, too (problem iPad only AFAIK, experienced on iPad Air 2 and iPad Mini 2).

To counter this, the only solution I found was to add the music into the sound folder, and here is my question : Does making this increases the memory usage even if the music is not played?

Another question : Is there any "clean" way to play music correctly on the iPad?

Thanks!


Never put Music into the sounds folder, it explodes the memory usage to insanity due to decompressing your music into raw wav files to store in memory to play instantly.

Music is streamed, to minimize memory usage.

The touch before playing is an issue with some browser engines on mobiles. You can bypass this by making a intro screen at the start of your game, requiring users to touch it to start the game. Think of consoles, "Press Start Button" menus.
B
67
S
24
G
19
Posts: 1,754
Reputation: 17,526

Post » Wed Apr 08, 2015 10:16 am

Rable wrote:
Ashley wrote:In other words, the image file size/format has no effect on memory use. It's effectively decompressed and loaded in to memory as a 32-bit ARGB bitmap.


Does it means that if I have a 1024x1024 pixel spritesheet in my "image" folder, whether it is full of sprites, or just plain transparent with only a few sprites on the top half of it, it will use the same memory during the game?

Yep. The content of the image does not matter, even if it is fully transparent: every pixel is still loaded in to memory with alpha, red, green and blue components.
Scirra Founder
B
382
S
222
G
84
Posts: 23,981
Reputation: 189,217

Post » Wed Apr 08, 2015 1:08 pm

Thanks Silverforce and Ashley, this is very useful. Now I know how to optimize my images.

On the music problem, I started a topic this morning, but the problem I have is that every time a music should start playing, it is delayed until the user touches the screen. I'll try to rebuild with the latest version of XDK and hope the problem will be solved by itself.
B
21
S
5
G
1
Posts: 317
Reputation: 2,291

Post » Thu Apr 09, 2015 8:12 pm

I updated my games with the many advices in this thread. I've tested it for more than 2 hours without a single crash! Awesome!

But as I told, I now have unbearable music problems, and it's not just about adding a touch to start the game. Every music in the game needs a touch before it starts (tested on iPad Mini 2 and iPad Air 2)! This is especially problematic after the player wins a level. Right now, the game display a big "VICTORY" word but plays no music... Then as soon as you click the button to continue, the victory fanfare starts playing. Ridiculous.

Is there no way to play music correctly on iPads? (not sure how it goes on iPhones as I don't have one).
B
21
S
5
G
1
Posts: 317
Reputation: 2,291

Post » Fri Apr 10, 2015 2:52 am

If you have a short "victory" music, you can put that into the sounds folder to ensure it plays instantly without touch input.

Longer audio tracks leave it as music, touch to start is a limitation on browsers for mobiles, just work around it or incorporate it into your game.
B
67
S
24
G
19
Posts: 1,754
Reputation: 17,526

Post » Fri Apr 10, 2015 2:11 pm

If there is no way to make it perfect, I will just deal with it.
Thanks for the info. :)
B
21
S
5
G
1
Posts: 317
Reputation: 2,291

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests