How do I use render cells

Get help using Construct 2

Post » Sun May 10, 2015 12:24 pm

so i'm checking out some stuff in C2, and i was wondering if i have a 5x layered layout
and layer 5 is GUI (a couple of static objects with collisions off, everything else transparenT) should i use render cells on it?
also a layer where you have 2x3x5 blocks of 256x256 sprites (cloned) - should that layer use render cells too? (no collisions on that one too).

problem is i can't test that because too powerful pc :/ always maxed whatever i do.
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,450

Post » Sun May 10, 2015 12:35 pm

From what you are saying I don't understand why your pc wouldn't be able to handle it, could there be other issues?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun May 10, 2015 1:03 pm

you didn't understand my question.
my pc can run both version (with and without render cells) at the same speed - 75FPS stable and cpu usage for both around 1.3%, so i can't see which version is better for these layers i've described up there.
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,450

Post » Sun May 10, 2015 1:12 pm

If there is no difference, why would one be better than the other?

When to use it?
Given the trade-offs above, the ideal case for render cells is when using large layers with lots of static objects. Remember unlike collision cells, this can include parallaxed layers. For example an ambitious game may involve thousands of scenery objects strewn across a huge layout. Providing few of those scenery objects ever change, then enabling render cells for the layer should save a lot of work checking whether or not thousands of far-away objects are in the viewport.

Remember render cells can be enabled or disabled for individual layers. So you can enable render layers for a "static" background layer with rarely-moving scenery objects, and leave them disabled for other layers where lots of action happens with moving objects.

When to avoid it?
Any layers with lots of changing objects - either creating, destroying, moving or changing Z order - will probably incur more extra work than is saved by the cheap viewport checks. Also single-screen games should definitely not use render cells, since there is never much off-screen that needs skipping! The game will only be burdened with pointless extra work. In these cases using render cells could actually reduce the framerate.

As ever, the key is to measure performance. If it's right for your game, you should be able to identify a measurable improvement to the framerate or CPU utilisation as measured by Construct 2. Don't turn it on assuming it will be faster - it could in fact be slower!
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon May 11, 2015 10:46 am

You should read the blog post on How render cells work, which goes in to some detail on when you should and shouldn't use it.
Scirra Founder
B
400
S
237
G
89
Posts: 24,550
Reputation: 195,527


Return to How do I....?

Who is online

Users browsing this forum: minigame, tannerdler, zenox98 and 7 guests