Heavy frame loss with NWJS exports

0 favourites
  • 5 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • I'm experiencing a lot of framerate loss when exporting to nwjs and, more concerningly, the project is unable to maintain vsync rates despite hitting well over that target framerate when running in unlimited frame modes for testing performance.

    I've attached some comparison screenshots below. The three shots are different zones in my game with varying levels of stuff going on. The column on the left is running in the editor (Chrome r317.2) with unlimited frames. The middle column is the nwjs export with unlimited frames while the right column is NWJS with vsync (with a target refresh rate of 165hz). I didn't include a screenshot, but running with vsync from within the editor DOES match the target rate.

    As you can see from the pic, even in areas where I'm hitting over 1000 fps, the computer is not able to consistently hit the vsync target, and this only gets worse as the areas get more complex. It becomes really noticeable with camera scrolling, and is causing a jankiness to the camera movement despite the game still running at high frame rates.

    Dropping my monitor refresh rate down to 60 still results in missed frames with vsync on, bouncing down to 56-57ish in a lot of areas. Switching monitors on my main PC had no impact, though interestingly, when I launch the game off my old PC I don't get any frame loss with the nwjs build, despite it being a much older system (Intel i5-4560k). I'm wondering if this is an AMD issue (my main PC is a Ryzen 7 5800x, which should be more than enough to handle this).

    Not sure if it's worth mentioning, but with unlimited frames, the cpu is the clear bottleneck, with gpu only hitting about 10% usage.

    Other things I've tried:

    Rolling back Chromium to earlier builds

    Running it with the NVpatch

    Reinstalling chipset drivers

    Making sure graphics card drivers are up to date

    I'm at a loss as to what else to try. I had a small amount of users mention that the game suffered occasional performance issues during a closed beta, and now I'm wondering if they were experiencing something similar.

    What else can I try?

  • Well that wasn't the response I was hoping for...

    Following up on this. I had another user post a screenshot of the main menu and noticed their frame counter was hitting 56fps. Considering there's hardly anything going on in this section (at unlocked I'm seeing over 4,500fps on this screen), the fact that the nwjs build cannot maintain a steady framerate is pretty worrying.

    This also means that it's not isolated to my PC.

    CPU/GPU usage in this area:

  • Right, so after a bit of help from Mikal over in the Discord channel, we've been able to find the root cause of all these frame drops.

    I'd been using the Construct-Team provided tutorial for getting our games ready for Steam, and one of the things that is mentioned there is that you need to add '--disable-direct-composition' to the Chromium arg line.

    construct.net/en/tutorials/using-greenworks-steam-2853/page-4

    Once I deleted this from the arguments, the frame stutter issue disappeared entirely.

    Laura_D, sorry to ping you over this, but as the author of the tutorial I thought I'd bring your attention to it. It seems that this line is causing some really nasty performance issues on certain machines. From my testing, I've only seen it on AMD-based gpus, but that's a pretty limited pool.

    It sort of creates a bit of a conundrum for Steam exports though. We can omit that line and have smooth games across different hardware types but that limits certain Steam functionality (though from what I can see, does this only stop the achievement icon from popping up... is there anything else it does?).

    Alternatively, we could have a separate 'beta' build for players who have the issue, that they can then opt into (losing the Steam popups in the process). Of course, that assumes that players who experience this issue will actually go to the appropriate forum and make the change themselves which, honestly, is probably not the best way to handle this.

    Also, I get the feeling that this is a separate issue to the performance differences that I mentioned earlier when comparing full frames between in-editor previews and nwjs exports, which VinniePin just started a thread on. I just noticed that frame difference while trying to chase this issue down.

    Also also, I'm aware that this is now falling out of the scope of Construct in the sense that it appears to be an nwjs specific issue. But it's certainly something that's going to affect the majority of Construct users until a proper fix is in place.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think that tutorial is out of date. You only need to tick 'Export for Steam' when exporting - you don't need to modify the Chromium arguments as it now automatically configures it. The 'Export for Steam' setting adds the command line options --in-process-gpu and --disable-windows10-custom-titlebar - it does not set --disable-direct-composition, so I think you can now remove that and everything will still work fine with Steam.

    Overall it would be great if Valve added proper support for NW.js/web games for Steam -the flags it still changes for 'Export for Steam' are only there to work around bugs in Steam, and as always happens, workarounds end up causing their own issues. It's always better to get the underlying issue fixed. However responsibility for that is with Valve.

  • I think that tutorial is out of date. You only need to tick 'Export for Steam' when exporting - you don't need to modify the Chromium arguments as it now automatically configures it.

    Thanks for the response.

    I've been on 317.2 for a while due to the porting process, so never saw that 'export for Steam' button. I'll add those lines manually though and see how things go.

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