- NEOTOKYO rebuild in Source SDK 2013 Multiplayer
- Forked from: https://github.com/NeotokyoRevamp/neo
- License: SOURCE 1 SDK LICENSE, see LICENSE for details
- See CONTRIBUTING.md for instructions on how the codebase work and contribute
To see the Table of Contents, please use the "Outline" feature on GitHub by clicking the button located in the top right of this document.
- Windows: Visual Studio 2022 (MSVC v143)
- Make sure to include C++ development environment, C++ MFC Library, Windows 10/11 SDK, and CMake during installation
- Linux: Steam Runtime 3 "Sniper"
- GCC/G++ 10 toolchain
- Compiled in the sniper's Docker/Podman/Toolbx container, schroot, or systemd-nspawn
- This can also work on native (as long as it supports C++20) even with newer GCC/G++, mostly for development setup. At least install GCC and G++ multilib from your distro's package manager.
- Both:
NT;RE can be built using VS2022 IDE, Qt Creator IDE, and the CLI directly.
- Open up VS2022 without a project, then go to:
File > Open > CMake...
- Open the
CMakeLists.txt
found inmp\src
- To switch to the CMake view, right-click and click on "Switch to CMake Targets View" in the "Solution Explorer", it'll be under the "Folder View".
After that, it should be able to compile. For debugger/run CMake configuration, refer to: CONTRIBUTING.md - Debugging - VS2022 + CMake (Windows).
- On the "Welcome" screen, click on "Open Project..."
- Open the
CMakeLists.txt
found inmp/src
- By default, the build is not done in parallel but rather sequentiality. Note, parallel builds at the default setting could deadlock the system or make it unresponsive during the process. Available since CMake 3.12, the amount of jobs can be tweaked using
--parallel <jobs>
where<jobs>
is a number to specify parallel build level, or just simply don't apply it to turn it off. To turn on parallel builds in Qt Creator: On the "Projects" screen, in [YOUR KIT (under Build & Run)] > Build, go to "Build Steps" section, expand by clicking on "Details", and add--parallel
to the CMake arguments.
After that, it should be able to compile. For debugger/running configuration, refer to: CONTRIBUTING.md - Debugging - Qt Creator (Linux)
Make sure the "x86 Native Tools Command Prompt for VS2022" is used instead of the default.
Just download and use the OCI image for Docker/Podman/Toolbx:
- Docker:
sudo docker pull registry.gitlab.steamos.cloud/steamrt/sniper/sdk
- Podman:
podman pull registry.gitlab.steamos.cloud/steamrt/sniper/sdk
- Toolbx:
toolbox create -i registry.gitlab.steamos.cloud/steamrt/sniper/sdk sniper
Docker:
# docker run -v /PATH_TO_REPO/neo/mp/src:/root/neo/mp/src --rm -it --entrypoint /bin/bash registry.gitlab.steamos.cloud/steamrt/sniper/sdk
$ cd /root/neo/mp/src/
Podman:
$ podman run -v /PATH_TO_REPO/neo/mp/src:/root/neo/mp/src --rm -it --entrypoint /bin/bash registry.gitlab.steamos.cloud/steamrt/sniper/sdk
$ cd /root/neo/mp/src/
Toolbx:
$ toolbox enter sniper
$ cd /PATH_TO_REPO/neo/mp/src
Depending on the terminal, you may need to install an additional terminfo in the container just to make it usable. The container is based on Debian 11 "bullseye", just look for and install the relevant terminfo package if needed.
Using with the ninja build system, to build NT;RE using the CLI can be done with:
$ cd /PATH_TO_REPO/neo/mp/src
$ cmake --preset PRESET_NAME
$ cmake --build --preset PRESET_NAME
Available PRESET_NAME values: windows-debug
, windows-release
, linux-debug
, linux-release
.
To make it appear in Steam, the install files have to appear under the sourcemods directory or be directed to it.
There are three options: copying the files over to the sourcemods directory, symlinking to the
sourcemods directory, or using -game
option and pointing to it. If you are installing
from a tagged build, copying over the directory is fine. If you are developing or tracking
git branches, symlinking or just using -game
is preferred.
After apply the file copy or symlink to the sourcemods directory, launch/restart Steam and "Neotokyo: Revamp" should appear. To run the game, original NEOTOKYO have to be installed and NT;RE will try to automatically mount it.
The following examples assumes the default directory, but adjust if needed:
> cd C:\Program Files (x86)\Steam\steamapps\sourcemods
> mklink /J neo "<PATH_TO_NEO_SOURCE>/mp/game/neo"
NOTE: This is not persistent, use -game
method instead for persistent usage (/etc/fstab
might not work for persistent mount bind and could cause boot error if not careful):
$ cd $HOME/.steam/steam/steamapps/sourcemods
$ mkdir neo && sudo mount --bind <PATH_TO_NEO_SOURCE>/mp/game/neo neo
Another way is just add the -game
option to "Source SDK Base 2013 Multiplayer":
%command% -game <PATH_TO_NEO_SOURCE>/mp/game/neo
This is generally isn't necessary if NEOTOKYO is installed at a default location. However,
if you have it installed at a different location, adding -neopath
to the launch option
can be used to direct to it.
For further information for your platform, refer to the VDC wiki on setting up extras, chroot/containers, etc...: https://developer.valvesoftware.com/wiki/Source_SDK_2013
For setting up the Steam mod: https://developer.valvesoftware.com/wiki/Setup_mod_on_steam
You may or may not need this, but if NT;RE crashes/segfaults on launch, then install lib32-gperftools
,
and set: LD_PRELOAD=/usr/lib32/libtcmalloc.so %command%
as the launch options.
Source 2013 Multiplayer also bundles with itself an outdated version of SDL2, due to which there might be false key presses (see: link) and doubled mouse sensitivity when compared to windows/other source games (see: link).
To fix these issues as well, install lib32-sdl2
, and set: LD_PRELOAD=/usr/lib32/libtcmalloc.so:/usr/lib32/libSDL2-2.0.so.0 %command%
as the launch options instead.
These instructions have been written with a Debian 12 machine in mind, but they should work for other systems as well.
-
Install SteamCMD following these instructions: LINK
-
Decide on a location you'd like to install the server to, for example,
/home/<username>/neoserver
, and create it. -
Run SteamCMD:
steamcmd
-
Enter the following commands in SteamCMD (Note that you need to use an absolute path for the install dir):
force_install_dir <YOUR_LOCATION>/ognt/ login anonymous app_update 313600 validate (wait for it to install) quit
-
Run SteamCMD again, and enter these commands:
force_install_dir <YOUR_LOCATION>/ntrebuild/ login anonymous app_update 244310 validate (wait for it to install) quit
-
Make a symlink for original NEOTOKYO so that NT;RE can find it's assets:
Run the following command as root:
ln -s <YOUR_LOCATION>/ognt /usr/share/neotokyo
It should now be possible to access
/usr/share/neotokyo/NeotokyoSource
.This is the only command that needs root, so you can logout from root.
-
Make a symlink so that Src2013 dedicated server can see SteamCMD's binaries:
(NOTE: I'm NOT sure if this is how it is on other systems other than Debian 12, so please, check first if you have
~/.steam/sdk32
before running these! If you have Desktop Steam installed, then you should have this directory, but it doesn't seem to be the case with SteamCMD, which is why we need to do this.)ln -s ~/.steam/sdk32 ~/.steam/steam/steamcmd/linux32
-
For firewall, open the following ports:
- 27015 TCP+UDP (you can keep the TCP port closed if you don't need RCON support)
- 27020 UDP
- 27005 UDP
- 26900 UDP
-
cd
into<YOUR_LOCATION>/ntrebuild/bin
. -
Run these commands to make symlinks for needed files:
ln -s vphysics_srv.so vphysics.so; ln -s studiorender_srv.so studiorender.so; ln -s soundemittersystem_srv.so soundemittersystem.so; ln -s shaderapiempty_srv.so shaderapiempty.so; ln -s scenefilecache_srv.so scenefilecache.so; ln -s replay_srv.so replay.so; ln -s materialsystem_srv.so materialsystem.so;
-
Run the following command to rename a file that is incompatible with NT;RE:
mv libstdc++.so.6 libstdc++.so.6.bak
-
cd
up a folder, so that you will be in<YOUR_LOCATION>/ntrebuild
. -
Extract the latest release of NT;RE into
<YOUR_LOCATION>/ntrebuild
, so you will have a directory<YOUR_LOCATION>/ntrebuild/neo
with agameinfo.txt
inside.
Now you have a dedicated server setup for NT;RE. To run it, you will need to be in the <YOUR_LOCATION>/ntrebuild
directory and run srcds_run
with whatever arguments. You can adapt the following command to your own liking:
./srcds_run +sv_lan 0 -insecure -console -game neo +ip <YOUR_IP> -maxplayers <1-32> +map <MAP_NAME>
These instructions were tested on Windows Server 2016 and Windows 11 machines, they will probably work in all Windows versions.
- Install SteamCMD following these instructions: LINK
- Choose a location for your server to be installed into, for example,
C:\NeotokyoServer\
, and create it. (In this case SteamCMD is also installed in this location) - Run SteamCMD:
steamcmd.exe
- Enter the following commands in SteamCMD:
force_install_dir .\ognt\ login anonymous app_update 313600 validate (wait for it to install) quit
- Run SteamCMD again, and enter these commands:
force_install_dir .\ntrebuild\ (this will be the main directory of your server) login anonymous app_update 244310 validate (wait for it to install) quit
- Extract the latest release of NT;RE into
<YOUR_LOCATION>\ntrebuild
, so you will have a directory<YOUR_LOCATION>\ntrebuild\neo
with agameinfo.txt
inside. - Allow all Inbound and Outbound TCP and UDP requests for the following ports via Windows Firewall. See how
- 27015 TCP+UDP (you can keep the TCP port closed if you don't need RCON support)
- 27020 UDP
- 27005 UDP
- 26900 UDP
- Your server should be ready to go, launch it inside your main directory (
(...)\ntrebuild\
) with the following command: (You can alter any argument to your liking, except-game
and-neopath
)
srcds.exe -game neo -neopath "..\ognt\NeotokyoSource" +ip <YOUR_IP> -maxplayers <1-32> +map <MAP_NAME>
- To run a server, install "Source SDK Base 2013 Dedicated Server" (appid 244310).
- For firewall, open the following ports:
- 27015 TCP+UDP (you can keep the TCP port closed if you don't need RCON support)
- 27020 UDP
- 27005 UDP
- 26900 UDP
- After it installed, go to the install directory in CMD, should see:
- Windows:
srcds.exe
- Linux:
srcds_linux
- You'll also see
srcds_run
but that doesn't work properly with NT;RE so ignore it
- You'll also see
- Windows:
- Optional: Link or copy over neo, otherwise
-game <path_to_source>/mp/game/neo
can be used also:- Windows:
mklink /J neo "<path_to_source>/mp/game/neo"
- Linux:
- Non-persistent bind mount:
mkdir neo && sudo mount --bind <path_to_source>/mp/game/neo neo
- Or just copy over or use the directory directly
- Non-persistent bind mount:
- Windows:
- Linux-only: Symlink the names in
<PATH_TO_STEAM>/common/Source SDK Base 2013 Dedicated Server/bin
directory:
ln -s vphysics_srv.so vphysics.so;
ln -s studiorender_srv.so studiorender.so;
ln -s soundemittersystem_srv.so soundemittersystem.so;
ln -s shaderapiempty_srv.so shaderapiempty.so;
ln -s scenefilecache_srv.so scenefilecache.so;
ln -s replay_srv.so replay.so;
ln -s materialsystem_srv.so materialsystem.so;
- Linux-only: Before running
srcds_linux
, some few environment variables need to setup:SteamEnv=1
LD_LIBRARY_PATH=$(<STEAM-RUNTIME-DIR>/run.sh printenv LD_LIBRARY_PATH):/home/YOUR_USER/.steam/steam/steamapps/Source SDK Base 2013 Dedicated Server/bin
- Where
<STEAM-RUNTIME-DIR>
can be found from:$ find "$HOME" -type d -name 'steam-runtime' 2> /dev/null
- Where
- Run:
<srcds.exe|srcds_linux> +sv_lan 0 -insecure -game neo +map <some map> +maxplayers 24 -autoupdate -console
- Double check on the log that VAC is disabled before continuing
- In-game on Windows it'll showup in the server list, on Linux it probably won't and you'll have to use
connect
command directly (EX:connect 192.168.1.###
for LAN server)
SourceMod plugins should generally work with NT;RE, however they have to be added to the ShowMenu
whitelist to make the menu display properly. To do this:
- Go to directory
addons/sourcemod/gamedata/core.games
where you should findcommon.games.txt
- Create the directory
custom
and make a copy ofcommon.games.txt
into it - Open
custom/common.games.txt
and look for a comment that says "Which games support ShowMenu?" - Add
neo
to that list like this:"game" "neo"
- Some outline for shaders from the VDC wiki:
- You'll need Perl with the package String-CRC32.
- Compatible pre-compiled Perl installer is available here. Strawberry Perl should most likely also work, but you'll need to confirm the String-CRC32 package is available.
- If Perl was not found when running shader scripts, make sure it's included in your PATH env var (or use the ActiveState Platform State CLI, if applicable for your particular Perl setup).
- You will probably need to slightly edit some of the build scripts (buildhl2mpshaders.bat/buildsdkshaders.bat/buildshaders.bat) to match your setup, and create some symlinks or copy files to get access to FileSystem_Steam.dll, and the other "\bin..." shader compile tools.
- If you get errors with nmake not found, make sure you're running the scripts from a Visual Studio (x86) Native Tools Command Prompt, or have the paths (VsDevCmd.bat / vsvars32.bat) set up by some other means.
- Alternatively, edit the "buildsdkshaders.bat" to call the appropriate vsvars32.bat for setting up nmake for your particular environment.
- If you get a "bin\something" not found error when already inside the bin folder, add a symlink for ".\bin" <--> "." as workaround.
mklink /j .\bin .
Finally, you should be greeted with some compiler output akin to:
== buildshaders stdshader_dx9_30 -game C:\git\neo\mp\src\materialsystem\stdshaders\..\..\..\game\neo -source ..\.. -dx9_30 -force30 ==
10.41
Building inc files, asm vcs files, and VMPI worklist for stdshader_dx9_30...
Publishing shader inc files to target...
shaders\fxc\example_model_ps20b.vcs
shaders\fxc\example_model_vs20.vcs
shaders\fxc\neo_test_pixelshader_ps20.vcs
shaders\fxc\neo_test_pixelshader_ps20b.vcs
shaders\fxc\sdk_bloomadd_ps20.vcs
shaders\fxc\sdk_bloomadd_ps20b.vcs
shaders\fxc\sdk_bloom_ps20.vcs
shaders\fxc\sdk_bloom_ps20b.vcs
shaders\fxc\sdk_screenspaceeffect_vs20.vcs
9 File(s) copied
10.41
- NeotokyoRevamp/neo - Where this is forked from
- ValveSoftware/source-sdk-2013 - Source SDK 2013
- Nbc66/source-sdk-2013-ce - Community Edition for additional fixes
- tonysergi/source-sdk-2013 - tonysergi's commits that were missing from the original SDK