The Big NW.js Roundup - News & Tips

7 favourites
From the Asset Store
Jump over the small square and avoid hitting it as long as you can!
  • I assume you meant "--disable-devtools" ....

    Lol - yes - late night copy/paste fail.

  • "> 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • "> 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.

  • > "> 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.

  • 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.

    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:

    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.

  • (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.

    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.

  • 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.

  • 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.

  • 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....

  • 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.

  • TheRealDannyyy I understand. It was just a general statement. Hope Nw or C2 team can resolve this later with new topic.

  • Updated the Roundup with the following change(s):

    • How To: Speed Up The Startup Time Of Your Game By Up To 20%
    • How To: Secure Your Game Assets The Right Way

    Thanks for your suggestions, keep'em coming!

  • Thanks for this wonderful and useful resource.

    Would love to see some detailed information and examples about using NPM modules in games

  • Thanks for this wonderful and useful resource.

    Would love to see some detailed information and examples about using NPM modules in games

    Thanks for your feedback!

    What exactly would you like to know about NPM modules?

    I don't think that I could sum the use of NPM modules better up than the NW.js team already did HERE.

    If there's something specific that you would like to know about, I could try and see if I can make it easier to read and a little more understandable.

  • What I mean is how I can integrate it into a C2 game...

    1) How can I include NPM module in a C2 export?

    2) How can I access methods in NPM module with C2 interface?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)