The Big NW.js Roundup - News & Tips

From the Asset Store
Jump over the small square and avoid hitting it as long as you can!
  • Danny can you post a full list of the chromium args you're using?

    Your mentioned chromium args are all fine.

    I'm pretty sure you have the wrong prebuilds or you are not constantly refreshing your canvas. Also keep in mind that you need to add your game as a "non-steam game" and launch it there, if you don't have it up on Steam yet.

  • Whoops, turns out I was using NWJS 0.46.0. I made sure I was using the correct prebuilds (Chromium 83), and have a constantly refreshing canvas (every tick I rotate a 0-opacity object that stays in the middle of the screen). I've tried running it after uploading to Steam and running it as a "non-Steam game". Do you have any other ideas I can try to fix this?

    And to be clear, the game does indeed detect that it's being run from Steam, and achievements work. Just the overlay appears to be borked.

  • Whoops, turns out I was using NWJS 0.46.0. I made sure I was using the correct prebuilds (Chromium 83), and have a constantly refreshing canvas (every tick I rotate a 0-opacity object that stays in the middle of the screen). I've tried running it after uploading to Steam and running it as a "non-Steam game". Do you have any other ideas I can try to fix this?

    And to be clear, the game does indeed detect that it's being run from Steam, and achievements work. Just the overlay appears to be borked.

    I tried with the exact version, prebuild and your chromium args and it works. Is this happening with the Windows release or OSX; Linux?

  • Windows, haven't tried the other two yet.

  • Could you please upload a minimal project for reproduction (package.nw is good enough). You can use "480" as a testing Steam appid. Although it shouldn't matter for testing.

  • Will do when I get a chance, hopefully this afternoon, thanks :)

  • Okay so I tried a minimal project as you suggested and it's still not working.

    I'm using:

    - NW.JS 0.46.0

    - Construct 2 r277

    - Greenworks 0.30.4

    - Chromium 83 .node files

    - Steam SDK 1.42 files

    - steam_appid.txt with contents "480"

    I also had a friend of mine confirm that Overlay is not working for him with 0.46.0 either.

    Here's the package.nw file from my test project:

    https://1drv.ms/u/s!AnfGCnwpFF_Yg6tEj4K8BPNWl5oyaQ?e=YeBjgS

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I found the cause. The "--force-device-scale-factor=1" Chromium arg is messing up something when used in combination with "--in-process-gpu". Remove it and check it out yourself to confirm please.

    Edit: For some reason putting it as the last chromium arg seems to work. I personally still don't recommend the use of it. Same goes for disabling vsync. It will cause screen tearing and possibly more issues, since parts of the Chromium engine heavily depend on vsync.

    (The order of chromium args can also affect how things work. You'd generally want to move more impactful stuff like "--disable-gpu-vsync" for example, to the end of the list.)

  • The Roundup has just been updated!

    Minor changes. Simplified and cleared up some confusing wording. Separated the "Steam Overlay Not Appearing" workaround (specifically: --disable-direct-composition).

    Changes:

    • <Added> How To: Workaround Steam Overlay Rendering Above Window Title Bar
    • <Added> How To: Workaround Game Canvas Not Rendering At All
    • <Improved> How To: Set Your Own Application Icon
  • Hi, I noticed that sometimes the ForceRedraw plugin failed to redraw the whole window.

    That's because the addon changes the CSS values of the <body> tag, but sometimes, <body> doesn't span on the entire window, and so, on Letterbox Integer scale, the bottom part of the window would not get redrawn, and it would cause some tearing effect where the overlay properly redraws up until the bottom of the canvas, and not the black bar under it.

    I fixed it by making it change the css value of <html> instead, and by forcing <html> to cover the entire window at all times.

    Here is the fixed plugin: mega.nz/file/gllGna5D

    Also, even with --disable-windows10-custom-titlebar, the overlay sometimes renders above the title bar (but less often) and when it doesn't, the top part is just cut from the overlay entirely, so the timer and the tip on how to exit the overlay are partially missing.

    Edit: This was all tested with v0.46.0 with the following chromium args:

    "chromium-args": "--disable-plugins --disable-internal-flash --disable-popup-blocking --enable-gamepad --enable-html5-camera --allow-file-access-from-files --ignore-gpu-blacklist --disable-gpu-vsync --limit-fps=60 --disable-devtools --in-process-gpu --disable-direct-composition --disable-windows10-custom-titlebar"
    

    Edit2: I still get tearing with my solution (but a bit less). Not entirely sure why though :/

    I found that by forcing the window to resize by a pixel every frame, or the background color to update every frame, I could get the overlay to work properly, but then, the overlay would slightly flicker in the parts outside the game.

  • Hi, I noticed that sometimes the ForceRedraw plugin failed to redraw the whole window.

    That's because the addon changes the CSS values of the <body> tag, but sometimes, <body> doesn't span on the entire window, and so, on Letterbox Integer scale, the bottom part of the window would not get redrawn, and it would cause some tearing effect where the overlay properly redraws up until the bottom of the canvas, and not the black bar under it.

    I fixed it by making it change the css value of <html> instead, and by forcing <html> to cover the entire window at all times.

    Here is the fixed plugin: mega.nz/file/gllGna5D

    Thanks for providing an updated version of the addon. I'd recommend refeshing for an interval of at least 5sec or more and see of that helps. Maybe you could try to refresh both HTML and BODY at the same time.

    I'll further investigate this and try to find a solution to perhaps, stop Chromium's fps power saving behavior somehow, so that it always renders at 60fps.

    We'll further try to figure out why the overlay workaround doesn't work on your end on Github.

  • Well, I did a ton of testing, and it turns out that changing the CSS doesn't always update instantly the browser. Some optimisation seems to make it very inconsistant.

    I did end up finding a way around that though: Instead of using a timeout, using requestAnimationFrame seems to force the update to instantly update on the next frame.

    Here is a new addon that uses that technique.

    mega.nz/file/Z4cBwABC

    I also went back to updating the body instead of html, and I forced both to cover the whole window.

    One issue I had with only updating for a short while was that the timer (that was partially outside) would start tearing as soon as the plugin stopped the forced rendering to occur. And when closing the overlay, sometimes, there would be residual overlays until i moved, resized, or unfocused the game window.

    What ended up working great however was refreshing every 3 ticks: imgur.com/a/ki77Wi0

    Also, I'd like to mention this issue on github about the windows 10 title bar:

    github.com/nwjs/nw.js/issues/7362

    So people here know: this flag only worked for me when I put it at the very start of the chromium args list.

    Between this and the new forceredraw addon and some other flags shenanigans, we now have a fully working overlay inside NW.js v 0.46.0!

    Here are my chromium args:

    "chromium-args": "--disable-windows10-custom-titlebar --disable-plugins --disable-internal-flash --disable-popup-blocking --enable-gamepad --enable-html5-camera --allow-file-access-from-files --ignore-gpu-blacklist --limit-fps=60 --disable-devtools --in-process-gpu --disable-direct-composition"

  • I've asked a question in their Google Group about the constantly refreshing canvas requirement. Maybe they know of a way to disable the "power saver" FPS limiting feature that Chromium is using.

    I'll get back to your addon, if that leads nowhere.

  • Hey TheRealDannyyy I don't like to bother you, but I really need some advice on nwjs and I wondered if you had any ideas. I know nwjs issues aren't really your problem in any official sense, but I'm so frustrated and don't really know where else to go. The latest upgrade to construct r210 forced me to go upgrade from nwjs 44 and I've had loads of issues with my projects. I really just need to go back to the combo of construct r204.2 and nwjs 44.6

    I figured this would be possible by just using nwjs 44.6 and editing the construct package to point to editor.construct.net/r204-2. This opened as expected, but I ran into an issue - the open local project folder option was gone. If I run editor.construct.net/r204-2 in my browser then open local project folder was there. I checked and the settings are identical on my browser and nwjs. So my question really is this - what could be causing nwjs to not show the open local project folder? I would expect it to be identical to the browser version of the editor? Are there some secret settings somewhere or this just a random construct thing?

  • SecondDimension what are the issues you are seeing in r210 and latest nwjs?

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