Game performance DROPS after 1 minute

Discussion and feedback on Construct 2

Post » Fri Mar 11, 2016 11:12 pm

Message: NathanL127 can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Hey everyone,

My game - since yesterday (as far as I know) performance immediately drops and lags to heaven and hell. Nothing changes from 10 seconds in to a minute in where it starts lagging. The only difference is it's been running for a longer time. My only guess is that there are too many entities (from the constant amount of clocks spawning) but this is dismissed as I have tried spawning 200 entities (clocks) and it would not lagg until a considerable amount of time.

From assessing the debugger I see the CPU performance goes from 30% to near 100%, I just don't understand what is causing this as all the entities are *roughly* the same from 10 seconds in (no lagg) to 60 seconds in (lagg).

Note: In my code I realized I didn't destroy the text (changed the opacity so it was invisible), I have since fixed this, no changes at all.

The debugger makes it lag even more so I have two links, of the game with and without the debugger on.
https://streamable.com/9gmt - without debugger
https://streamable.com/orim - with debugger

I wouldn't say this is a performance issue as I have a pretty decent computer - This may have been lagging before the first couple of days, but I wouldn't know as I don't normally run it for long.

Note: I will give capX but only if you ask for it and i'll message you the link - It's for a competition and I don't want the whole world having access to it.
B
3
Posts: 3
Reputation: 183

Post » Sat Mar 12, 2016 3:07 am

The most interesting part for you in this case is the profile tab in the debugger. It shows CPU usage for the particular group, so you can track the problem.
ImageImageImage
B
27
S
16
G
74
Posts: 985
Reputation: 41,689

Post » Sat Mar 12, 2016 3:39 am

Hey, thanks for the reply man. The profile tab is restricted to the full version - which I don't have. I found the problem through going line by line in my code and disabling each on individually and testing it for a minute to find the problem. The destroy action did not dstroy the clocks fully like the debugger showed. So as I suspected their were clocks running in the background using system resources, to fix this I limited the code to only affect the clocks on screen.
B
3
Posts: 3
Reputation: 183

Post » Sat Mar 12, 2016 3:42 am

Ah.. right. Well that's a good catch then! There's a behaviour "Destroy outside layout", you might find it useful.
ImageImageImage
B
27
S
16
G
74
Posts: 985
Reputation: 41,689

Post » Sat Mar 12, 2016 4:17 am

Oh nice, will give that a go.
B
3
Posts: 3
Reputation: 183


Return to Construct 2 General

Who is online

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