Beyond All Reason offline LAN server guide - Yaribz/SPADS GitHub Wiki

This guide explains how to play Beyond All Reason in multiplayer offline mode, using a custom local game server. This procedure is only required if you plan to play offline, with a LAN server and clients which are not connected to Internet. It assumes that a LAN server was installed by following the Beyond All Reason LAN server quick install guide for Windows or Linux. It also assumes the Beyond All Reason LAN server customization procedure has been performed.

By default, the LAN server automatically auto-updates all its components (game, engine, maps...) to match the versions used online on official Beyond All Reason lobby server. This works well when the LAN server and the clients are connected to Internet, as the versions of all the components will always match thanks to the auto-update systems. However, if the server or the clients stay offline for some time, all sorts of version mismatches may happen regarding game, engine and maps: server versions may become newer than the clients ones and vice versa. In such cases, when versions are inconsistent between the server and the clients, it's not possible for the clients to play on the LAN server: various problems may appear, such as invalid game version messages, auto-download errors, unavailable maps, or even battle lobby not appearing in the list.

This document explains how to deal with this issue by preparing offline install/update packages for Beyond All Reason clients, containing the exact versions of the components used by the LAN server. This procedure is also useful for LAN parties with slow Internet connection, as it saves download time (data will be fetched directly from the LAN during clients install/update). Steps 1 to 3 explain how to generate offline install/update packages (step 3 requires an Internet connection), while step 4 explains how to use these packages to install/update Beyond All Reason clients for offline play. Offline configuration of Beyond All Reason clients is made in a non-invasive way, just by adding a new configuration template Custom to the existing ones. Once installed, one can switch between the offline and online configurations easily as described in the last section of this document.

Walkthrough video

Step 1: Identify the game and engine versions currently used by SPADS

  • Start SPADS if it isn't already running (from SPADS installation directory, enter perl spads.pl etc/spads.conf)

  • Check SPADS output (either directly in the console used to start it, or in main log file spads.log located in the var/log subdirectory of SPADS installation directory) and find the last line matching NOTICE - [SPADS] Hosting game ... using engine version ..., for example:

    NOTICE   - [SPADS] Hosting game "Beyond All Reason test-25226-e436036" using engine version "105.1.1-2240-gd01542d BAR105"
    

    This log line provides the game and engine versions currently used by SPADS. The second part of the engine version field (BAR105 in this example) is the engine branch, it must be ignored. In the remaining of this guide, following values will be used as examples:

    • game version: Beyond All Reason test-25226-e436036
    • engine version: 105.1.1-2240-gd01542d
  • Stop SPADS by sending the !quit command to the LAN server using an account with privileged access (you may have to authenticate yourself first, using the !auth command, cf the Beyond All Reason LAN server customization guide)

Step 2: Disable game components auto-update on the LAN server

It is recommended to lock the versions of the game components used by the server, so that they won't change once offline packages are generated. To do this, auto-update of game components must be disabled on the server as detailed below.

Note: when performing changes in SPADS configuration files, it is recommended to keep the original configuration lines commented (i.e. prefixed with #), above the modified ones, so that you can revert the changes easily when needed. This will make it possible to re-enable game auto-updates easily when the server is connected back to Internet and/or after a LAN party.

2.1) Open main SPADS configuration file spads.conf

The spads.conf file contains the settings which must be modified to disable auto-updates. This file is located in etc sub-directory of SPADS installation directory.

2.2) Disable engine auto-updates

SPADS can be configured either to auto-update the game engine as new versions are published online, or to stick to a specific game engine version. This is configured by the autoManagedSpringVersion setting. When SPADS is installed using the Beyond All Reason LAN server template, the default value for this setting is [RECOIL]bar. This means the Recoil engine is used and automatically updated to match the version used on official BAR (Beyond All Reason) lobby. You need to change this setting to stop engine auto-updates and force SPADS to stick to the version identified in step 1 (105.1.1-2240-gd01542d in our example). To do so, in spads.conf file replace following line:

autoManagedSpringVersion:[RECOIL]bar

with:

# engine auto-update disabled for offline play
# autoManagedSpringVersion:[RECOIL]bar
autoManagedSpringVersion:[RECOIL]105.1.1-2240-gd01542d

(replace 105.1.1-2240-gd01542d with the engine version identified in step 1)

2.3) Disable game and maps auto-updates

Auto-update of Beyond All Reason (including maps) is managed by a SPADS plugin named BarAutoUpdate. When SPADS is installed using the Beyond All Reason LAN server template, this plugin is automatically installed and enabled. This plugin must be removed from the SPADS auto-load plugin list as follows. In spads.conf file, replace following line:

autoLoadPlugins:LanServer;BarChobby;BarAutoUpdate

with:

# BarAutoUpdate plugin removed for offline play
# autoLoadPlugins:LanServer;BarChobby;BarAutoUpdate
autoLoadPlugins:LanServer;BarChobby

2.4) Optional: disable SPADS auto-updates

By default, SPADS also tries to auto-update itself on startup and at regular intervals, which will fail when running offline. This is not really problematic, the only downside is that SPADS will print warnings and raise alerts when it can't contact the update server. Disabling SPADS auto-updates is optional and should only be performed if you want to avoid these messages.

To disable SPADS auto-updates, in spads.conf file, replace following line:

autoUpdateRelease:unstable

with:

# SPADS auto-update disabled while server is offline to avoid warnings
# autoUpdateRelease:unstable
autoUpdateRelease:

2.5) Start SPADS

Save changes in spads.conf file and repeat Step 1 (except the last action consisting in stopping SPADS), to ensure SPADS works correctly with new configuration and to check the versions of the game components used by SPADS are exactly those previously identified.

Step 3: Generate Beyond All Reason offline install/update packages

In this step, the getOfflineBarPackages tool will be used to generate Beyond All Reason offline install/update packages from official online resources. An Internet connection is required.

  • Download the getOfflineBarPackages tool for Windows (getOfflineBarPackages.exe) or Linux (getOfflineBarPackages.pl) in the location where you want to generate the Beyond All Reason offline packages (space required: 2 GB for base game contents and 16 GB for maps)

  • Choose a way to import Beyond All Reason maps in offline packages:

    The Beyond All Reason maps should already be available locally on the LAN server system (they are automatically downloaded during SPADS installation). That's why the getOfflineBarPackages tool does NOT retrieve them by default, to avoid re-downloads. If you have a fast Internet connection and don't mind re-downloading them, you can add the -m command line option in the commands listed below, to instruct getOfflineBarPackages to retrieve all Beyond All Reason maps automatically by itself. Otherwise, you will have to copy them manually from the LAN server, as detailed later.

  • Run the getOfflineBarPackages tool as follows (replace Beyond All Reason test-25226-e436036 and 105.1.1-2240-gd01542d with the game and engine versions identified in step 1):

    For Windows:

    getOfflineBarPackages.exe -g "Beyond All Reason test-25226-e436036" -e "105.1.1-2240-gd01542d"
    

    For Linux:

    perl getOfflineBarPackages.pl -g "Beyond All Reason test-25226-e436036" -e "105.1.1-2240-gd01542d"
    

    This step can take some time as a lot of data is downloaded and extracted. A new timestamped subdirectory will be created in current directory, as indicated by the line Output: .../BAR-offline_XXXXXXXX-XXXXXX printed in output. This subdirectory will contain the output of the getOfflineBarPackages tool, i.e. Beyond All Reason offline install/update packages.

  • Optional: copy maps from LAN server into offline install/update packages

    If you added the -m command line option in the commands above when running getOfflineBarPackages, all maps have already been downloaded and included automatically in getOfflineBarPackages output directory. If you didn't, you need to copy them manually from the LAN server (subdirectory var/spring/data/maps of SPADS installation directory) into the offline Beyond All Reason install/update packages (subdirectory data/maps of getOfflineBarPackages output directory). You can also choose to manually manage maps yourself later by placing them directly in the maps subdirectory of the Beyond All Reason data directory on the client systems.

Step 4: Deploy Beyond All Reason offline install/update packages to the clients

In this step, we use the packages generated in previous step to install/update Beyond All Reason on client systems for offline play. This step must be performed on all clients systems that will be used to play on the LAN server. It can be performed offline. The README.txt file included with the offline install/update packages contains the instructions for this step, they are duplicated below for convenience:

4.1) Install/update procedure:

For Windows systems

  1. If Beyond All Reason is NOT installed on the system yet:

    • run the installer (Beyond-All-Reason-X.XXXX.X.exe)
    • note the install directory as it will be used in step 2
    • at the end of the installation, uncheck Run Beyond-All-Reason before clicking on Finish

    If Beyond All Reason is already installed on the system:

    • start the Beyond All Reason launcher
    • click on the Open Install Directory button (this will automatically open the data subdirectory of your Beyond All Reason install directory, which will be used in step 2)
    • close the Beyond All Reason launcher
  2. Copy the content of the data and data-windows directories of the offline packages into the data subdirectory of your Beyond All Reason install directory, overwriting files if needed

For Linux systems

  1. If Beyond All Reason is NOT installed on the system yet:

    • Copy the Beyond All Reason AppImage file (Beyond-All-Reason-X.XXXX.X.AppImage) locally and set execute permission on it
    • Identify the directory that will be used to store game data:
      • If the XDG_STATE_HOME environment variable is defined, then the Beyond All Reason data directory is: $XDG_STATE_HOME/Beyond All Reason
      • Else the Beyond All Reason data directory is $HOME/.local/state/Beyond All Reason
    • Create the Beyond All Reason data directory

    If Beyond All Reason is already installed on the system:

    • start the Beyond All Reason launcher (Beyond All Reason AppImage)
    • click on the Open Install Directory button (this will automatically open the Beyond All Reason data directory)
    • close the Beyond All Reason launcher
  2. Copy the content of the data and data-linux directories of the offline packages into the Beyond All Reason data directory, overwriting files if needed

4.2) Configuration of Beyond All Reason client (Chobby):

  • Start the Beyond All Reason launcher, ensure the Update checkbox is unchecked and the Custom config is selected in the top right dropdown menu before clicking on Start
  • If the Register window opens automatically: click on Cancel
  • In the right menu, click on the Settings tab then on the Developer subtab
  • In the Server Address text field, replace the default value with the IP address of the LAN server
  • Click on the Login button in the top right corner
  • In the window that just opened, ensure the Login tab is selected
  • Type the desired user name for local play in the Username text field, then click on the Login button (you can leave the Password text field empty as it is ignored by the LAN server)
  • In the left menu, click on the Multiplayer & Coop button then on the Battle list button

How to switch the Beyond All Reason client between offline and online configurations

This section describes how to switch between offline and online configurations on a Beyond All Reason client once step 4 has been performed.

Switching from offline to online configuration

  • Start the Beyond All Reason launcher, enable the Update checkbox and select the Alpha config in the top right dropdown menu
  • Click on the Update button to trigger online update
  • Once update is over, click on the Start button
  • In the right menu, click on the Settings tab then on the Lobby subtab
  • In the Server Address combobox, select the current official online Beyond All Reason server server4.beyondallreason.info
  • Click on the Login button in the top right corner
  • Ensure your online user name and password are configured in the Login tab of the window that just opened, then click on the Login button

Switching from online to offline configuration

  • Start the Beyond All Reason launcher, uncheck the Update checkbox and click on the Open Install Directory button
  • Close the launcher
  • In the window that opened (in Beyond All Reason data directory):
    • Delete file config.json
    • Make a copy of file config-custom.json and rename this copy to config.json
  • Start the Beyond All Reason launcher and select the Custom config in the top right dropdown menu before clicking on Start
  • In the right menu, click on the Settings tab then on the Developer subtab
  • In the Server Address text field, replace the default value with the IP address of the LAN server
  • Click on the Login button in the top right corner
  • Type the desired user name for local play in the Username text field, then click on the Login button (you can leave the Password text field empty as it is ignored by the LAN server)