DRASTIC PERFORMANCE DECREASE ON NEW C2 VERSIONS

Bugs will be moved here once resolved.

Post » Mon Feb 06, 2017 5:39 am

STARTECHSTUDIOS wrote:@Johncw87
Thanks for your tip John. I don't want to make you work but could you do a quick little example of 139 vs 239 and show improved performance? That would be a huge help and shed light on this for all of us! :)))

Thank you man. :)


Ok, but only because I was planning on re-installing Construct 2 to test something else anyway.

I took the project you posted, and made the modifications I mentioned. Window size is 500x500, and the layout scale is set to 0.05. I also modified the project XML so that Construct 2 rev 139 would open it. Visually, it's exactly the same.

https://dl.dropboxusercontent.com/u/207 ... 20fps.capx

In version 139, I get 22 - 27 fps, with an occasional dip
In version 242, I get above 50 fps, with an occasional dip.

These tests were run in Firefox 50 32-bit
B
54
S
19
G
13
Posts: 97
Reputation: 10,146

Post » Mon Feb 06, 2017 1:12 pm

The way this project is set up circumvents the collision cells optimisation. The cell size is the viewport size, so in this case by using a totally impractical size of 10000x10000 (honestly, surely nobody would ever choose that in practice?) forces all collisions to be made within one cell. So then you get the worst-case of all possible collision checks, plus the overhead of managing collision cells. That's probably why you're seeing it as slower.

If you set the viewport size to something reasonable, it runs far faster. Even with a viewport size of 1000x1000 it runs several times faster for me.

If you want a full view while using collision cells, set a reasonable viewport size, and then set a small layout scale so you can see everything. That way you'd get the same view but the improved performance too. I did this for some of the screenshots at the time. Also collision cells are an absolutely critical performance optimisation if used sensibly - in many cases they can completely eliminate 90% or more of all collision checks, which in many cases completely eliminates the performance overhead of collision checks. It's such a huge optimisation that it's definitely a good idea to work with it, not against it. Also I have to say reporting an issue about a change that was made over three years ago is not very helpful - the sooner you can make a report, the better.

Closing as won't fix.
Scirra Founder
B
397
S
236
G
88
Posts: 24,420
Reputation: 194,544

Post » Mon Feb 06, 2017 7:30 pm

@Ashley
Thanks for your reply. If it is true that in some cases collision cells make the project worse, why not make a simple on/off toggle switch in the project bar so users can turn it off if it hinders performance? It will be on by default. That way there are no gripes and you don't have to perform a fancy (but less intuitive) shrink the window and reduce the scale trick to get it to work. It will remain on by default but can be turned off to increase performance in some cases. There is no harm in it surely, you already did it for turrets, just do it for the rest of the engine, please. I'm still not done testing the versions, it seems that collision cells will reduce performance except in cases with very small window sizes. A toggle switch would instantly fix this issue. Modern phones have displays reaching above the 1920 x 1080 viewport of most monitors, my current project is set at 1440x2560 to accommodate most modern smartphone screens. Wouldn't it be feasible to have a simple on/off switch to alleviate this? :) Thanks for your help
Last edited by STARTECHSTUDIOS on Mon Feb 06, 2017 8:19 pm, edited 2 times in total.
B
82
S
32
G
7
Posts: 281
Reputation: 10,685

Post » Mon Feb 06, 2017 7:50 pm

To turn off collision cells, you just make a event that 'disables' it by 'not playing nice to its rules'.
(according to my knowledge, and if interpret the rules correct )

Object1 is overlapping Object2 <------- will use collision cells
______ Actions .......

Object 1 is on screen <--- will exclude Object 1 from the collision cells (or any other pre-pick condition)
Object1 is overlapping Object2
______ Actions .......

See Ashleys blog.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Feb 06, 2017 8:28 pm

@99Instances2Go
A good try for sure. But the only problem is I don't think the 'is on screen' event can pick before the 'on collision' event. Otherwise yes, it would be a good trick for sure.
B
82
S
32
G
7
Posts: 281
Reputation: 10,685

Previous

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 7 guests