How does CC render objects?

New releases and general discussions.

Post » Sun Jul 08, 2012 12:18 am

I have a question. Guys, how does Construct Classic render objects? Does it load all the objects on layout (like in C2) or it only counts objects which are visible at the moment? Can I have one large layout with thousands of objects, but only for example 100 are visible at the moment, will it drop FPS?
B
11
S
3
G
6
Posts: 193
Reputation: 4,234

Post » Sun Jul 08, 2012 2:52 am

As far as I'm aware, it loads the entire layout (there's even an event to do that). The only way to help is to disable events for objects when they're off-screen, but this won't eliminate the load. This is a good thing, though, because you don't want loading pauses every few steps. Also, be sure to have multiple instances of objects instead of a thousand individual. It would just be poor design and inefficient to do otherwise.
B
90
S
32
G
14
Posts: 935
Reputation: 14,540

Post » Sun Jul 08, 2012 8:22 am

The objects are loaded from the entire layout yes but only the ones visible in the current screen space are rendered thus manually swapping between visible and invisible isn't going to make a difference (and might even cause an actual additional loading header, but being a binary comparison every tick it's not a real issue).

There are special cases, though, for example disabling shadow casting Light objects disables the shadow rendering too. This became a crucial optimization to a project where we have hundreds of lights but only a couple visible at the time. All of the lights were technically casting shadows (even though they were out of range to even render!) which totally butchered the rendering speed.

Sprites in CC are quads just like in C2. Having thousands of large sprites definitely ups the loading time. To keep it within reasonable boundaries you might want to have several medium sized layouts you switch between. For example the project I mentioned has somewhere between 2000 and 3000 objects per 2560x2560 pixel space (which is the used layout size) and it takes around 20 seconds to change layouts.

Edit: Forgot to answer the actual question: in principle the more objects you have on LAYOUT causes longer loading times. The more objects you have on SCREEN causes lower FPS.Zotged2012-07-08 08:24:24
B
11
S
2
G
3
Posts: 100
Reputation: 2,150

Post » Wed Jul 11, 2012 11:55 am

Thank you!
B
11
S
3
G
6
Posts: 193
Reputation: 4,234


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 5 guests