performance and every tick

Discussion and feedback on Construct 2

Post » Sat Sep 29, 2012 10:40 pm

[QUOTE=nutmix] @foolberry - using a single global would be dangerous if there is any multithreaded parts to C2[/QUOTE]

That I didn't think of. I use this alot - not usually globals actually, but object variables. And I've never had a problem with it. I use it where you'd normally call a method in code. But I see there is a threading problem potentially.
Posts: 70
Reputation: 3,076

Post » Sun Sep 30, 2012 6:27 pm

It is likely your 'every tick' events have little or no performance impact. If nothing at all on screen changes (as you say is the case when you disable the events), Construct 2 does not actually redraw the screen. Most games spend 80-90% of their time rendering, so if you measure the framerate when nothing is moving (and therefore the screen is not drawing), the result is meaningless. It will basically be doing nothing at all apart from updating the FPS counter. I assume you are enabling an event which causes a per-tick change in the display, which causes rendering every tick, which then results in a real framerate. This may make it look like a single event is having a huge performance impact, but it is very unlikely this is the case. In general you shouldn't worry about event performance anyway.

Note that moving offscreen objects, or moving an object then putting it back in the same tick, still results in a redraw. Construct 2 doesn't try very hard to detect is nothing has visually changed, because doing so accurately is extremely difficult and most games redraw every tick anyway.

For the record, C2 does not use a multithreaded engine right now.
Scirra Founder
Posts: 24,931
Reputation: 198,725


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 18 guests