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

Discussion and feedback on Construct 2

Post » Sat Dec 03, 2016 9:13 pm

TheRealDannyyy wrote:I assume you meant "--disable-devtools" ....


Lol - yes - late night copy/paste fail.
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Post » Mon Dec 05, 2016 12:44 am

"> How To: Only Have 1 Process While Running NW.js (NW.js v0.18.6+)
This is a simple trick that let's NW.js only have one visible process while running.
Having only 1 process can make it easier for recording software to detect your game.
(Important: It might cause some minor drops in your game's performance!)

Image
Open the "package.json" file(s)
Add --single-process to the "chromium-args" properties."

Bandicam is working with this method.

But it stops and proceeds recording again whenever I touch list box.
B
22
S
9
G
9
Posts: 38
Reputation: 6,128

Post » Mon Dec 05, 2016 5:33 am

shinichild wrote:"> How To: Only Have 1 Process While Running NW.js (NW.js v0.18.6+)
...
Bandicam is working with this method.
But it stops and proceeds recording again whenever I touch list box.

Can be related to form elements rendering above the canvas but I'm not sure.
I currently don't know a way to workaround that, I guess there must be some way to "merge" form elements and the game canvas together so that the recording software can detect it right. You can also do your own type of "listbox" by using sprites and text, just an option in case you need a quick solution.

I'll tag you if I find anything useful, glad that you're at least able to record using that method.
ImageImageImage
B
64
S
24
G
78
Posts: 666
Reputation: 45,070

Post » Mon Dec 05, 2016 9:54 am

TheRealDannyyy wrote:
shinichild wrote:"> How To: Only Have 1 Process While Running NW.js (NW.js v0.18.6+)
...
Bandicam is working with this method.
But it stops and proceeds recording again whenever I touch list box.

Can be related to form elements rendering above the canvas but I'm not sure.
I currently don't know a way to workaround that, I guess there must be some way to "merge" form elements and the game canvas together so that the recording software can detect it right. You can also do your own type of "listbox" by using sprites and text, just an option in case you need a quick solution.

I'll tag you if I find anything useful, glad that you're at least able to record using that method.


It just takes a little time to change the listbox object I made. To be honest it only has 3 options. But it'd be pleasure if there is a solution.

By the way, with your method. The utmost thing for Construct 2 had been fixed (in terms of marketing). I hope later NW automatically enable single process. Because I don't sense any performance drop by using it. Or they can make it more stable later.

Ah, one more thing. --disable-gpu-vsync makes physic engine go insane. I think physic is based on vsync.
B
22
S
9
G
9
Posts: 38
Reputation: 6,128

Post » Mon Dec 05, 2016 4:12 pm

shinichild wrote:It just takes a little time to change the listbox object I made. To be honest it only has 3 options. But it'd be pleasure if there is a solution.
By the way, with your method. The utmost thing for Construct 2 had been fixed (in terms of marketing). I hope later NW automatically enable single process. Because I don't sense any performance drop by using it. Or they can make it more stable later.

It's showing some really weird behavior to some users, I've had two people in Discord PMing me about minor drops in performance already.
Of course to confirm this I did my own measurements and they turned out to be positive, meaning that you have 1-5% worse performance using single processing.
There is also an issue were --single-process would crash while starting the preview, there's no way to reliably reproduce this yet.

shinichild wrote:Ah, one more thing. --disable-gpu-vsync makes physic engine go insane. I think physic is based on vsync.

That's weird, did you make sure that all of your physics based ACE's have "* dt" in them?
If you did that and it's still going insane, please upload an example capx and share the link with me.
I'll report it straight to Ashley, maybe he forgot to add dt inside the behavior itself.


EDIT: After giving the "dt" tutorial a read again I've found the following:
Ashley wrote:Note that Physics is an exception. By default it does not use dt, and therefore is framerate dependent. This is because dt usually has small random variations. These variations can make the same setup in a physics game give different results even if exactly the same thing is done twice. This is often annoying for physics games, so by default it is framerate dependent. However, you can enable use of dt by using the Set Stepping Mode physics action on start of layout, and choose Framerate independent. Note in this mode it still clamps the maximum timestep for physics to 1/30 (about 33ms), because using a very large timestep can cause instability in physics simulations.

Please make use of the highlighted part, if you still experience issues with that please upload an example capx and share the link with me.
Last edited by TheRealDannyyy on Mon Jan 16, 2017 11:59 am, edited 1 time in total.
ImageImageImage
B
64
S
24
G
78
Posts: 666
Reputation: 45,070

Post » Mon Dec 05, 2016 4:29 pm

TheRealDannyyy wrote:(I think it has something to do with using --in-process-gpu in combination with --single-process.)


Maybe, I don't need Steam overlay yet.

TheRealDannyyy wrote:That's weird, did you make sure that all of your physics based ACE's have "* dt" in them?
If you did that and it's still going insane, please upload an example capx and share the link with me.
I'll report it straight to Ashley, maybe he forgot to add dt inside the behavior itself.


I didn't use that method. But I need to use it from now.

Hm... it'd be better if default of Physics is based on dt rather than frame rate in future version.

P.S I just decreased the value of Physics rather than set all things dt dependant. It works well.
Last edited by shinichild on Mon Dec 05, 2016 5:14 pm, edited 1 time in total.
B
22
S
9
G
9
Posts: 38
Reputation: 6,128

Post » Mon Dec 05, 2016 5:01 pm

@shinichild actually it is for a better accuracy that it's like this (so the physic simulation is always the same), but I agree that it breaks up with vsync off or with different refresh rate (a 120Hz monitor will make the physics go twice as fast) and so does not make a lot of sense in a game, the quickfix (set stepping mode) by therealdannyyy is the way to go for you I think, keep in mind it might still be a slight different result depending on the refresh rate.
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 05, 2016 5:07 pm

@Aphrodite Maybe C2 automatically calculates? I've seen some physics games that use vsync on or off option. Unless the dev fixed every single number of physics for vsync on off there must be something else.
B
22
S
9
G
9
Posts: 38
Reputation: 6,128

Post » Wed Dec 07, 2016 2:14 am

These are some results after I've working around with physics without vsync.

1. The random calculation is actually pretty big if your game is physic based. For example, my game, enemy uses jump attack (of course using physic action) and mostly they remain in the screen safely. However, sometimes it flies away from the screen like it had a rocket behind it. I just put only one apply force event for them.

2. After disable vsync, normal physics is being calculated randomly as well. And it requires too much number. It was like 1000 physic force before, but I needed to multiplies it seven times in order to make sense. So 7000, it's really pretty big math.

There must be some stability update in order to make dt based Physics does not calcurate random number much. Otherwise all games deal with Physics switched off vsync will face some frustration for players.

P.S I think the physics goes faster when memory being used a lot. And slower when it doesn't.

P.S 2 Funny thing is bullet behaviour's physic(gravity) works well no matter I've messing around. Of course, there is some random gravity. But it's only small, unlike physics. This should be true random calculation standard....
B
22
S
9
G
9
Posts: 38
Reputation: 6,128

Post » Wed Dec 07, 2016 5:31 pm

shinichild wrote:These are some results after I've working around with physics without vsync.
*results here*

I think a new topic for this would be nice. I'm not really the guy that can fully explain you why things behave that way.
Feel free to "tag" me to your topic, if you decide to open one up of course.
ImageImageImage
B
64
S
24
G
78
Posts: 666
Reputation: 45,070

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: Baidu [Spider] and 11 guests