Best practices for building levels

Discussion and feedback on Construct 2

Post » Thu Oct 31, 2013 6:56 pm

You really shouldn't use the tiled background object for filling the screen with a single color.

You should either of the following:
> use the background parameter (in layer properties) to fill the screen with the color you want
> create a layer that doesn't scroll (don't remember how exactly, might have something to do with parallax settings (0?)), have a 1x1 pixel image of the color you want added to it, then stretch it to your screen size (point sampling might give you better results)

And contrary to the beliefs of the guys here, i'd say that you should go with slicing up your image into smaller parts, here's why:
i read on one of the threads you can find here that the objects that are off-screen are not drawn, therefore don't take up some of the time needed for rendering a frame (however the images are still in memory, so there's that), which means that if only a certain part of your whole level will be visible at a time, the images that are off-screen won't take up the systems' resources and you should, in theory, have better performance than if you just used a single huge image. Or something... /speculation

Using a plain color background would still be faster than using a sprite... :/

If you'd like to know more about the performance optimization, i made a thread recently, where i asked for feedback from others on my views, but it appears that it's gotten buried now.
Here it is: http://www.scirra.com/forum/optimizing-a-game-for-mobile-platforms-your-tips_topic78778.htmlStiivais2013-10-31 18:57:52
B
10
S
1
Posts: 163
Reputation: 1,436

Post » Thu Oct 31, 2013 9:07 pm

Thanks, I'm going to do some experiments tonight and see what I can figure out. I'll report back soon.

The game will be similar to Castlevania. It will be combat focused and somewhat difficult, so I don't need huge levels. I just want to make them look good, and not find out that it won't run at all on cell phones. I mean, I guess releasing on Steam only or whatnot would be fine, but I'd like to have options.

I'm also looking into a program called Spriter to see if that would help optimize animations for characters.
B
82
S
30
G
35
Posts: 340
Reputation: 23,071

Post » Fri Nov 01, 2013 12:15 am

FYI. In the Project properties. You can set it to NOT DRAW background. If your going to fill the entire scene with your own images. Then don't bother filling the background with a draw call.

It hurts mobile performance to waste the render since most mobile for C2 is render by pixel amount. As a suggest think of the situation like this. if you can draw 3 times the screen resolution. Then rendering a coloured background is 1/3 of your render allocation. Not only that it's 1/3 you never see since then you cover it with images.

Also for rendering large sprites for backgrounds. make sure your images are not larger than the render speed. As someone pointed out that 2024x2024. however make sure your mobile targeted device supports that. You might find it's only 1024x1024 and then your hurting for rendering images too large still.

However for whatever you target on your mobile device will just burn through on a desktop. So while rendering 1024x1024 is your target for mobeil(don't qoute me that as truth. This is just theory) is great. The desktop will just eat that up and no effective loss of performance. As performance is so much more anyways.

TEST ON MOBILE. Every notable change. TEST ON MOBILe.
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Post » Sat Nov 02, 2013 5:34 pm

I need to get my pc set up to allow me to test on my cell phone. I may have to uninstall Zonealarm firewall. It may have been causing problems.

My main thing for now though is just at least making sure it runs on pc's pretty well. But to be safe, I'd like to at least test a little on mobile.

My phone is a Nokia Lumia 920.

I just got Spriter. It's hard to decide what to focus on when everyone keeps announcing updates.

I think I will go ahead and do my main character. I had planned to spend the rest of the month doing the rest of the characters in the game, and then next month doing the levels.

jayderyu, as far as not filling the background I have it set to "clear background: no" I don't know if that's what you meant or not.
B
82
S
30
G
35
Posts: 340
Reputation: 23,071

Post » Wed Nov 20, 2013 9:59 pm

After doing some experimenting, here are a couple things I've noticed (possibly).

1. Image size is more important than sprite size. In other words, a small 100px image enlarged to 500px in C2 is better than a simply using a 500px image.

2. Copying and pasting a sprite does not seem to add to memory use, but does add to object count. So, we should still be careful how many objects we use even if they are the same sprite copied and pasted.

Does this seem correct?
B
82
S
30
G
35
Posts: 340
Reputation: 23,071

Post » Sat Jul 19, 2014 9:20 am

Speaking from experience only:

Yeah, that's about right. Small images help, but remember that you're not so limited on image size with the sprite object as some people may think. Sure, don't make them huge if you need to work with mobile. But if you aren't working with mobile 500px is a fine size. Of course smaller sprites help but it's not too big. Also, sprite object doesn't require you to use power of two for performance. It might help on mobile, but on PC or console it shouldn't be a problem.

Copying and pasting a sprite is fine, it does add to your object count but doesn't blow your memory. Think of it as in a platformer with a section of tall swaying grass. We'd make a sprite of a small bundle of grass, make it sway with sinus curves and paste it all over the ground.
Testing the level, while standing i the grass so it's all visible might affect your fps, depending on how many you put in there. If you walk away from a grassy area (just move so all the objects are off screen) you'll already experience a boost in fps.

I feel like I'm repeating what other people already said, but I guess it can't be stressed too much.

Sum:
1. sprite object size isn't a big problem on PC
2. Object count might be high, but since only things onscreen affect performance you don't have to limit your object count...

End note:
I have experienced performance issues with sprite size and object count though, but that was mainly when I went totally overboard.
B
11
S
2
Posts: 5
Reputation: 1,309

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests