250 Sprites + Animation = 12 FPS Drop

Discussion and feedback on Construct 2

Post » Mon Dec 23, 2013 1:04 pm

I want to start this off on a good note and say I'm constantly impressed by C2's ability to get things done compared to, say, MMF2, even if I'm complaining below.

I don't have a very good video card (ATI Radeon 5450) but I don't think 250 sprites being animated on screen at once should drop my FPS by 12 even with my video card being mediocre. Yes, I constantly update my video card to the latest drivers hoping and praying the FPS will be 60 in the game I'm working on but my hopes are always dashed. I know it's the animation doing this because I have stopped it before and my framerate jumps back up drastically.
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Post » Mon Dec 23, 2013 1:12 pm

@corlenbelspar :

could we have more details about this?

(Resolution of the sprites, number of frames, speed of the animations, are all these sprite the same or are they different sprites?, does they have effects or behaviors to them?)

I think 250 sprites on screen are quite a lot, but to some extend, I can imagine contexts where this can be needed for decoration.

If all animations are not needed, you can try to do a compatibility mode to ensure best performances can be obtained at the cost of less animated stuffs(It is a suggestion though).
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Mon Dec 23, 2013 2:26 pm

What is size of your sprite?
B
99
S
35
G
29
Posts: 3,139
Reputation: 28,421

Post » Mon Dec 23, 2013 2:45 pm

Is it the same across all browsers? Which browsers have you tried?

It may be that your graphics card is known to have security/stability issues, and has reverted to software rendering, so it's not even using the graphics card. In Chrome you can go to chrome://gpu to check what the status of hardware acceleration is.

Also, if you are making a minimal test project, note that if nothing moves or changes then the screen is not redrawn. So you will artificially get 60 FPS because it's not actually rendering anything. As soon as things start moving/changing, it will be rendering the screen and you'll get a real framerate measurement.

If you share your .capx we can take a look and try it on our own systems. On a high end desktop it should be possible to get thousands of objects on-screen at once.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,351

Post » Tue Dec 24, 2013 12:01 am

The resolution if 854x480, sprites are 32x32 with 4 frames and an animation for each direction they move, which is the standard four directional. They have some effects and behaviors but these are usually disabled most of the time.

We're using Node-webkit. Firefox usually runs much slower for me so I try to avoid using it. I thought it was my video card but I checked in the game and in that site you linked to Ashley and it said I was running under hardware acceleration.

The moving of the sprites themselves doesn't effect my framerate, it's just when they're animated that things take a turn for the worst.

I will make a demo CAPX and see if I can replicate the issue for my computer here in a bit. I have to leave right now so it might be a few hours.

Thanks for inquiry into my issue. :)
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Post » Tue Dec 24, 2013 7:31 am

Hmm... I'm trying to recreate the issue in a blank CAPX but even when I generate 250 enemies multiple times that all move and are animated, the framerate mostly stays at 60 except where it drops to around 44 for a few moments seemingly at random.

Oh well, here's the CAPX of what I'm doing in the blank one.

https://www.dropbox.com/s/rkj55zeidn6dwrf/enemyconundrum.capxcorlenbelspar2013-12-24 07:33:18
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Post » Tue Dec 24, 2013 8:03 am

I don't see any problem (expect mobiles)

online demo

I change some things in your capx and now it work with 60 stable FPS on Chrome and FireFox even with 1001 objects. (On my old mobile device 12fps with 250 objects)

Don't forget about optimization. See at project settings - Clear background , Pixel Rounding , etc.

The capx
B
57
S
19
G
10
Posts: 191
Reputation: 9,636

Post » Tue Dec 24, 2013 12:10 pm

here no problem too i' made some change to see object count ect..

more than 4000 sprite on chrome/firefox/opera (webgl) at 60fps

more than 8000 sprite on nodewebkit (webgl) at 60fps

if you target computer nodewebkit is awesome :)
B
85
S
14
G
6
Posts: 72
Reputation: 7,237

Post » Tue Dec 24, 2013 7:02 pm

I seem to recall if your card is blacklisted, chrome lists it's using hardware acceleration even if it's actually using swiftshader (because swiftshader is emulating hardware acceleration). Try running chrome with the blacklist disabled, if the performance improves, you know it was using it. That's the only way I know of to get chrome to reveal if it's actually using swiftshader or not.
Moderator
B
95
S
34
G
33
Posts: 3,007
Reputation: 27,876

Post » Tue Dec 24, 2013 11:41 pm

I can't test the actual game in a browser because it uses Node-webkit functions essential to the game's runtime. Is there any way to set this option for Node-webkit if it even exists for it?
B
45
S
13
G
1
Posts: 236
Reputation: 4,010

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests