Layout memory cleanup

Discussion and feedback on Construct 2

Post » Sun May 11, 2014 12:56 am

Does anyone know what the memory cleanup is after you Goto a new Layout? I can't find any mention of this in the documentation. If I created a bunch of objects and don't destroy them it seems like they are cleaned up for you? When I go back to that layout they are gone and the level restarts. However, eventually as I play, the game's FPS slows down, especially when I add lots and lots of objects and it seems to happen progressively.

Since then I've put all my created objects in a family and I just destroy them all right before I leave the layout and it seems to have done the trick.. I haven't seen any slow down..

Can anyone confirm what happens memory-wise when switching layouts?
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Fri May 16, 2014 3:58 am

no one knows?
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Fri May 16, 2014 4:19 am

I don't encounter that problem you describe, can play for hours and no slow downs.

Do you run with WebGL mode enabled?
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Fri May 16, 2014 4:28 am

@Silverforce yes, webgl and the latest Chrome
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Fri May 16, 2014 12:54 pm

Normally C2 does a destroy on all non global object after each layout (however if you spawn other object on destroyed, they'll not be erased)

However it could have changed slightly from the last time I worried about this, so maybe there is a problem indeed
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 » Fri May 16, 2014 7:52 pm

@Aphrodite, I'm pretty sure it doesn't. I was able to recreate the performance hit when spawning many many objects between layouts. It didn't happen right away, but then all of a sudden my fps would go down to 20 when it's normally at 60 (and I have a very fast computer). It felt like a cleanup issue to me, since destroying the Families at the end seems to do the trick. I was just looking for the official word as I couldn't the answer anywhere.
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865

Post » Fri May 16, 2014 8:52 pm

Sounds like it might be a bug, can you provide a simple .capx that reproduces the issue?
Moderator
B
95
S
34
G
33
Posts: 3,007
Reputation: 27,876

Post » Fri May 16, 2014 10:13 pm

unfortunately the game I am working on is over 350 events and quite large. It very well could be a bug. I hope not.

@Arima do you know of any doc that might explain what happens to "System->Create Objects" after a Layout is left? I figure globals and objects with the Persist behavior remain intact.
B
100
S
33
G
16
Posts: 1,204
Reputation: 16,865


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests