Neverwinter Nights: Enhanced Edition Guide

NWN:EE with NWNX:EE in Amazon for Neverwinter Nights: Enhanced Edition

NWN:EE with NWNX:EE in Amazon

Overview

This guide will walk you through the steps of getting NWN:EE working with NWNX:EE on Ubuntu 14.04 i386 on Amazon EC2.This guide is intended for people who are fairly technical, have some basic experience with Linux, and want to run their own Linux based NWN:EE server. This guide will probably need to be updated over time, which I cannot promise I will do regularly.

Before you get Started

*** WARNING ***

Using Amazon Linux Servers costs money. If you don’t pay attention, it can cost you ALOT of money. I strongly suggest these guides be used by people who are set in their careers and can afford to waste $300 on a stupid mistake without sobbing uncontrollably for weeks.

*** END WARNING ***

Tools

Before you get started, you will need to be able to “SSH” and “SFTP” from your windows desktop to your Amazon Linux server (if you are on linux, you should already have this figured out).

For ease of use, I suggest:

Putty (for ssh) — You will use this to log into and control the server. You will be doing most of your work here.

WinSCP (for sftp) — You will use this to upload modules and other files to your Amazon Linux NWN server.

I suggest you familiarize your self with connecting to Amazon Linux instances with both tools before you begin this tutorial.

Building your Amazon EC2 Linux Instance

Signing Up for EC2

You need to take the time get your account set up, with payment method before starting. This guide will not cover that aspect of the process.

Setting up your Server

Once you have set up your account, you will need to go into the ec2 dashboard and “launch an instance” in the region of your choice (the closer the region is to you, the better the connection, lower the ping, etc..).

To make this process easier, I’ve found an image ID that you can select from the community that will work in a straigh forward fashion once configured.

“ami-01c99261”


You will need to continue through the launch process (this is where getting yourself familiar with Amazon came into play from the previous section). While your server is building, you will need to modify your security group to allow remote connections to the NWN server.


You need to make sure that UDP is allowed inbound on 5121, and SSH on port 22 (its how you get in, so don’t delete that rule unless you know what your doing). If you change the running port on NWN, you will need to change this or you wont be able to connect.

Thats all it should take to get your server built and set up. This does NOTHING to actually get the game going.

Configuring your Amazon Server

You will need to use Putty (or your shell client of choice) to access your Amazon instance. You will log in as “ubuntu”.

Once you are on the server, you want to run the following commands on the command line.

——————————————————————–

sudo apt-get update
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update

sudo apt-get install gcc-6 g++-6 build-essential git zip cmake3 unzip cmake gperf git -y –no-install-recommends
sudo apt-get install libmysqlclient-dev libpq-dev -y
sudo apt-get install -y libseccomp-dev
sudo apt-get install -y ruby-dev
sudo mkdir -p /usr/share/man/man1
sudo apt-get install -y openjdk-8-jdk-headless
sudo apt-get install -y ant

sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-6 10
sudo update-alternatives –install /usr/bin/g++ g++ /usr/bin/g++-6 10

———————————————————————–

If any of these commands fail, for any reason, please ask for help (I might help). The NWNX:EE scripts really do require that all of these packages install, and does not really break gracefully (meaning you can be stuck at this part forever).

If all of the updates go smoothly, and all the packages install successfully, you should be able to move on to the next step, which is downloading and installing the NWN:EE server and NWNX:EE application.

Installing NWN:EE and NWNX:EE

This part shouldn’t be too bad if all of the packages updated in the previous step. You will need to run the following commands on the command line:

————————————————————————————–
————————————————————————————

(set up the file structure)
mkdir -p /home/ubuntu/.local/share/nwn
mkdir -p /home/ubuntu/.local/share/download/

(download and configure NWNX:EE)
cd /home/ubuntu/.local/share/download/
git clone [link] nwnxee
cd nwnxee
./Scripts/buildnwnx.sh
————————————————————————————–
————————————————————————————–

At this point, you should see a whole bunch of text theatre. You should go from [1] to [99] steps, you shouldn’t see any fails before this (you may see some after but it wont matter).

Once that is done, you can now install the dedicated linux server.

————————————————————————————–
————————————————————————————–

cd /home/ubuntu/.local/share/nwn
wget [link]
unzip nwnx.io/nwnee-dedicated-8166.zip
rm -rf bin/mac* bin/win*
cd bin/linux-x86
cp /home/ubuntu/.local/share/downloads/nwnxee/Binaries/*.so .

————————————————————————————–
————————————————————————————–

You will want to make a file called “nwnstart.sh” with the following contents

————————————————————————————–
————————————————————————————–
#!/bin/sh
export LD_PRELOAD=”./NWNX_Core.so”
export NWNX_SQL_HOST=””
export NWNX_SQL_USERNAME=””
export NWNX_SQL_PASSWORD=””
export NWNX_SQL_TYPE=””
export NWNX_SQL_DATABASE=””

./nwserver-linux -module “yourmodulename”
————————————————————————————–
————————————————————————————–

BEFORE you run nwnstart.sh you should run “nwserver-linux” once manually. This will create the directory “/home/ubuntu//.local/share/Neverwinter Nights”. After you run “nwserver-linux” once, you can go ahead and exit out of it.

You will then need to download a module to your “/home/ubuntu//.local/share/Neverwinter Nights/modules” folder, and then modify your “nwnstart.sh” script and replace the “yourmodulename” with your actual module name (minus the .mod extension, you don’t need that).

And that should be it. If all loads well, you should see…

Configuring your Modules with NWNX:EE

You will need to use Winscp and download the file:

/home/ubuntu/.local/share/nwnxee/Binaries/NWScript.zip

You will need to extract the NSS files you intend to use with your NWNX:EE server and place them into your “Neverwinter Nights/override” folder.

After you’ve placed the nss files in your override folder, you will need to re-open your module, compile it, close it, and open it again. At this point you should be able to utilize the new functions provided by NWNX:EE.

Troubleshooting

Q: What went wrong? It wont load.

A: Vague questions wont help. I (and anyone else) need logs and screenshots.

Q: I’m a master Linux engineer and I can’t seem to get this thing running after doing a million different things.

A: Once you’ve done a million different things, no one can help you. Please delete your VM and start over, this time, start asking for help earlier in the process.

Q: I’m trying to get this to work on an x86 platform, and it keeps giving me library errors.

A: Outside the scope of this HowTo.

Q: I tried everything I can think of, and its still not working.

A: Delete your VM and try again (please use the AMI I suggested early on).

Credits

Below is a list of places that I’ve gathered information to get my instances up and running on Amazon. It took me about 2 days to figure it out to the point where I can get NWNX:EE connected to a mysql databse.

[link] [link] [link]

Ultimately I claim no credit. If I missed anyones work, then I’ll update and put it on here. I just went through the pains of pulling it all together to make it work. I might just decide to make a community AMI with all this stuff already built to make it turn key easy… 😉

SteamSolo.com