How to reduce the number of crashes (mobile)

Discussion and feedback on Construct 2

Post » Fri Mar 13, 2015 1:26 pm

Thanks for the info about memory use. Very useful!

@Silverforce : I don't really know about what Phonegap Build is using. Do you mean XDK should be better? I will keep your tips in mind for my next game but here I need to find efficient ways to reduce memory usage on a finished game.

I have another new element to share : I'm using a "container" layout in my game that contains most graphical elemens of the game in it, and is never played.
The idea is that, as I have only one layout for every fight of the game, put all the enemies' images on the "game" layout will make it quite heavy. So I have them on an unused layout and only create the images I need at the beginning of each level. Is there any drawback to this method that I'm unaware of?

I just moved one of my images from my game layout to the container layout, and the "memory use" moved up from 298 Mb to 300 Mb, so I guess this memory use is for the "container" layout? But as this layout is never played, the memory usage displayed in the editor is probably not relevant, isn't it?

If I'm guessing right, it's the number inside the debugger which gives a clear indication of memory use (images only), which in the case of Healer Quest can go up to 120 Mb.

Another question : I have many big, invisible, flat-colored squares that I use as collision boxes in the game. Their weight is about 200 bytes each in my image folder. But do they use big part of the memory too?

Is partial transparency (i.e. 20% opacity) taking more memory than 0% or 100% transparency images?

At least I now see what I can do to reduce memory usage, so thanks a lot for all the very useful advices. And splitting my big layout into 2 parts (game+map) already seems to limit memory usage in game to around 90-100 Mb maximum.
Last edited by Rable on Fri Mar 13, 2015 1:36 pm, edited 1 time in total.
B
22
S
5
G
1
Posts: 325
Reputation: 2,347

Post » Fri Mar 13, 2015 1:36 pm

The memory use indicator is the layout which creates most memory usage.
Therefor, it is not a good representative of the memory use.

I use objects layouts in every one of my projects too.

would you split up your biggest "container" layout, into two or three, the memory usage will reduce too. (but it is just an indication, not actual memory usage)

As far as I know this is good practice and has no drawbacks ..

Good advantage is that you can prep all your objects on them too ...
Who dares wins
B
56
S
16
G
21
Posts: 1,875
Reputation: 19,406

Post » Fri Mar 13, 2015 3:49 pm

i think that "container layout" is not good idea ...
B
43
S
16
G
8
Posts: 783
Reputation: 8,238

Post » Sun Mar 15, 2015 10:09 pm

matrixreal wrote:i think that "container layout" is not good idea ...

Why not? Could you please develop your thoughts?
B
22
S
5
G
1
Posts: 325
Reputation: 2,347

Post » Sun Mar 15, 2015 10:15 pm

@matrixreal No a container layout is the best practice you can use because to create a object it has to be somewhere in your project if you have a container layout the images are only loaded when used or else for some objects i.e bullets you would have to put them somewhere in your project that is a active layout using memory that doesnt need to be used
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Mon Mar 16, 2015 12:48 am

volkiller730 wrote:@matrixreal No a container layout is the best practice you can use because to create a object it has to be somewhere in your project if you have a container layout the images are only loaded when used or else for some objects i.e bullets you would have to put them somewhere in your project that is a active layout using memory that doesnt need to be used


i prefer to put object on every layout (put them on layout but outside layer) and add for example an destroy outside layout behaviour ... this will optimise performance if you have to create them ... (read performance tips by ashley)

or maybe i don't understand how you create this "container" layout .... ???

maybe its a layout without even sheet ?
B
43
S
16
G
8
Posts: 783
Reputation: 8,238

Post » Mon Mar 16, 2015 5:16 am

matrixreal wrote:maybe its a layout without even sheet ?


Yup. Giant layouts with no events, never called via events. It's just to set the object properties.
B
68
S
24
G
19
Posts: 1,756
Reputation: 17,555

Post » Mon Mar 16, 2015 10:47 am

Silverforce wrote:
matrixreal wrote:maybe its a layout without even sheet ?


Yup. Giant layouts with no events, never called via events. It's just to set the object properties.



Actually .. I tend to add event sheets to my object layouts :D

So annoying when you tweaked something ... run it .. and it loads the objects layout lol

My object event sheets generally have something like:

On start of layout, go to main menu
Who dares wins
B
56
S
16
G
21
Posts: 1,875
Reputation: 19,406

Post » Tue Mar 17, 2015 2:24 am

Silverforce wrote:
matrixreal wrote:maybe its a layout without even sheet ?


Yup. Giant layouts with no events, never called via events. It's just to set the object properties.


:idea:

Wow, what a great idea. Can't believe I never thought of that before. :shock: :o
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

Post » Tue Mar 17, 2015 3:21 am

TiAm wrote:Wow, what a great idea. Can't believe I never thought of that before. :shock: :o


Yup, great to test positioning of objects and relative size etc:

Layout.jpg


Also a good testing layout is the screen size for HUDs & UI, so you can see it quickly develop and its fast to readjust, finding the X/Y for where sprites need to be. :)

Anyway, hopefully the crashes for OP are resolved. Good luck with it!
You do not have the required permissions to view the files attached to this post.
B
68
S
24
G
19
Posts: 1,756
Reputation: 17,555

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: technofou and 1 guest