[UPDATED: 11.12.2017] The Big NW.js Roundup - Tips & Tricks

Discussion and feedback on Construct 2

Post » Fri Feb 03, 2017 2:26 am

Nabu0001 wrote:@TheRealDannyyy, thanks for the reply,

I just released a game in alpha stage on itch.io and found jerkiness problems with the Node Webkit export.
https://nabu.itch.io/ultimate-barbarian

Heres my specs :
- NW.js 0.20.0, the last one
- I7 3630QM 2.40 GHz
- GeForce GTX 660m
- OS is Windows 7 SP1

The game has 20 to 200 sprites on screen with about 100 average, and some shaders. The stutters occurs about every second whatever happen on screen, in cpu intensive times or not. Average CPU usage is 30%, up to 50% some times, with less than 10% for the engine and the same for draw calls, the rest being logics. The preview under Chrome and HTML5 export works smooth on various browsers. Only NodeWebkit export is jerky.

I found the stutters are almost invisible running the application with my Intel integrated graphic card 4000, although a lot more visible and annoying with the GTX 660m.

I also tested the game exported with NW.js on a low end computer and it worked well and smooth.


This is a very common with NV graphics on laptops. NV's drivers detect "browser" and puts the GPU into idle mode to save power usage. It's very aggressive, resulting in very low power for browsing. But because C2/NWjs is Chromium based, it thinks our games are browsers..

This can be fixed (in the past, not sure now) by setting a power profile in windows or NV's control panel to "Maximize performance" instead of "Balanced" or the default option.

Exceptions or game-specific profiles can also be made with the NV control panel.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Tue Feb 28, 2017 2:24 am

Silverforce wrote:This is a very common with NV graphics on laptops. NV's drivers detect "browser" and puts the GPU into idle mode to save power usage. It's very aggressive, resulting in very low power for browsing. But because C2/NWjs is Chromium based, it thinks our games are browsers..
...

This should no longer be an issue in the upcoming NW.js v0.21.0 release, judging by this confirmed fix: https://github.com/nwjs/nw.js/issues/5732.
ImageImageImage
B
69
S
24
G
78
Posts: 695
Reputation: 45,332

Post » Mon Mar 06, 2017 7:41 am

Hey I'm new to working with nwjs and I have some questions about how to manage display size.

Is it possible to resize the game window from in the game, from a settings menu for example or alternatively on start of the game?

Just say my game's window size is 240 x 160. Can I make the game window scale up to be 720 x 480 for example?

I thought 'Set Canvas Size' might do it, but it doesn't change the size of the game window.

It seems like, the only way I can resize the game window is by using the mouse to drag out a corner. And beyond that I can have the game open at its set window size (240 x 160) or fullscreen via the Browser > fullscreen action. But I can't specify a different window size?

Is that the deal, or I just havent found the right tutorial yet?

I had plans to make a 'Display Settings' menu screen, where the player could choose from preset sizes like 720x480, 1200x800... that kind of thing, and the game window would resize accordingly..
B
75
S
52
G
62
Posts: 406
Reputation: 39,105

Post » Mon Mar 06, 2017 6:22 pm

Artpunk wrote:Hey I'm new to working with nwjs and I have some questions about how to manage display size.
Is it possible to resize the game window from in the game, from a settings menu for example or alternatively on start of the game?
...

Already tried the "Set width; Set height" actions, found inside the NW.js plugin?
If you're however asking for something like a traditional "resolution change", I don't think that it's possible since C2 is using a more modern scaling method for that.
ImageImageImage
B
69
S
24
G
78
Posts: 695
Reputation: 45,332

Post » Mon Mar 06, 2017 11:57 pm

TheRealDannyyy wrote:Already tried the "Set width; Set height" actions, found inside the NW.js plugin?

This is what I was looking for. Thanks @TheRealDannyyy :D
B
75
S
52
G
62
Posts: 406
Reputation: 39,105

Post » Tue Mar 14, 2017 2:54 pm

I see NWjs v 0.21.1 is available for download, anyone tried it already?
Image
B
82
S
30
G
12
Posts: 517
Reputation: 12,763

Post » Tue Mar 14, 2017 11:07 pm

Lof wrote:I see NWjs v 0.21.1 is available for download, anyone tried it already?


It works fine, but i'm on 0.22 now 8-)
B
66
S
22
G
4
Posts: 360
Reputation: 6,584

Post » Wed Mar 15, 2017 12:21 am

Lof wrote:I see NWjs v 0.21.1 is available for download, anyone tried it already?

I tried the beta/nightly builds and they were pretty solid.
Sadly it looks like they couldn't include THIS in time, would've been helpful for gamers with laptops.
They also fixed an issue with single processing, I will silently update the roundup soon.

Generally speaking, Chromium v57 comes with the usual under-the-hood performance and stability tweaks and nothing really interesting for us C2 Dev's.
WebAssembly is now enabled by default, I hope that we'll see C2 or at least C3 supporting it in the near future.

Yeah that's pretty much everything for this update cycle, NW.js is doing great over the recent couple of months.
My personal highlight this year would be an API to make use of gamepad extensions.
It's a minor feature which would make it possible to access rumble features of certain gamepads.
ImageImageImage
B
69
S
24
G
78
Posts: 695
Reputation: 45,332

Post » Wed Mar 15, 2017 12:36 am

The AMD/NVIDIA thing is just brilliant, is it in rev 0.22 beta1 afayk?
B
66
S
22
G
4
Posts: 360
Reputation: 6,584

Post » Wed Mar 15, 2017 1:11 am

Danwood wrote:The AMD/NVIDIA thing is just brilliant, is it in rev 0.22 beta1 afayk?

I've asked them about the current progress, let's hope we'll get a response soon.
EDIT: Got a response in less than 5 minutes, just amazing. ( Image )
ImageImageImage
B
69
S
24
G
78
Posts: 695
Reputation: 45,332

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: dcadjust and 15 guests