L.G.C. |How-To| — Installing Neverwinter Nights Linux (Native)

cm20OE4Due to the exorbitant amount of requests for me to write down a how-to on getting the native Neverwinter Nights Linux version installed in current distros, here it is for the both of you who asked.

Setting up:

This game is old! So old in fact, you may need to sacrifice a goat to the sun gods for it to work with your particular distro. You’ll also need the following:

These 4 tools:

The 32bit versions of all of these libs:

  • elfutils
  • glulibgl
  • libstdc++5
  • libxcursor
  • openal
  • perl
  • sdl_mixer
  • SDL-1.2
  • libX11

(package names will differ from distro to distro, so look these up using your package manager.)

Be sure to install the 32bit versions of the libs above and their dev(el) packages as well.

And finally, you’ll need the game files. If you have the CDs I’m sure you can figure out how to get the right files but for this case, we’ll be using the GOG installer. So log in to your GOG.com account and download all three NWN Windows Installer files (setup_nwn_diamond_*.exe setup_nwn_diamond_*-1.bin setup_nwn_diamond_*-2.bin).

I haven’t futzed with the Kingmaker Premium Module yet, so I won’t be able to help you there.

Gettin’ your hands dirty:

Ready to install the game yet? If you made it this far, I’m assuming you probably are.

  1. Create a folder called Neverwinter wherever you want, for the sake of this How To, we’ll be creating it in your home directory;

mnqbb2j

  1. Extract/move all of the NW* tools into this folder, each should preferably be in its own subfolder;
  2. Move all three setup_nwn_diamond* files into the Neverwinter folder as well;
  3. Now open a terminal in that folder, if you haven’t yet;
  4. Time to copy paste:
    • innoextract -e setup_nwn_diamond_*.exe
  1. That will create an app subfolder and we’ll need to move some files and directories from it to the game’s final location;
  2. Again, for the sake of this How To we’ll just create a folder called nwn inside the Neverwinter folder;
    • mkdir nwn
  1. Some more copypasta to make the move easier:
    • cd app
    • mv -t ~/Neverwinter/nwn ambient data dmvault hak localvault modules movies music nwm texturepacks chitin.key dialog.tlk xp1.key xp2.key
  1. Don’t delete the app folder just yet, we will need a file from it later;
  2. Now you’ll have to extract the Linux client files to the nwn folder, be sure to do it in this order allowing any and all overwrites:
    • Extract nwclientgold.tar.gz to the nwn folder;
    • Extract nwclienthotu.tar.gz to the nwn folder;
    • Extract English_linuxclient169_xp2.tar.gz to the nwn folder;
  1. Now you’ll have to extract/move the contents of the nwlogger, nwmouse, nwmovies and nwuser subfolders to the nwn folder;
  2. Extract the BinkPlayer into the ~/Neverwinter/nwn/nwmovies folder;
  3. Go back to the terminal:
    • cd ~/Neverwinter/nwn
    • ./nwmouse_install.pl
    • ./nwlogger.pl
    • ./nwmovies_install.pl
      (if you get any errors with these scripts relating to user.h you’ll have to dig into the script files to find the #include <linux/user.h> and replace it with #include <sys/user.h>)
  1. The standard rules of compilations apply when running those scripts: Warnings are probably fine, errors not so much. The only error I ran into was the user.h one I mentioned, any others and you may have to Google It™;
  2. Now let’s make us a nice old bash script to run the game:
    • Open your favorite text editor and paste this in:
#!/bin/bash

#Standard stupid-proofing cd $(dirname $0)#Thar be movies!!!! export LD_PRELOAD=./nwmovies.so #I’ll take some sound with that. export LD_LIBRARY_PATH=./miles:$LD_LIBRARY_PATH #run the game, allowing for executable flags ./nwmain $@

  • Save the file as nwn.sh inside the nwn folder.
  • chmod +x ~/Neverwinter/nwn/nwn.sh
  1. Before we run the game the first time, you should run the fixinstall file. It’ll rename all the pertinent files with the correct casing:
    • cd ~/Neverwinter/nwn
    • ./fixinstall
  1. With it being an SDL 1.2 game, running it right now would cause everyone with two or more monitors to have all but one of them disabled and that would be resized to 640×480. Since we don’t want that to happen Right Click->Save as… the following URL into the nwn folder:
  1. Alright, we’re ready to run the game the first time. You may want to do it in the terminal to see if there are any major errors or something the like:
    • cd ~/Neverwinter/nwn
    • ./nwn.sh
  1. You’ll arrive at the CD Key prompt, your CD keys are located in the ~/Neverwinter/app/nwncdkey.ini file;
  2. You could type them out one by one but it’s faster to just close the game and copy the CD Keys file to the nwn folder:
    • cp ~/Neverwinter/app/nwncdkey.ini ~/Neverwinter/nwn
  1. Launch the game one more time and if everything went the way it should you can now play the native Neverwinter Nights Linux version.

hDwj5VR

  1. Now, let’s make a shortcut to launch the game. Open up your text editor of choice again and paste this in:

[Desktop Entry] Categories=Game; Comment=A Forgotten Realms CRPG Exec=~/Neverwinter/nwn/nwn.sh Icon=applications-games Name=Neverwinter Nights NoDisplay=false StartupNotify=true Terminal=false Type=Application

  1. Save it as nwn.desktop in either your desktop and/or ~/.local/share/applications. The latter will make it so it shows up under the games category in your menu;
  2. (Optional)Here’s an icon for the game, in case you don’t want to use the generic one: 
    • NWN Icon

      Right Click -> Save As

  3. (Optional) You can now remove everything from the ~/Neverwinter folder EXCEPT the nwn folder.

ADDENDUM:

If you have an NVidia card and are using the proprietary drivers, the game’s Anti-Aliasing will not work out of the box. To get AA to work in game, you’ll need to either create an app profile in the nvidia-settings dialog or just add export __GL_FSAA_MODE=4 to nwn.sh.

cm20OE4

#!/bin/bash #Standard stupid-proofing cd $(dirname $0) #Thar be movies!!!! export LD_PRELOAD=./nwmovies.so #I’ll take some sound with that. export LD_LIBRARY_PATH=./miles:$LD_LIBRARY_PATH #Gimme some FSAA, too. export __GL_FSAA_MODE=4 #run the game, allowing for executable flags ./nwmain $@

Author: Pedro Mateus
8 Comments
  1. Thanks for the guide Pedro! Unfortunately, it does not fully work for me. I get the game to start but once I click start new character or select premade, I get a segmentation fault (core dump) not sure what to do. We get this figured out, I will definatley become a patron! What? Yes I said it BRAD!

    • Which distro are you using?

      Did you install ALL of the libraries I mention at the top in their 32 bit versions?

      Did you run the fixinstall script?

      Do you know how to use gdb? If so, my email address is in the About page, send me the terminal output of running nwmain through gdb.

      • I am using Manjaro since it is the only one I can seem to get my dual graphics working on my laptop(intel/nvidia). I’m no linux expert but I did ditch windows last year completely so at least I am not a dual booting heathen. Anywho, all but one of the libraries are installed. glulibgl does not show up in repos or aur, all others are installed. I ran the fixinstall script(a few times after the error as well just to make sure).
        Not sure if it matters, but I also have no sound when the game launches, I am pretty sure that there was intro music at launch.
        Never used gdb but I will paste the output here if it fits…

        NOTICE: NWMovies(./nwmain): Version: 20090223.080954
        NOTICE: Looking up symbols in libSDL…..
        NOTICE: NWMovies: Using libSDL via RTLD_NEXT.
        NOTICE: SDL Library determined to be: /usr/lib32/libSDL-1.2.so.0
        NOTICE: NWMovies: SDL_WM_GrabInput() address: f74d3de0
        NOTICE: NWMovies: SDL_GetVideoSurface() address: f74d2360
        NOTICE: NWMovies: SDL_WM_ToggleFullScreen() address: f74d5200
        NOTICE: NWMovies: SDL_PollEvent() address: f74b19b0
        NOTICE: NWMovies: SDL_WM_IconifyWindow() address: f74d51d0
        NOTICE: NWMovies: Patch 0 Address: 0x08073ee9
        NOTICE: NWMovies: Patch 1 Address: 0x08073efd
        NOTICE: NWMovies: Patch 2 Address: 0x08148254
        NOTICE: NWMovies: Patch 3 Address: 0x0814826e
        NOTICE: NWMovies: Patch 4 Address: 0x08073dbb
        NOTICE: NWMovies: Patch 5 Address: 0x081e6455
        NOTICE: NWMovies: Patch 6 Address: 0x081e6478
        NOTICE: NWMovies: PrePatch0: 8b 80 44 02 00 00 5d c3
        NOTICE: NWMovies: PrePatch1: 8b 80 48 02 00 00 5d c3
        NOTICE: NWMovies: PrePatch2: e8 57 bd f2 ff 83 ec 08
        NOTICE: NWMovies: PrePatch3: 168-: eb 58 83 ec
        NOTICE: NWMovies: PostPatch0: b8 00 00 00 00 90 5d c3
        NOTICE: NWMovies: PostPatch1: b8 00 00 00 00 90 5d c3
        NOTICE: NWMovies: PostPatch2: 90 90 90 90 90 83 ec 08
        NOTICE: NWMovies: PostPatch3: 168-: 90 90 83 ec
        NOTICE: NWMovies: PrePatch4: 56 8d 5d e8 53
        NOTICE: NWMovies: PostPatch4: e9 d4 2f 72 ef
        NOTICE: NWMovies: MoviesPrePatch: 6a 00 53 bf 00 00 00 3f e8 6e b0 26 00 8b 43 5c 8b 10 c7 04 24 00 00 80 3f 57 57 57 50 ff 52 44 83 c4 1c
        NOTICE: NWMovies: MoviesPostPatch: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
        NOTICE: NWMovies: Initialized.
        NOTICE: SDL_WM_GrabInput(QUERY) called..
        NOTICE: SDL_WM_GrabInput(OFF) called..
        ./nwn.sh: line 9: 1716 Segmentation fault (core dumped) ./nwmain $@

        BTW thanks for the quick response!

        • I figured it out Pedro! During my extract of the linux files nwclientgold.tar.gz, etc. to the nwn folder, I think that I did not overwrite existing files. I re-extracted the files and ran fixinstall again and it works like a charm. Thanks for the guide and your help! Im heading over to patreon now!!

  2. Hi Pedro, can you take a look at my problem please?

    During the installation the only problem I had was that some file “nwlogger.log” semmed to be missing, so I just tried creating a nwlogger.log on ~/nwn/ and the installation resumed well, but when I tried to run the game I got this: “Fatal signal: Segmentation Fault (SDL Parachute Deployed)”, which was the same thing I got when I tried installing via Lutris.

    The only package I’m not sure If I installed right was the “glulibgl”, but I installeb almost everything I found searching for “glu” and “libgl”.

    When I run “ldd nwmain” nothing is missing. Only “libmss.so.6” was missing in the beginning but I ran “export LD_LIBRARY_PATH=./lib:./miles:$LD_LIBRARY_PATH ” and that problem seemed to be fixed.

    I’m using Fedora 23 with plasma KDE 5.5.5. My video card is an old GForce 9600GT and I remember seeing some problem with the “nouveau” video card, but I don’t know why that message never appeared again.

  3. Hi Pedro Mateus, sorry to bother you, but can you take a look at my problem please?

    During the installation the only problem I had was that some file “nwlogger.log” seemed to be missing, so I just tried creating a nwlogger.log on ~/nwn/ and the installation resumed well, but when I tried to run the game I got this: “Fatal signal: Segmentation Fault (SDL Parachute Deployed)”, which was the same thing I got when I tried installing via Lutris.

    The only package I’m not sure If I installed right was the “glulibgl”, but I installed almost everything I found searching for “glu” and “libgl”.

    When I run “ldd nwmain” nothing is missing. Only “libmss.so.6” was missing in the beginning but I ran “export LD_LIBRARY_PATH=./lib:./miles:$LD_LIBRARY_PATH ” and that problem seemed to be fixed.

    I’m using Fedora 23 with plasma KDE 5.5.5. My video card is an old GForce 9600GT and I remember seeing some problem with the “nouveau” driver, but I don’t know why that message never appeared again.

Leave Your Reply