[r228] Jadder/Stuttering/frame drops with platform behavior

Bugs will be moved here once resolved.

Post » Thu May 12, 2016 1:46 am

Problem Description
No metter how few instances and objects are on scene, if there is at least one with active platform behavior, engine makes so many drawcalls, that force CPU to drop some FPS'es

Attach a Capx
https://drive.google.com/file/d/0B57pu5 ... ZqY2s/view

Description of Capx
.capx has as few as possible objects, and only thing you should do is to switch on and off platform behavior and look at the profiler to see what is going on.

Steps to Reproduce Bug
  • Run project with debug mode and switch view to profiler
  • With spacebar You can disable and enable platform behavior of pink block

Observed Result
In my case, switching pink block's platform behavior on makes much more drawcalls - and it's a small project. In my final game, drawcalls cause like my CPU run at 75%, where drawcalls are +50%

Expected Result
no such FPS drops

Affected Browsers
  • Chrome: (YES)
  • FireFox: (YES)
  • Internet Explorer: (YES)

Operating System and Service Pack
  • Windows 8.1
  • Windows 10

Construct 2 Version ID
R228
Last edited by stachir on Fri May 20, 2016 3:04 pm, edited 2 times in total.
B
22
S
3
G
2
Posts: 30
Reputation: 3,693

Post » Thu May 12, 2016 7:48 am

This is interesting - I can reproduce this, although I don't get the same dramatic cpu numbers you describe. According to the profiler, I get:

With platform Disabled:
- Engine 0.5%
- Draw 0.1%

With platform Enabled:
- Engine 1.3% (increase seems reasonable....)
- Draw 2.1% (20 x the draw call demanded above...?...)
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,249
Reputation: 46,472

Post » Thu May 12, 2016 10:44 am

@Colludium Probably those things (usage caused by engine and drawcalls) are related some way. Frame drops are not so dramatic in example above, but in final project, where platform behavior in use with many objects, this problem is kind of "deal braker".

In my case, according to the profiler, in this example I get:

With platform Disabled:
- Engine 0.9%
- Draw 0.2%

With platform Enabled:
- Engine 2.3%
- Draw 4.1% ( also 20x )

First I thought it could be my PC fault. I made some tests on other machines with different configurations- example was reproduced.
After short investigation, I discovered that platform behavior file is in bad condition- many comments and some unnecessary code- maybe there's problem.

I tried to get some info about this:
engine-cpu-usage_t88492
question-about-draw-calls_t71373
with no effect.
Last edited by stachir on Thu May 12, 2016 11:33 am, edited 1 time in total.
B
22
S
3
G
2
Posts: 30
Reputation: 3,693

Post » Thu May 12, 2016 11:19 am

Affected Browsers
Edge (YES)

engine 1.4-2.6%
draw 2 - 6%

System: W10-64, i3-5010U

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Thu May 12, 2016 12:19 pm

With Chrome, Windows 7 64Bit, C2 R221:

0.1% engine
0.1% draw

no difference between enabled or disabled.
B
24
S
3
G
1
Posts: 454
Reputation: 2,171

Post » Thu May 12, 2016 2:34 pm

Re-created the CapX in C2 R192 (original crashed upon downgrade):

-Google Chrome on Windows 10 64bit
-Enabled: 0.7% to 1.5% engine, and 1.7% to 2.9% draw calls
-Disabled: 0.5% engine, and 0.1% draw calls

Capx for R192: https://dl.dropboxusercontent.com/u/471 ... st192.capx
"Construct 4 lets YOU make advanced games! (they wont run anywhere)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
125
S
42
G
17
Posts: 2,228
Reputation: 19,918

Post » Thu May 12, 2016 3:20 pm

Thanks @Jayjay

I can confirm that with FireFox
-Disabled: 0.4% - 0.5% engine, and 0.1% to 0.2% draw calls; CPU-Utilization 0%
-Enabled: 1,6% - 1.7% engine , and 2,6% - 2.7% draw calls;CPU-Utilization 4%-5%


with chrome the profile in the debug-inspector seems not to work correctly it doesn't update. The CPU-Utilization seems to be correct and this is still 0.1%-0.2%
B
24
S
3
G
1
Posts: 454
Reputation: 2,171

Post » Thu May 12, 2016 4:10 pm

The draw calls increasing when the platform behavior is enabled is expected. Basically if nothing visual (position, animation, angle...etc) is changed then C2 doesn't redraw the canvas, so the draw calls will be lower.
B
94
S
33
G
114
Posts: 5,357
Reputation: 73,775

Post » Thu May 12, 2016 8:07 pm

@R0J0hound but what if the object is not changing? They are testing with a static object with platform that can be disabled or enabled with spacebar, and is immobile while measuring where the CPU usage is.

I would expect that there be no draw calls if the platform object is not moving even if platform is enabled. This is not the case.

There could be a legitimate reason, I understand, but currently the only variable here while testing is whether or not the platform behavior is enabled or disabled, and that's where the confusion is, I think.
ImageImageImageImage
B
62
S
19
G
51
Posts: 633
Reputation: 30,836

Post » Thu May 12, 2016 10:54 pm

Yes, cpu usage increasing when the platform behavior is enabled is truly expected and undeniably. My point is close to @DatapawWolf opinion- what about idle? In my opinion, this situation is more about this behavior runtime file, but for now I couldn't find any other reason, so that is my only clue. I already tried to disable different configuration of modules in my final project, and after many includes enabled and disabled, I have found that something is wrong with this particular behavior.

I tried to compare exported c2runtime.js files from R192 and R228 - differences are big from end of 2014 and now. Thanks to WinMerge program, I found difference with old and new platform code, but it is not very spectacular- current version include this code inside of cr.behaviors.Platform function:

behinstProto.onWindowBlur = function ()
{
this.leftkey = false;
this.rightkey = false;
this.jumpkey = false;
};

With my luck, it's probably not related to the problem..
B
22
S
3
G
2
Posts: 30
Reputation: 3,693

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests