Launching an NW.JS game from Steam Linux

  • Hi, everyone! So I have a Node Webkit (NW.JS) game that’s playable on Linux now. I followed the A Wizard’s Lizard model and made a .sh script that runs the nw executable. This works great when I access it from the command line, but I can’t get the game to launch from Steam. In the Steamworks settings, I tried having it launch the .sh script and the executable, and neither work. Any ideas on what I’m missing? Thanks!

  • LDG

    Hey @roppychop , welcome!

    Are you integrating the Steamworks API via Greenworks? I’m asking because loading the Steam client API library can be an issue on Linux. Aside from that the library also tends to be an issue. It usually boils down to the system being unable to locate these libraries on the player’s computer.

    Is your shell script executable? If not, you’ll need to use chmod to set the permissions correctly:

    chmod +x

    There must be something different when launching the game via Steam, although it’s hard to say what that might be.

    Here’s how our Linux launcher is setup in Steamworks, for reference:

  • Hi, Geoff! Thanks for the info. Yes, I’m using Greenworks (version 0.4.1) with NW.JS version 0.12.1. I’m also testing mainly on Ubuntu 14.04.2. I’ll try some of your suggestions tomorrow.

  • Okay, so my shell script is executable. I’ve tried launching it with and without the file present. I’ve tried with the game files packaged in a .nw file and without. I’m not using any chromium-args, though. Are you?

    What’s strange is that, if I run the game from the command line, greenworks.initAPI( ) returns true. So it seems like it can connect to Steam. It just can’t be started from Steam. Well, Steam will show that I’m “in-game,” but the game itself fails to launch. I have to open the system monitor and end the “nw” process.

    I don’t know. I may just have to bag Linux support after all. Do you feel that it’s been worth supporting this OS?

  • LDG

    Hmmm, that’s quite weird. I can’t remember having an issue where the game runs from the command line, but not when launched via Steam.

    Unfortunately, I feel like supporting Linux is a labor of love. It’s the most problematic and the least number of sales (for us). If it’s something you and your fans deeply care about, it’s probably worth it. I think that Humble Bundle either requires or strongly prefers games with Linux versions, so if you’re aiming for that down the road, it helps.

    EDIT: Forgot to say that we are not using chromium-args.

  • I tried disabling the Steam overlay and re-installing libudev, and still no luck. So… I’m out of ideas. Maybe I’ll release the Linux version on, but I’ll have to wait for a major NW.JS and/or Greenworks update to see if that helps. I’ll post my findings here, if/when it ever works. Thanks again for your input!

  • LDG

    Seems like it should just be something minor which can be easily fixed. Problem is nailing down what the problem is. I wish I could be more help, but definitely let us know if you figure it out.

  • I fiddled with it a little more today. Clarification on the command line thing: if I run the game from the command line from a desktop folder, it works. But if I’m in the folder that Steam creates, it does not. The Chromium window pops up with the following error:

    Cannot extract package
    Failed to unzip the package file:

    Of course, that’s when my files are zipped up in a package.nw archive. If I pull the files out, then it works from the command line, even in the steamapps folder. But when I try to launch from Steam itself, it still gives me nothing. Is there a permission or something I might be missing?

  • LDG

    @roppychop I was looking into Linux again recently and have a couple tidbits.

    First, you can get some logging by passing the --enable-logging flag to nw and directing the output to a file. e.g:

    nw --enable-logging --v=1 1>out.log 2>error.log

    I tested this with the latest NW.js and Greenworks and was able to catch an error:

    ERROR: object '/home/geoff/.local/share/Steam/ubuntu12_32/' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

    The error appears to be related to the overlay, which makes sense because the overlay only attaches to your game when it’s launched from Steam. That may explain why it works fine when launched outside of Steam.

    In general, it looks like Steam needs a bunch of 32-bit libraries that don’t necessarily exist on the 64-bit Linux distros by default. It seems like a huge mess to me. Just installing Steam on 64-bit Ubuntu is a royal pain.

  • I’m getting the same error on Greenworks 0.4 and 0.5, whether or not I’ve enabled the Steam overlay in the game properties. Thanks for giving this another look, but I’m pretty much done with Linux Steam support for now. I’m just going to direct people to if they want a Linux version of the game.

  • Tiger Hat

    What are the permissions on the steam folders?

    Have you tried opening them right up to eliminate all permissions issues? (chmod 777)

Log in to reply