Guide: Fix Jank in r190+ Node-Webkit Export

Discussion and feedback on Construct 2

Post » Fri Nov 28, 2014 12:38 pm

C2 exports an html5 page, that is entirely controlled by javascripts files, and as far as I know, unity support something ressembling to javascript to script inside it, but it is a "holemade" version with its own particularities.

Also it is basically the way the interpreter interprets the javascript that cause that, the problem would still be the same, as there are not a unique JS to native compiler. Even if there was, C2 would still have to support the browsers also, so we cannot plain ignore this issue that happens also in some versins of chrome.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Fri Nov 28, 2014 1:36 pm

If we made our own exporters, it would amount to writing a new browser engine, which companies like Google do pretty well already. Also even if we somehow had the resources to take on Google's thousands of engineers, the result would likely be far poorer quality than what is already available. Consider how many bugs and missing features there are in Canvas+.

This is an awkward time where a Chrome bug got inherited by node-webkit which is on a slower release cycle. It will inevitably be fixed though. I understand the frustrations, but one bug with a fix on the way isn't an argument to reinvent the wheel!
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,228

Post » Fri Nov 28, 2014 2:26 pm

Unity uses C#, Boo and a variant of JavaScript and as far as I know it doesn't need exporters like Node-Webkit.


The scripts that unity uses are not running directly "on the desktop" after export. They merely are an easy way to script your game within the engine. In the end, the regular unity C++ engine core runs on the desktop, and executes what you scripted on top of it.
B
72
S
28
G
32
Posts: 477
Reputation: 19,640

Post » Fri Nov 28, 2014 8:13 pm

Back on topic, a quick update:

You can get the old node-webkit (0.10.5) at this address:

https://github.com/rogerwang/node-webki ... d-versions

The only drawback is that the "dxwebsetup.exe" file is not included. This isn't actually a part of node-webkit, but it's an installer that's packaged with node exports from C2, and C2 places it in the same folder. If it isn't installed, the export may run in canvas2D mode.

However, this file is already in the new "NodeWebkitForC2" folder, and it has the same hash values as the file from r184, so I must assume it's identical.

There is also one extra file in the webkit download from github: "nwsnapshot.exe". This doesn't need to be copied over.

tl;dr: If you've already installed r190, just download the windows 0.10.5 version of node, and replace the files in 'C:\Program Files\NodeWebkitForC2\win32' with the ones from 0.10.5, making sure to leave "dxwebsetup.exe" in the folder.

If you're still on r184, it's easier to go about it the way outlined in my original post.

I'll update the main post when I can.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

Post » Sun Nov 30, 2014 12:41 am

Main post updated. If you're already on r190, just download the correct node-webkit files by themselves, rather than re-installing r184 to get them. See main post for full details.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

Post » Wed Dec 03, 2014 1:12 pm

Just tried this and it fixed all my performance issues. Thanks man!
B
29
S
9
Posts: 355
Reputation: 2,936

Post » Sat Dec 20, 2014 6:50 am

Joannesalfa wrote:@TiAm Have ever you added "chromium-args": "--disable-gpu-vsync in package.json? You shouldn't have wasted your time.

I've tried to compare...
A= node-webkit without --disable-gpu-vsync
B= node-webkit with --disable-gpu-vsync:

A= runs smooth in start, then some seconds later, it starts to look Jerkiness in overtime, sometimes it appears smooth motion but not longer.
B= runs smooth in start, no sign of Jerkiness in overtime, but there is mild jerkiness, looks kinda stable but not perfect.

I believe B would be workaround to reduce jerkiness.

Judge yourself.


Tried option B in the latest NW, stutters are reduced but still present, very sporadic. It's frankly too distracting to enjoy any game when it happens.

Reverting back to NW 0.10.5 resolves the issue and its very smooth. The problem is the Greenworks plugin v3 alpha for 0.10.5 doesn't have the Steam Overlay function, only the newer Greenworks v4 (which only works on NW 0.11.x!!) has it.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,609

Post » Sat Dec 20, 2014 7:47 am

I learned my lesson about jumping to conclusions, it's time you did aswell.
B
8
S
2
Posts: 134
Reputation: 1,001

Post » Sat Dec 20, 2014 8:20 am

@Silverforce

On my system, this is still an issue with the latest version of Canary. When V-Sync locks correctly, it's excellent, nearly as good as IE. But it seems to randomly malfunction, causing a terrible stutter every 2-3 frames. Resizing the window usually fixes this, but this glitch has persisted for over a month now.

Chrome v39 is better than 38, but it's still not as smooth as a well behaved instance of canary, much less IE.

It's looking like we are a long way from a smooth running version of node, short of using 10.5. :(
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

Post » Sat Dec 20, 2014 10:08 am

How would I go about replacing the osx and linux exporters with the 10.5 version? I replaced the win32 version, and that runs smoothly now. I'm under the impression that osx and linux still run jittery, and I want to fix this as I plan to be releasing a game soon.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

PreviousNext

Return to Construct 2 General