Node-webkit Runs 10 FPS slower when exported

Discussion and feedback on Construct 2

Post » Thu Oct 17, 2013 11:31 pm

I didn't know where to post this so I figured general discussion was as good a place as any.

As the subject says, we've optimized our game finally where it can handle 250 enemies on screen with the game still running around 50fps in node-webkit preview. The problem is, when I export the game to node-webkit to be ran independently, I only get around 40fps in that. What is the issue here? My friend who is the other programmer doesn't have this issue.
B
44
S
12
G
1
Posts: 231
Reputation: 3,875

Post » Mon Oct 21, 2013 1:31 pm

Computers work in mysterious ways.

Same reason why the recent Total War Rome 2 game runs fine on my old Laptop but not my Nvidia Titan powered desktop.
B
10
S
3
Posts: 233
Reputation: 1,537

Post » Mon Oct 21, 2013 1:44 pm

Probably resolution. C2 stretches the game window if you use fullscreen, so a lower resolution makes the game faster.
B
122
S
42
G
40
Posts: 846
Reputation: 27,994

Post » Mon Oct 21, 2013 5:39 pm

I've noticed this same problem. Not sure it's a resolution problem either...
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Mon Oct 21, 2013 9:03 pm

Look into turning off behaviors/functions for sprites that are off-screen, maybe?

I've been able to keep my game locked at 60fps at 1920x1080 with over 400 enemies in 1 level, as well as over 20,000 sprite tiles to make up the level artwork that get copied into a few canvas objects, so they're not all separate objects for C2 to track. This is on a 6 or 7 year old machine I use for testing with only an nVidia GTX 460. The main way I was able to do that (other than prodigious use of the canvas plugin) was by disabling any functionality for everything off-screen, including turning off any particle systems/webgl effects.

In fact, it actually runs FASTER when exported to an .exe through Node-Webkit; I only get between 45-55fps when testing in the browser, though it weirdly runs at a higher fps in-browser when full-screen and I'm at a loss as to why.digitalsoapbox2013-10-21 21:07:26
B
70
S
40
G
24
Posts: 518
Reputation: 20,070

Post » Mon Oct 21, 2013 9:32 pm

Yeah it's a bit weird because you'd think the node-webkit preview would work the same as the exported version since it's running a node-webkit instance when you do preview.

I'm not entirely sure if it's resolution myself. We increased the resolution from 640x480 to 854x480 (a 16:9 resolution) and it only impacted performance a tad because of our beta level stress test enemies since there were more of them on screen.

@digitalsoapbox That's very impressive that you pulled that off, I'm not going to lie. Maybe our best bet would be to make use of Canvas since I've made a ridiculous amount of effort along with the other programmer to turn off everything off screen.
B
44
S
12
G
1
Posts: 231
Reputation: 3,875

Post » Wed Oct 23, 2013 7:17 am

@corlenbelspar

That would be my suggestion. The Canvas plugin been a lifesaver in terms of keeping the framerate as fast as possible.

Also, what kind of video card do you have? Some cards handle things better than others.digitalsoapbox2013-10-23 07:18:40
B
70
S
40
G
24
Posts: 518
Reputation: 20,070

Post » Wed Oct 23, 2013 7:24 am

I have an ATI Radeon HD 5450 and I already updated it to the latest beta driver available which actually gave me 10FPS more in performance.
B
44
S
12
G
1
Posts: 231
Reputation: 3,875

Post » Thu Oct 24, 2013 4:42 pm

@digitalsoapbox Nice! I'm really wondering how you use the canvas plugin to deal with so many objects. This is very interesting!!!!! (and by the way can rescue my game fps...)
Need a tutorial !! ;)
B
70
S
21
G
12
Posts: 314
Reputation: 12,061

Post » Fri Oct 25, 2013 7:25 pm

@KaMiZoTo:
A majority of the sprites in my project don't need collision since they're part of the level artwork, so after they're created - and if they have no collision needs - I paste them into a Canvas and delete the original, as it's no longer needed. 19 layers of tiles get comped together down to 4 Canvas objects - it could go down to less, but I wanted some parallax movement & foreground/background layers. For objects with collision, I have a separate layer set up that handles all collision for static objects, and the sprites themselves receive collisions for things like exploding objects.

The way I've got it implemented is a little specific to the type of game I'm making (see below), but if you have any pressing questions I'd be happy to answer them. Maybe send a PM so we don't hijack this thread, or start another elsewhere so everyone can benefit from any discussions.

In map editor:


In game (alpha art & gameplay):
digitalsoapbox2013-10-25 19:25:55
B
70
S
40
G
24
Posts: 518
Reputation: 20,070

Next

Return to Construct 2 General

Who is online

Users browsing this forum: Colludium, Yahoo [Bot] and 1 guest