Recently I got back into the Cloud with Google's offering. I set up a dedicated server for Neverwinter Nights: Enhanced Edition on a free level cloud instance. Here's a little guide so you can too.

1. Registering with Google Cloud
To register you'll need a Google account and a credit card. Google give free credits so you'll know if you accidentally set up something that is billable.

2. Set up a gcloud f1-micro instance
Setting up the free instance is easier than it looks. First head over to the Compute Engine section, then choose to create an instance. The exact free offering is listed here but roughly should look like this:


You'll know you've got a free instance because the billing sidebar will read like this:


Take a note of your instance name. You'll need it later. Once you've got the stats right, go ahead and make your virtual machine real. Google will set it up while you move onto the next step.

3. Install gcloud SDK locally
Get the gcloud SDK which allows for remote connection and management of your google cloud instances. As is usual with these tools there's a lot to it but I'll take you through the bits we want to use right now.

4. Connect to the instance
Once gcloud is installed we can use it to connect to our instance. Do this by opening the gcloud SDK shell. Then connect using this command, with the instance name from earlier:
gcloud compute ssh @
As it's your first time it'll ask you to set up and store the ssh keys.

5. Setting up the environment
Now you're on we can start setting up the environment for running NWN. The dedicated server has a few dependencies that need to be installed. Fortunately linux's apt-get makes it easy. Run the following commands in turn:
sudo apt-get update
sudo apt-get install libc6-i386
sudo apt-get install lib32gcc1
sudo apt-get install lib32stdc++6
Once they're finished, stay connected. We'll use the instance again soon.

6. Installing Neverwinter Nights Server
The dedicated server doesn't need a full installation of NWN, only the stripped down dedicated server. That can be obtained for free from Beamdog. Once you've downloaded it locally, open a second gcloud shell. We're going to upload the files. Unzip the dedicated server to a local folder, eg. C:\NWNServer or ~/home. Now run the command:
gcloud compute scp -–recurse C:\NWNServer :~/server

Now hop back to your window connected to the instance. Get to the folders with the command:
cd server/bin/linux-x86
There run chmod to set the permissions on the executable:
chmod 777 ./nwserver-linux
If you're familiar with chmod permissions you may want to set executable only.

Run the server for the first time to create the user folders with this command:
./nwserver-linux
The server executable should spit out information about setting up user folders in ~/.local/

7. Configuring the server
Before you can actually use the server you'll need to configure it, as well as adding a module for it to run. To do this you'll need to make use of gcloud compute scp to download and upload files. At a minimum you'll want to download the nwn.ini and nwnplayer.ini existing in the user folder and edit them so your server has a name/password for access. You should find them in:
cd .local/share/Neverwinter\ Nights/
You'll want to add a module to the /modules/ subfolder. If your module uses custom content it'll need to go in the other subfolders /tlk/ for tlk files and /hak/ for hak files

The easiest module to run is one from the original campaign. Adding one of the modules would be accomplished through the gcloud scp command:
gcloud compute scp C:\NWNServer\Chapter1.mod nwndemo:~/.local/share/Neverwinter\ Nights/modules/Chapter1.mod

8. Run your module
Once your module is in place all that remains is to run it. In your ssh window head over to the executable folder:
cd server/bin/linux-x86
And then run the server:
./nwserver-linux -module Chapter1
You should see the module being loaded successfully. Now you'll be able to both see it at the Beamdog Server Browser and log into it from inside NWN.

Happy Gaming!

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
BBCode format allowed