Difference between revisions of "User:Gdude2002/Starting a Server"

From wiki
Jump to: navigation, search
(Finish off the Windows section)
(More work towards Linux instructions; taking a break)
Line 121: Line 121:
  
 
'''This is only recommended for advanced users!'''
 
'''This is only recommended for advanced users!'''
 +
 +
This guide assumes that you're using Arch Linux, and that you know what you're doing - however, the instructions should also work for other Linux distributions.
  
 
== Requirements ==
 
== Requirements ==
  
=== Setting up Wine ===
+
# The <code>wine</code> package (on Arch, this is in the [https://wiki.archlinux.org/index.php/Multilib Multilib repository])
 +
# The <code>wine-mono</code> package
 +
# A decently fast machine - the server is quite intensive on CPU, and Wine only makes things slower
 +
# If you're using Steam directly, you may want to use <code>winetricks</code> to install it
 +
 
 +
=== Setting up your environment ===
 +
 
 +
It's recommended that you run the server in 64-bit mode. While you will see some warnings about 32-bit libraries not working correctly, things should function just fine.
 +
 
 +
This guide assumes that you're using the default <code>WINEPREFIX</code> (which is <code>~/.wine</code>) and that you are not forcing it into 32-bit mode with the <code>WINEARCH</code> environment variable.
 +
 
 +
# Open a terminal - this guide assumes you're using <code>bash</code> as your shell, so adapt the commands as needed if you're not
 +
# Run <code>wine cfg</code> - this will set up your Wine prefix and open the configuration tool, which you can close once it appears
 +
 
 +
== Installing Staxel with Steam ==
 +
 
 +
# Install Steam using Wine - you can do this using <code>winetricks</code>, which has Steam under the "Install an application" section
 +
# Open Steam and install Staxel in the usual way
 +
# Move to the [[#Starting_the_server|Starting the server]] section
 +
 
 +
== Installing the Standalone version of Staxel ==
 +
 
 +
# Outside of wine, download your Standalone copy of Staxel
 +
# Copy it to a folder within <code>~/.wine/drive_c/</code>
 +
# TODO TODO TODO
 +
# Move to the [[#Starting_the_server|Starting the server]] section
  
== Starting the server with Steam ==
+
== Installing Staxel with SteamCMD ==
  
For a list of settings and what they do, please see the [[#Server_Configuration|Server Configuration]] section.
+
# Install SteamCMD using your package manager (On arch, it's available from the AUR)
 +
# Open a terminal and run <code>sudo steamcmd +quit</code> (use <code>su -c "steamcmd +quit"</code> if you don't have sudo set up)
 +
#* We do this to update SteamCMD, only root is able to do this
 +
# Run <code>steamcmd +login ACCOUNT_NAME PASSWORD +quit</code> to login to your Steam account
 +
#* Replace <code>ACCOUNT_NAME</code> and <code>PASSWORD</code> with your Steam login username and password
 +
# Create a file named <code>update_staxel.sh</code> and insert the contents of [https://gist.github.com/gdude2002/abc19a51b6ac012c34985afc5d6ea4aa this file]
 +
#
  
== Starting the server without Steam ==
+
== Starting the server ==
  
 
For a list of settings and what they do, please see the [[#Server_Configuration|Server Configuration]] section.
 
For a list of settings and what they do, please see the [[#Server_Configuration|Server Configuration]] section.

Revision as of 10:22, 27 January 2018

The following explains how to start a server and connect to it. Currently, there is no way to start a multiplayer server in-game, nor is there a way to limit a server to just Steam friends.

The developers have stated that they're looking into Steam for multiplayer networking - but this may be some time coming, as they have a very long list of things to do!

For reference, the default port for Staxel is 38465.

Windows

Staxel is designed with Windows in mind, and this is the easiest platform to host a server on.

If you're inexperienced with server hosting or just want to play with your friends, this is the best option for you.

Requirements

  • A copy of Staxel, either on Steam or the Standalone version
  • The ability to forward a port on your router (this is preferred)

If you're unable to forward ports, you may also use Hamachi. This is detailed towards the end of the Windows section.

Starting the server with Steam

Note: If you're using SteamCMD, skip to the next section.

Starting the server with Steam on Windows is very simple:

  1. Open up steam and find Staxel in your library
  2. Double-click on Staxel or click the play button
  3. Select "Dedicated Server" and click the play button

If you want to play Staxel at the same time, press the "Start game client with Steam" button now. This will open a copy of Staxel for you to play on.

For a list of settings and what they do, please see the Server Configuration section.

Starting the server without Steam

Starting the server with the Standalone version of Staxel is very simple:

  1. Open up the Staxel launcher
  2. Click on the "Server" button

If you want to play Staxel at the same time, press the "Start game client" button now. This will open a copy of Staxel for you to play on.

For a list of settings and what they do, please see the Server Configuration section.

Starting the server with the command-line

If you're working remotely, don't have a screen, or just don't want to use your mouse, you can also start the server from the command-line.

This is a more advanced technique - if you're not confident with your skills on the command-line, it's recommended that you choose one of the first two methods.

  1. Open up a copy of Powershell, or the Windows command prompt (cmd)
  2. Use cd to find your way to wherever you have Staxel installed
  3. Once you've found Staxel's install folder, cd into the bin folder
  4. Run Staxel.Server.exe and the server will start in the command-prompt

Please note: This method will not allow you to configure the server with the Server Wizard. Details on how to configure your server this way can be found in the Server Configuration section.

Installing the server using SteamCMD

If you have a dedicated Windows server, you can simply install and use Steam as you would at home. However, if you'd rather not run Steam all the time, you may prefer to work with SteamCMD instead.

This is a more advanced technique - if you're not confident with your skills on the command-line, it's recommended that you choose one of the first two methods. In fact, if you don't specifically need SteamCMD, please don't use it.

SteamCMD is a command-line application, which allows you to download and install games and game servers from Steam. If you're planning to do this, you may prefer to set up a separate Steam account with only Staxel on it, as you're going to have to save the password to your Steam account on the server if you want to make updates quicker.

Note: This guide assumes that you're installing SteamCMD to C:\steam\steamcmd and storing your games in C:\steam\games. If this isn't the case, remember to modify the paths below!

In short, here's what you'll need to do:

  1. Download a copy of SteamCMD to your computer and extract it
  2. Set up a couple of scripts to make your life easier
  3. Update and login with SteamCMD
  4. Download Staxel
  5. Run the server using the methods explained previously

If you need more detailed instructions:

  1. Download SteamCMD from this link and extract steamcmd.exe to C:\steam\steamcmd.
  2. Add C:\steam to your system's PATH
    • Open This PC (or My Computer on earlier versions of Windows)
    • Right-click a blank section of the window and select Properties
    • Select Advanced System Settings, and then select the Advanced tab in the window that appears
    • Click the Environment Variables button, select the PATH entry in the System Variables section, and hit Edit
      • On newer versions of Windows: Hit the Add button, type C:\steam into the box it gives you and click OK
      • On older versions of Windows: Add the following text to the value: ;C:\steam and click OK - don't forget the semicolon!
    • Click OK and close the windows you just opened
  3. Create a file named steam.bat in C:\steam and insert the contents of this file
  4. Open a command prompt or Powershell, type steam and hit enter - this will download Steam and you will be presented with a Steam> prompt
  5. Use login account_name password to log into your Steam account - follow the instructions given to authenticate with Steam Guard or 2-factor as necessary
  6. Type quit and hit enter to close SteamCMD
  7. Create a file named update_staxel.bat in C:\steam and insert the contents of this file
  8. Replace ACCOUNT_NAME and PASSWORD in the file with your Steam account name and password
  9. Go back to your command prompt or Powershell window, type update_staxel and hit enter - this will download and install Staxel in C:\steam\games\staxel
  10. Open C:\steam\games\staxel\_CommonRedist and install each of the requirements - if you're not planning to actually run the game, then you will not need to install DirectX, but do install everything else
  11. Once these are all installed, you're ready to go - See Starting the server without Steam or Starting the server with the command-line for information on running the server
  12. If you want to update the server again at any point, simply stop it and run update_staxel in a command prompt or Powershell again

Hamachi

Please note: Hamachi does impact the performance of your network, and may result in lag for your players. Please only use it as a last resort.

Many thanks to Edy Nelson for writing the original guide for this

If you're planning to do this, make sure your server is not set to Public mode.

  1. Install Hamachi from this page, and make sure anyone that wants to play also installs it
  2. Open a network, or "VPN tunnel"
  3. Give your friends the name of the network, and the password if you set one
  4. Set up your server as explained in the above sections
  5. Give your friends the IPv4 address assigned to you by Hamachi
    • You can right-click your name in Hamachi and click on "Copy IPv4 Address"
  6. Have your friends connect to the address you just sent them

Hamachi can be quite temperamental - it may be advantageous to use something more complicated (for example, Zero Tier One) if you have problems with it.

Linux

While the Staxel server does not have official Linux support, it is possible to at least get the server to run on Linux.

Please note: This is an unsupported setup. There may be stability issues. Additionally, the server will run slower than it would under Windows.

This is only recommended for advanced users!

This guide assumes that you're using Arch Linux, and that you know what you're doing - however, the instructions should also work for other Linux distributions.

Requirements

  1. The wine package (on Arch, this is in the Multilib repository)
  2. The wine-mono package
  3. A decently fast machine - the server is quite intensive on CPU, and Wine only makes things slower
  4. If you're using Steam directly, you may want to use winetricks to install it

Setting up your environment

It's recommended that you run the server in 64-bit mode. While you will see some warnings about 32-bit libraries not working correctly, things should function just fine.

This guide assumes that you're using the default WINEPREFIX (which is ~/.wine) and that you are not forcing it into 32-bit mode with the WINEARCH environment variable.

  1. Open a terminal - this guide assumes you're using bash as your shell, so adapt the commands as needed if you're not
  2. Run wine cfg - this will set up your Wine prefix and open the configuration tool, which you can close once it appears

Installing Staxel with Steam

  1. Install Steam using Wine - you can do this using winetricks, which has Steam under the "Install an application" section
  2. Open Steam and install Staxel in the usual way
  3. Move to the Starting the server section

Installing the Standalone version of Staxel

  1. Outside of wine, download your Standalone copy of Staxel
  2. Copy it to a folder within ~/.wine/drive_c/
  3. TODO TODO TODO
  4. Move to the Starting the server section

Installing Staxel with SteamCMD

  1. Install SteamCMD using your package manager (On arch, it's available from the AUR)
  2. Open a terminal and run sudo steamcmd +quit (use su -c "steamcmd +quit" if you don't have sudo set up)
    • We do this to update SteamCMD, only root is able to do this
  3. Run steamcmd +login ACCOUNT_NAME PASSWORD +quit to login to your Steam account
    • Replace ACCOUNT_NAME and PASSWORD with your Steam login username and password
  4. Create a file named update_staxel.sh and insert the contents of this file

Starting the server

For a list of settings and what they do, please see the Server Configuration section.

Headless instructions

For a list of settings and what they do, please see the Server Configuration section.

Server Configuration

For reference, the default port for Staxel is 38465.

Configuring with the Server Wizard

Configuring from the command-line