How does CC render objects?

Forum Home Forum Home > Construct Classic > Construct Classic Discussion
 Post Reply Post Reply
Author
2,511 Rep
Post Options Post Options   Quote MastaZavr Quote  Post ReplyReply Direct Link To This Post Topic: How does CC render objects?
    Posted: 08 Jul 2012 at 12:18am
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?
Back to Top
3,653 Rep
Post Options Post Options   Quote C-7 Quote  Post ReplyReply Direct Link To This Post Posted: 08 Jul 2012 at 2:52am
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.
Back to Top
1,671 Rep
Post Options Post Options   Quote Zotged Quote  Post ReplyReply Direct Link To This Post Posted: 08 Jul 2012 at 8:22am
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.

Edited by Zotged - 08 Jul 2012 at 8:24am
Back to Top
2,511 Rep
Post Options Post Options   Quote MastaZavr Quote  Post ReplyReply Direct Link To This Post Posted: 11 Jul 2012 at 11:55am
Thank you!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down