Uneven CPU load on each game session.

Discussion and feedback on Construct 2

Post » Sat Jul 02, 2016 12:04 am

Usually when I run my game it runs at approx 15-20% cpu, but sometimes hovering around 30-35 with even when idle (nothing moving) on my surface, and the only way to get it down to normal rate is by restarting the game a few times. This is especially critical on mobile where those values are at 25-40 normal rate, but every now and then 40-60% cpu usage.

This is especially noticeable since touch starts to fail/lag above 50% cpu usage on mobile.

Has anyone experienced anything similar or know what might be causing the game to run at varying performance every time? Plugins, Behaviours, etc etc not loading correctly on start of game? Any help appreciated.

This seem to happen on both pc and mobile.
Follow my progress on Twitter
or in this thread Archer Devlog
B
42
S
18
G
19
Posts: 1,060
Reputation: 14,054

Post » Sat Jul 02, 2016 2:54 am

Does running in debug mode show anything different or abnormal? I had some similar issues when one of my loops would get stuck on for some reason - and it was causing a lot of collision checks that it shouldn't have been doing. Maybe you have something similar happening?

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Sat Jul 02, 2016 8:58 am

SoldjahBoy wrote:Does running in debug mode show anything different or abnormal? I had some similar issues when one of my loops would get stuck on for some reason - and it was causing a lot of collision checks that it shouldn't have been doing. Maybe you have something similar happening?

~Sol


In the debugger the only things abnormally high in those cases are engine and draw calls. I've tried to disable groups of events one by one to try to identify if it's any event causing it, but no luck. Draw calls should go down to 0% if nothing is moving, changing, it does so in older versions of my game.

I opened an older capx of my game and it doesn't have this issue. I'm starting to think it's some behaviour causing it.
Follow my progress on Twitter
or in this thread Archer Devlog
B
42
S
18
G
19
Posts: 1,060
Reputation: 14,054

Post » Sat Jul 02, 2016 9:45 am

Yeah that sounds kinda strange... I have issues in the debugger itself. In preview mode the game uses about 20% CPU with a few things going on (weather effects and a few characters on screen) - but in the debugger with the exact same scenario happening it's using 85% CPU. It makes any actual useful debugging pretty much, not useful.

I don't really know what to suggest since yeah, it isn't a consistent problem you're experiencing. I hope you find the reason though.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Sat Jul 02, 2016 10:16 am

These measurements are surprisingly difficult to interpret correctly. See my blog on understanding CPU and memory measurements. Here's a relevant passage:

Javascript does not provide direct access to the CPU usage. Instead Construct 2 estimates it using timers. The key word here is estimates: it is not a real CPU usage measurement.
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143

Post » Sat Jul 02, 2016 2:46 pm

@SoldjahBoy I managed to identify that the problem. Theres is something causing a very high spike in Draw Calls. Sometimes it goes away by itself but sometimes i have to quit and restart the game, for it to go away. But i don't know what is causing the spike. This spike can happen at anytime. Even when idle, nothing moving, no scrolling, nothing changing zOrder, no animations running.

@Ashley Thanks for the link. Do you know anything that could cause high unusual spikes in drawcalls? These idle spikes seem to be higher than normal, even higher than during gameplay when objects are moving, animations playing etc etc. Or is there any way to test it, so i can identify what is causing the spike.
Follow my progress on Twitter
or in this thread Archer Devlog
B
42
S
18
G
19
Posts: 1,060
Reputation: 14,054

Post » Sat Jul 02, 2016 5:04 pm

The point of the blog I linked to is these numbers don't necessarily mean anything.
Scirra Founder
B
403
S
238
G
89
Posts: 24,653
Reputation: 196,143


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests