Tower Unite Dedicated Server Setup!

This guide has moved to a Steam Guide, which will be kept up to date: http://steamcommunity.com/sharedfiles/filedetails/?id=662378924

#Wanna host a dedicated server? Tired of downloading .rar files over and over? You’ve come to the right place!

##Dedicated Server
We’re going to try releasing this manually through SteamCMD, it’ll save us time and you effort.

  1. Windows: Download steamCMD.zip and extract it.
  • Linux: Download steamcmd_linux.tar.gz and extract it.
  • Run the following commands
  • login anonymous
  • force_install_dir ./tu/
  • app_update 439660 validate
  • Close SteamCMD
  • You’ll find a folder called "tu" in the same folder that has steamCMD in it.
  • Windows: Copy tier0_*.dll, vstdlib_*.dll, and steamclient*.dll files from the root folder into tu/Tower/Binaries/Win64
  • Linux: Copy linux64/steamclient.so into tu/Tower/Binaries/Linux
  • Windows: Run TowerServer.exe -log
  • Linux: Run ./Tower/Binaries/Linux/TowerServer-Linux-Shipping -log
  • Forward the following ports:
7777-7780 UDP
3478 UDP
4379-4380 UDP```


When the game updates, run **`app_update 439660 validate`** again in SteamCMD to get the latest version of the dedicated server.

If you get a certain error regarding the Steam gameserver API, this means that something isn't set up properly with your firewall / NAT.

The main caveat with the dedicated server is that you can not run it and join it on the same machine.

You can configure the server settings in Tower/Config/DefaultGame.ini in the **`[/Script/TowerNetworking.DedicatedServerOptions]`** section.

There is a `password` setting but that isn't implemented just yet.

We're still figuring this out; if you have issues, or want to assist by providing batch files or tools, please feel free to reply here. If you can't get the dedicated server to download, PM me and I'll send you a Steam key.
18 Likes

Nice. I know a few people who want to run dedicated servers.

1 Like

Valve recommends to a separate account for SteamCMD in their official tutorial (https://developer.valvesoftware.com/wiki/SteamCMD#Running_SteamCMD). I’d suggest that you change your tutorial accordingly.

Some servers require you to login with a Steam Account.
For security reasons it is recommended that you create a new Steam account just for your dedicated servers.
A user can only be logged in once at any time (counting both graphical client as well as SteamCMD logins).

Also is it on purpose that you can’t use the anonymous login to update the game?

1 Like

It will be anonymous login once valve adds us to the anonymous DS package. Hopefully by Early Access.

4 Likes

Some material for a Linux tutorial. You can copy and edit it if you want @Zak

Setting up SteamCMD:

If you are running a 64-bit operating system, install glibc-32bit:
On Ubuntu / Debian 64-bit:

sudo apt-get install lib32gcc1

On Archlinux 64-bit:

pacman -S lib32-gcc-libs

On Fedora / CentOS / RHEL etc.:

yum install glibc.i686 libstdc++.i686

On openSUSE:

zypper in glibc-32bit

It is a got idea to create a separate user for your steam applications. Do not run steam as a root due to Steam potentially having security issues that could harm your system.

useradd -m steam

Then login as your steam user:

sudo su - steam

Navigate to steam’s home folder and create a directory for SteamCMD:

cd ~
mkdir steamcmd
cd steamcmd

Download SteamCMD:

wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz

Extract the archive:

tar xzvf steamcmd_linux.tar.gz

Installing Tower Unite:
To make updating the game easier we will create a script that will update the game every time we run it. But first we need to create a dummy account for downloading the Tower Unite dedicated server.

  • Open the steam homepage in a Private / Incognito Tab with your favourite web browser.
  • Create a new steam account with a random name and password.
  • Deactivate Steam Guard for convenience.
  • Navigate to http://store.steampowered.com/app/439660/ in your private browser tab and click on Play Now

Back in your terminal create a directory for Tower Unite. (You still should be logged in as your steam User):

mkdir tu

Now we can create our update script:
Navigate to your home directory and create a new file with nano.:

cd ~
nano update_tu.sh

Type in the following. Make sure to edit your login data aswell as your paths:

#!/bin/bash
/path/to/your/steamcmd-folder/steamcmd.sh +login your_dummy_username your_dummy_password +force_install_dir /your/tu/directory + app_update 439660 validate +quit

Save your script by hitting Ctrl+O, then enter, followed by Ctrl+X.
Make your script executable:

chmod +x update_tu.sh

Finally run your script:

./update_tu.sh

Running Tower Unite Dedicated Server
For even more convenience we will create a script for the running Tower Unite server. To make things even easier I will make sure that the script always runs as the user Steam. But first we need to copy a file to make the server work:

cd yourTowerUniteFolder
cp linux64/steamclient.so Tower/Binaries/Linux/

Create your script using nano:

cd ~
nano run_tu.sh

Add the following to your script:

#!/bin/bash
/path/to/your/TU-folder/Tower/Binaries/Linux/TowerServer-Linux-Shipping -log

Save your script by hitting Ctrl+O, then enter, followed by Ctrl+X.
Again make your script executable:

chmod +x run_tu.sh

We just created the script for actually running the script. However you shouldn’t run it directly as this would mean that the server is not running as the Steam server. Therefore we have to create another script that you can run as any user.
First logout of the steam user:

exit

Then create a new script for running TU as any user:

nano run_tu_as_steam.sh

Add the following:

#!/bin/bash
su steam --shell /path/to/your/runscript-as-steam.sh

Now you can start your server:

sudo ./run_tu_as_steam.sh

Running the server 24/7
You can start your server using screen to keep it running all the time. First you have to ensure that screen is installed:
On Ubuntu / Debiant:

sudo apt-get install screen

On Archlinux:

pacman -S screen

On Fedora / CentOS / RHEL etc.:

yum install screen

On openSUSE:

zypper in screen

Create a new screen with:

screen -R tu

Then start your server:

sudo ./run_tu_as_steam.sh

Exit your screen by pressing Ctrl+A followed by Ctrl+D.
Check if the server is running using top.

Automatically rebooting and updating the server
You can set up cronjobs to handle automatic updates and regular server reboots.

  • Log in as root using su or sudo -i.
  • Enter crontab -e to edit your cronjobs.
  • Navigate to the bottom of the configuration file
  • Add _0 4 * * * killall TowerServer-Lin && /path/to/update-script/update_tu.sh && /path/to/run-script/run_tu_as_steam.sh

This will stop the server every day at 4 am, check for updates and start it again.

2 Likes

Question: is the server supposed to take so long to start? I’m running the server software and it’s slow as anything. It’s been running for at least 20 minutes and it’s still not showing up on the server list.

2 Likes

Dunno if you followed my tutorial but I made a mistake.
If you didn’t follow mine. Do you see any output? Also don’t close your terminal while the server is running

1 Like

I’m just supposed to click on it right? Just like I would to join a server via a link? Doesn’t seem to be working for me.

1 Like

Last thing the console said was “[2016.04.04-07.44.07:316][ 3]LogOnline:Verbose: Async task ‘FOnlineAsyncTaskSteamUpdateServer bWasSuccessful: 1 Session: Game’ succeeded in 0.000935 seconds” and it’s been like that for about 20 minutes now, and my server’s name isn’t showing up in the server list

1 Like

This means that your server is running. However, if you aren’t seeing it in the server list on steam, your ports don’t seem to be forwarded.

1 Like

You know, it’s times like this that are very useful for humbling me.

What happened was, I had put in the information for the ports to forward, but I hadn’t bothered to click the “Apply” button. I guess that’s an important lesson here- when you get to the port-fowarding bit, make sure your changes actually save.

(Deleted post above this one contained the same message, just not as a reply)

EDIT: Wait, nope, problems again. I’ve made sure the ports are forwarded this time, but it still isn’t showing up in the server list. Does the server software have to be run from the SteamCMD folder or can it be launched from the regular Steam interface?

EDIT AGAIN: Patience is a virtue. Now it’s showing up. Hopefully I can get on it.

EDIT x3: It worked! I closed the terminal and expected that to stop the server, but instead it still howed up in the list, and I joined and everything was fine, which baffled me. How was I able to connect if the software had stopped running? Well, it hadn’t, actually- there was still the software going in the background, as the Task Manager showed me. So I stopped that software, because it looked to be the software from the CMD folder and that wasn’t what I wanted to run. When I had tried to launch the software from the graphical Steam interface, it had thrown up that GameServerAPI error, and I presume that was (in this case) because another version of the server was already running.

So overall, the lessons here are A) make sure your port forward settings actrually save, B) make sure you aren’t trying to run multiple instances of the server software, C) when you’re done, make sure you check Task Manager to ensure that the server software actually closes instead of just the terminal, and D) be patient. Sometimes this takes a while.

Thanks for the help, y’all.

2 Likes

Okay, so what I think is going on is that I can only run the server if both Tower and TowerServer.exe are in the Background Processes section of the Task Manager, which happens after I close the console/terminal/whatever and wait a little bit. Is this intended operation?

1 Like

The server runs a bit querky but that’s to be expected. Having to open the link won’t be necessary in the future. [quote=“Zak, post:5, topic:5425”]
It will be anonymous login once valve adds us to the anonymous DS package. Hopefully by Early Access.
[/quote]

You can keep the terminal open to see the output. Seems weird that the server continues to run in the background.

1 Like

Yeah, I’ve found that the server actually won’t show up on the server list for me until I close the terminal, and even then it has to take a little while to move into the background processes. Also it seems like only the SteamCMD /tu/ folder version works, not the GUI Steam version. All in all, the server’s weird, but that’s fair because this entire thing is still in development.

1 Like

ok interesting.

also could you help me out plz? i don’t have tu but I’m running a server called “[GER] MoonlightgamesTG”. Could you please try joining it? I would appretiate that

1 Like

Uh, alright. I’m in the UK, shouldn’t be too hard.

1 Like

Looks like it’s working thx ;D

1 Like

No problem!

1 Like

Can anyone help me out here?

"Zak: Open your Steam client on any machine and open steam://rungameid/439660 to add the dedicated server package to your account.

I’m just supposed to click on it right? Just like I would to join a server via a link? Doesn’t seem to be working for me."

1 Like