NWNx4 and NWNx4 Plugins

System requirement

ALFA strongly recommends that all game servers run a 64-bit OS for the operating system that runs nwn2server. A 32-bit OS does not provide enough address space for many modules to function reliably when hosted by nwn2server.

If nwn2server is hosted in a virtual machine, ALFA recommends that either VMware or Hyper-V be used for the virtualization infrastructure. Both of these products have both been validated and are functional in production use for live servers.

Specifically noted, VirtualBox should not be used or the game will not function properly, on account of bugs in VirtualBox's timer handling (often manifests as perception not working over time or other time-based systems in the game malfunctioning).

It is preferred that the Windows version (Windows 7 or Windows Server 2008 R2 or higher are strongly recommended) used to host the game server be a version that supports acting as a Remote Desktop Protocol (RDP) host, typically Professional (or higher) editions. Server editions also include Remote Desktop Protocol host functionality. RDP provides a superior remote administration experience as compared to VNC.

The recommended memory size to allocate to a game server instance is 4GB. This may be adjusted based on the actual memory consumption of a module, but 2GB provides plenty of headroom for most of our servers.

The Linux utility instance of a game server cluster can be assigned 128MB of memory or potentially even less. Multiple game server instances that are physically colocated may share the same Linux utility instance (which is recommended in such a configuration).

NWNx4

ALFA uses NWNx4 to host all of its live servers.

While this document cannot replace the documentation provided with NWNx4, a brief explanation can be offered: NWNx4 is an application which runs alongside the nwn2server application, communicating with, running processes for, and altering the data within to achieve functionality which cannot be created without such means.

The NWNx4 application works with a number of community-generated plugins-- libraries of functions and hooks, which are either called from the NWN scripting language or which intercept standard functions or functionality to correct bugs-- which are required for the proper function of ALFA's core ruleset.

NWNx4's web page can be found here:
http://www.nwnx.org/index.php?id=home

And the download page for NWNx4 is here (we recommend using the most up-to-date files from the git repository: server files (same folder as nwn2server.exe) and nwnx4 folder):
http://www.nwnx.org/index.php?id=nwnx4

NWNx4 is configured through the nwnx.ini file, which is plain text and contains help text to describe the function of each setting, which is installed to the NWNx4 install directory. Once configured, a server is run through NWNx4 by running one of the NWNx4 executables. The started application will also start nwn2server.

Redistributables that need to be installed:
Some of the NWNx4 plugins require functionality from C++ redistributables. These programs are free and free to share, provided by Microsoft. They can be found here:

 C++ 2010 SP1 Redistributable
http://www.microsoft.com/download/en/details.aspx?id=8328

 C++ 2005 SP1 Redistributable
http://www.microsoft.com/download/en/details.aspx?id=26347

 Windows PowerShell 2.0 (For old OS's, already included with Windows 7 and Windows Server 2008 R2)
http://support.microsoft.com/kb/968929/en-us (choose Windows Management Framework Core installer for your OS)

Current plugins in use:
(this section is being worked on: this is a current list of libraries needed)

These files need to be in the same directory as nwn2server.exe:
 NWNScriptJIT.dll -- NWScript JIT support, C# script support
 NWNScriptJITIntrinsics.dll -- NWScript JIT support, C# script support
 AuroraServerNetLayer.dll -- bug fixes

These files need to be in the same directory as nwnx4_*.exe:

 NWNx4_Hook.dll -- allows script hooking in the first place
 NWNScriptCompiler.exe -- required to allow the content patcher to recompile a module. Take from AdvancedScriptCompiler\NWNScriptCompiler.exe on the ACR repository.
 xp_AuroraServerNWScript.dll -- script improvements, C# support, allows workarounds of engine limitations
 xp_bugfix.dll -- bug fixes
 xp_craft.dll -- customization of items during live play
 xp_mysql.dll -- allows communication with SQL databases
 xp_objectattributes.dll -- allows the modification of creatures during live play
 xp_ServerVault.dll -- allows vault reads / writes to occur without stopping the main server process
 xp_srvadmin.dll -- allows scripts to carry out server administration actions.
 xp_system.dll  -- 
 xp_time.dll --  MySql.Data.dll -- MySQL client library for CLR scripts.

These files need to be configued before running nwnx4:
AuroraServerNWScript.ini
-- AllowManagedScripts=1
xp_craft.ini
-- Set the database directory to proper location of the Campaign Database on the machine
AuroraServerVault.ini
-- The text within the configuration file explains how to configure the plugin. If this configuration fails, players will be unable to see their vaults.
-- Typical configuration is to set LocalServerVaultPath=C:\NWN2User\servervaut , RemoteServerVaultPath=\\alfavault\alfa\vault , SpoolPath=C:\NWN2User\servervaultspool . The key is that RemoteServerVaultPath points to the network mount that connects to SSHFS, and LocalServerVaultPath points to nwn2server's configured server vault directory (must be a LOCAL directory), and SpoolPath points to a local directory that is used as a "scratch" holding area for BICs waiting to be uploaded. nwnx.ini
-- The text within the configuration file explains how to configure the plugin. If this configuration fails, the server will default to inappropriate settings (such as PvP, download server, or custom GUIs) or requiring the module to be started manually after nwn2server.exe stops.

The collection of these files is available on the DM FTP, beginning with ACR version 1.85, separated by version.