Rendering and performance questions

Discussion and feedback on Construct 2

Post » Tue Oct 06, 2015 8:01 pm

So, after reading the post Ashley did about how WebGL renders, I started making each texture spawn on a different layer. I also read somewhere that rendering multiple layers, in itself, takes some memory for each layer. Is this accurate? I'm trying to optimize my game, a space shooter. I've read all available articles on optimizing and tried to put as many of the tips into play as possible. I also read about power of two textures. Will that give a decent performance boost if you only use PO2 sprites?
Image
B
12
S
2
Posts: 91
Reputation: 862

Post » Tue Oct 06, 2015 8:16 pm

space shooter you say? do you have particles in your game? i've noticed they reduce performance greatly if you have a lot of them.
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 » Tue Oct 06, 2015 8:33 pm

I do have some particles. Only spawn 20 at a time and they fade quickly.
Image
B
12
S
2
Posts: 91
Reputation: 862

Post » Tue Oct 06, 2015 8:35 pm

20? as in their rate is 20? or 20 objects with some x rate?
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 » Tue Oct 06, 2015 8:47 pm

20 total objects. It only spawns when power ups are gained, fairly infrequently.
Image
B
12
S
2
Posts: 91
Reputation: 862

Post » Tue Oct 06, 2015 9:08 pm

how much is their rate? it's usually how many particles times their rate = extra obj on screen.
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 » Tue Oct 06, 2015 10:51 pm

Single shot.
Image
B
12
S
2
Posts: 91
Reputation: 862

Post » Wed Oct 07, 2015 5:34 am

For mobiles or PC? If PC then you don't really need to worry.

For mobiles, it's important to test early and often on your devices. Layers aren't an issue, it's sprite count including particles but also what you are doing code-wise, ie. static sprites aren't an issue but if you manipulate a lot of them often, it will lag on mobiles.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Wed Oct 07, 2015 6:30 pm

Yes @Silverforce - it's android export of my game that I'm working on right now. I'd like to message you to ask you some questions of you didn't mind but it says that I need 500 rep first. I've seen lots of your posts in most of the discussions I've been reading. I'm not a techie but still trying to make my game as good as possible before I publish it.
Image
B
12
S
2
Posts: 91
Reputation: 862

Post » Thu Oct 08, 2015 12:31 pm

Layers with 100% opacity, normal blend mode, no effects, and without "force own texture" enabled have effectively zero memory overhead. Changing any of those will cause the layer to render to an intermediate texture, which has a memory and performance overhead.

You should basically ignore the power-of-two size issue. The C2 engine handles it internally by assembling all images on to spritesheets which are themselves a power-of-two size. In fact the optimal size for a sprite is two pixels less than a power of two (e.g. 126x126, 62x62 etc) due to padding on the spritesheet, and the worst size is an exactly power of two size since it will pack least efficiently! So at least for sprites, just ignore powers of two and use whatever size is convenient.
Scirra Founder
B
400
S
236
G
89
Posts: 24,546
Reputation: 195,471

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests