Page tree
Skip to end of metadata
Go to start of metadata

This is a rough guide for setting up a new online NWN2 server.

There are a lot of sections that would need to be improved / more detailed. Don't hesitate to edit this page and add anything.


System requirements

  • OS: Windows XP or later. Linux or Mac can run nwn2server using Wine, but nwnx4 does not work. In this
  • Processor: Since nwn2server is single threaded (i.e. it will use only one core), you need the highest frequency possible on a single core. The required frequency vary greatly depending on the used scripts, module size, number of players, etc. but 2.5GHz should be enough for a medium sized module.
  • RAM: 4GB should be enough for windows + nwn2server + MySQL. Very large servers use 6GB.
  • Disk: Disk speed will impact both nwn2server boot time and run-time responsiveness when instantiating creatures, placeables, etc. SSD are probably the best since they allow to read small files very quickly compared to hard drive disks. If you have extra RAM, you can setup a ramdisk for even better performances.
  • Network: A fast network will improve player's area loading time.


NWN2 Installation

You can install the NWN2Server using one of these methods:

Method 1: standard install

This is the easiest method, but will use more disk space than using Method 2.

  • Install the game using the disks / gog / steam installer
  • Make sure your game is up to date

Method 2: light server install

Method used here

  • Copy the following files and folders from the a standard NWN2 install to a separate folder, keeping the same folder structure:
    • Campaigns/Neverwinter Nights 2 Campaign*/Campaign.cam
    • Data/2DA*.zip
    • Data/convo*.zip
    • Data/Ini*.zip
    • Data/lod-merged*.zip
    • Data/NWN2_Models*.zip
    • Data/scripts*.zip
    • Data/SpeedTree*.zip
    • Data/Templates*.zip
    • Data/walkmesh*.zip
    • dialog*.tlk
    • granny2.dll
    • mss32.dll
    • NWN2_MemoryMgr.dll
    • NWN2_MemoryMgr_amdxp.dll
    • nwn2.ini
    • nwn2player.ini
    • nwn.ini
    • nwnplayer.ini
    • nwnpatch.ini
    • nwn2server.exe
  • The created folder should now contain only the required files to launch a NWN2Server instance.
  • Install required windows libraries: directx 9, dotnet3.5


Port redirection

NWN2Server uses by default port 5121.

If your server runs behind a NAT (like an internet access provider router), you will need to configure the router to redirect 5121 to your server hosting machine.

Also make sure your firewall allows port 5121.


NWNX4

  1. Download nwnx4 on the official website
  2. Extract the zip file somewhere on the system
  3. Edit nwnx.ini
    • nwn2: Path to the nwn2 installation folder
    • parameters: Command line parameters passed to the nwn2server process, like:
      • -module yourmodule automatically load yourmodule.mod
      • -moduledir yourmodule automatically load yourmodule if saved as directory
      • -cpu 3 Assign the nwn2server process to the CPU core 3

NWNX4 plugins

xp_bugfix (required)

Required for displaying the server in the in-game server list (using the Client Extension). Also comes with a bunch of server bug fixes and optimization (a must have !)

Official xp_bugfix page

  1. Install Visual C++ 2005 SP1 CRT
  2. Download the latest version of the plugin on the forum page
  3. Extract the zip file and copy the dll and ini files inside the nwnx4 folder

xp_mysql (optional)

xpmysql is used by a lot of nwn2 servers as an efficient persistent database. You may not require it. You cannot use both xpmysql and xp_sqlite at the same time.

  • If you don't need a MySQL server, remove xp_mysql.dll and xp_mysql.ini
  • Otherwise install a MySQL-compatible server (https://mariadb.org/ is probably the best) on the server, and edit the xp_mysql.ini file:
    • server: MySQL server IP address
    • user: MySQL user for executing queries
    • password: user's password
    • schema: Default used MySQL schema

xp_sqlite (optional)

xpsqlite is used by some nwn2 servers as an easy to setup persistent database. You may not require it. You cannot use both xpmysql and xp_sqlite at the same time.

  • If you don't need SQLite, remove xp_sqlite.dll and xp_sqlite.ini
  • Otherwise edit xp_mysql.ini:
    • file Path to the file for storing the database file


Server rules configuration

You can change the server game rules by editing Documents/Neverwinter Nights 2/nwn2player.ini

Here is an example of server options:

[Server Options]

# Server setup
Server Name=nwn.wiki server config example
ModuleUrl=https://your-module-website.com
Game Port=5121
Max Players=42
Game Type=9
PVP Setting=2
Game Region=0
GameSpy Enabled=1
Disable AutoSave=0
Auto Save Interval=0
CD Banned Behavior=0
Validate Character Ownership=1
BackupSavedChars=0
Reload Module When Empty=0
ServerDownTimer=180
MPEnabled=1
PlayerPassword=
DMPassword=5up3r53cr37

# Performance tuning / debugging
2DA Cache Size=100
2DA Engine Cache Size=100
Scripts Print To Log=1
Scripts Print To Screen=0
EnableClientModuleCleanup=1
EnableClientCampaignCleanup=1

# Server behaviour
Pause Loading During Cutscenes=0
HideChallengeRatingInExamine=0
HideEffectListInExamine=0
ShowSearchSpam=0
ShowDMJoinedMessage=0

# Player settings
AllowLocalChars=0
Suppress Base Servervault=1
Enforce Legal Characters=0
ItemLevelRestrictions=1
MinCharLevel=1
MaxCharLevel=30
Disable log in heal=1
Restore Spell Uses On Login=0
One Party Only=0
Disallow Shouting=0
PauseAndPlay=0

# Auto DownLoader
ClientSyncRequired=1
DisableClientCustomUI=1
DisableClientOverride=1
ClientCachePassphrase=ReplaceMeWithSomethingVeryRandom
ClientCacheStrategy=2
InfoURL=http://your-module-website.com/info/info.html
NewsURL=http://your-module-website.com/info/news.html
RulesURL=http://your-module-website.com/info/rules.html
AdminEmail=YourEmail@doge.com


Autodownloader

Let players automatically download / update their custom content files when they connect to a server:

https://neverwintervault.org/project/nwn2/other/nwn2-patch-123-content-autodownloader-guides


Launch server

Simply launch NWNX4_GUI.exe from the nwnx4 folder, and you should see a NWN2Server window appearing.



  • No labels