Electron as alternative export to nw.js?

1 favourites
  • 4 posts
From the Asset Store
Template for an alternative to falling shapes, fully documented in comments and video
  • Ashley,

    I applaud your work on webview2, definitely an interesting export possibility (especially as your epic and steam work come to fruition and hopefully macos support soon becomes available.)

    I did see a reference on the Discord community that you are still also working some on nw.js, looking at NAPI issues with nw.js. I have run into similar issues with nw.js, difficult to get native binaries working with nw.js. I am referring to this discussion: groups.google.com/g/nwjs-general/c/5KAAGsjEALg

    On the other hand electron has been more stable for activities like this (using NAPI and native binaries with node across versions) and I have seen folks use electron for publishing html5 games, including on Steam. For example, in this case they use steamworks.js (rust based library which creates node binaries and js to allow html5 games to work with steam.) It also uses NAPI, so fewer version issues over time.

    github.com/ceifa/steamworks.js (which in turns use napi-rs to have a napi interface to node)

    So, just a suggestion, but it might be interesting to look at electron instead of nw.js for export (in the past a community member was creating a build system for electron and C3, that some games used to release to Steam (in those days they were using Greenworks as an interface to Steam)

    I imagine an electron addon may also be needed, but at least a lot of the nw.js addon functions are now possible using normal web sdk (e.g. file access).

    Another somewhat interesting package for both nw.js and electron is koffi.dev/, I have had some success using this to use js to interface directly with the steamworks dlls and do Steamworks init and get user info, though it seems like they are some issues with calling certain dll functions, probably because I am still figuring out the details.

    Note: Electron on MacOS still does not support Steam Overlay (same as MacOS nw.js).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • +1 for Electron

    I like both, and I've shipped games with both also, but I had a easier time using Electron (with ElectronForConstruct ) then NWjs last year.

    That being said, NWjs was also very outdated last year - and it seems the new Greenworks plugin is updated to use the latest version - but I agree with Mikal that still it would be better than NWjs.

    Just by Googling we can compare apps made in NWjs and Electron and it seems Electron has the upper hand.

  • I'm sure it would be quite a bit of work to add Electron support, it would need on-going maintenance, probably bring its own various quirks that would have to be dealt with, and architecturally it's basically the same as NW.js - it's the Chromium browser engine with node.js integrated. So I don't think it's worth it. Regardless of the outcome of my experiment with a node native addon, I'd rather focus on WebView2 which is a better technology in my view.

  • Thanks for the reply Ashley, I generally agree, though if you do fallback to nw.js and native node instead of webview2, I think electron is worth a look as an nw.js replacement (for its better native node support and steamworks.js support).

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