My game heating up my phone

Get help using Construct 2

Post » Tue Feb 16, 2016 4:56 am

Do all Non-Global Assets get deleted when the a layout ends? If so, then why is the phone getting so hot? When a layout is left, then the non-global assets get destroyed, correct? As in, if the layout is no longer active. if another layout is active, then the non-global assets on the now non-active layout get destroyed?

[EDIT: It's not the music. Even without music memory usage keeps climbing.]
Last edited by Phoenixbowman on Tue Feb 16, 2016 5:26 am, edited 3 times in total.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue Feb 16, 2016 5:03 am

All of the graphics are 2-D. There are no physics behaviors, either. The game gets warmer as the game progresses. So either it's the music, or the assets are not being cleared from memory when the layout is over.

Is there a Destroy Layout command? Because when I leave the layout, i dont know if it's being destroyed or not. The layout may be not be being shown anymore, but it could still be "active" and taking up memory.

Is there a Destroy Layout command?
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue Feb 16, 2016 5:16 am

Im running the game, without music. As i progress, the RAM usage is going up. Which means that something is not getting cleared from memory. I read somewhere that as soon as a Layout is no longer active, all of the non-global assets on the layout get destroyed.

That is not the case. Something is persisting on the inactive, previous layouts.

When a layout is no longer active, do Tiled backgrounds on the previous layout get destroyed, or do they persist?

Something is persisting in memory. If you have on a layout, every 1 Second, subtract 1 from Global Variable X, does it continue to do that even when the layout is no longer active? Will it keep subracting 1 from X even when the layout is no longer active? With each passing level, the memory usage keeps going up. Could it be that the command Every 1 second subtract 1 from global variable X still be running? Even when the layout that the command is on is no longer active?
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue Feb 16, 2016 6:11 am

What are you using to test your game?

What phone? What exportation option?

Also, this is somewhat a welcoming to HTML5 gaming with mobile. But the kinda of hot your talking about seems to be really extreme.
Risk Rocket now available on Google Play
Image
B
36
S
15
G
6
Posts: 337
Reputation: 6,300

Post » Tue Feb 16, 2016 1:59 pm

Back when there were 10 Layouts, it was not a problem. Something is persisting. I read online that Assets that are used later on are stored in memory.

Is there anyway around this? It looks like Assets on the previous layouts are staying in memory. thus the more layouts go by, the more memory goes up.

WIll At End of Layout Destroy Object remove these from memory?

On End of Layout > Destroy A Destroy B Destroy C

Will that remove them from memory?

How do I clear ALL assets from a previous layout from memory without naming each and everyone and marking each and everyone as Destroy at End of Layout?
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue Feb 16, 2016 2:15 pm

Phoenixbowman wrote:Back when there were 10 Layouts, it was not a problem. Something is persisting. I read online that Assets that are used later on are stored in memory.

Is there anyway around this? It looks like Assets on the previous layouts are staying in memory. thus the more layouts go by, the more memory goes up.

WIll At End of Layout Destroy Object remove these from memory?

On End of Layout > Destroy A Destroy B Destroy C

Will that remove them from memory?


based on Ashley said:
https://www.scirra.com/manual/134/performance-tips

Not placing all used objects in the layout
If objects are not placed in a layout but are created by events, Construct 2 will load the textures for those objects the moment you create them. This can cause a momentary pause or "jank" and make the game feel less responsive. This can be avoided by placing any used objects in the layout.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Based on Ashley said, Objects are only preloaded by layout change so nothing to worry about clearing memory when leaving a layout (Exemption for Global Objects). Your memory problems is caused by something else. If I am to guess, the cause must be unseen events that cause looped object creation or too many objects on layout. Try to debug using Construct 2 debugger.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,857

Post » Tue Feb 16, 2016 2:35 pm

All of my objects are on the layout view, none are loaded by events. If it were too many objects on a layout, then memory would be fluctuating up and down. From when the app runs, memory goes up, keeps going up, and keeps climbing. It never drops until the app is closed.

If it were objects, then the memory would go up and down depending on the objects on screen. The memory is not going up and down. It only goes up and up the more layouts were passed.
B
20
S
7
G
3
Posts: 302
Reputation: 3,634

Post » Tue Feb 16, 2016 3:11 pm

Were your sprites "Global - Yes" ?
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
65
S
21
G
90
Posts: 1,124
Reputation: 59,857


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 46 guests