DFJacob / AbioticFactorDedicatedServer

20 stars 1 forks source link

Linux Dedicated server guide - updated #3

Open titanbubu opened 3 months ago

titanbubu commented 3 months ago

Installing the Abiotic Dedicated Server to Ubuntu

Note: Do not run as user root - make a user called anything else and give them sudo permissions Example: sudo useradd -m abiotic sudo -u abiotic -s Now login to that user and go to their home directory cd ~ to start this guide

1. Prepare the server with required packages sudo apt update sudo apt upgrade -y sudo apt install software-properties-common lsb-release wget

2. Install Wine Add repositories sudo mkdir -pm755 /etc/apt/keyrings sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key

sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources

sudo dpkg --add-architecture i386 sudo apt update sudo apt install --install-recommends winehq-staging sudo apt install cabextract winbind screen xvfb

3. Set up SteamCMD sudo add-apt-repository multiverse sudo apt-add-repository non-free sudo apt update sudo apt install steamcmd

4. Install Abiotic server (example location - change it to whatever you like)

make a directory for server files to live in mkdir /home/abiotic/abioticserver download the game via steamcmd forcing it to use the windows files (you'll get an error if you don't do this) /usr/games/steamcmd +@sSteamCmdForcePlatformType windows +force_install_dir /home/abiotic/abioticserver +login anonymous +app_update 2857200 +quit

5. Configure server

create the shell script to run your server (we're basically changing the .bat instructions to .sh) touch /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh edit this new file with sudo nano /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh add this to the file and change your password, server name, and world save name if you import any server save from your single player etc. (thank you @sirwillis92 for the changes to this)

#!/bin/bash
xvfb-run wine64 /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/AbioticFactorServer-Win64-Shipping.exe -log -newconsole -useperfthreads -NoAsyncLoadingThread -MaxServerPlayers=6 -PORT=7777 -QUERYPORT=27015 -tcp -ServerPassword=yourpassword -SteamServerName="yourserver" -WorldSaveName="Cascade"

save and close it (ctrl+x)

6. Forward your ports 7777 and 27015 to your server

7. Start the server by running your runserver.sh

We can't start the .sh without getting file permissions chmod +x /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh then cross your fingers /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh you'll get a bunch of errors, but it should still work turn it off with ctrl+z

Running this as a script right in your terminal will take over your terminal so I recommend running it as a service. I seem to have to reboot between server launches but that's what LXCs are good at.

Run as a service

1. create the service file sudo nano /etc/systemd/system/abiotic.service

2. Fill it with this (edit as necessary for your own setup):

[Unit]
Description=Abiotic Factor  Server
Wants=network-online.target
After=network-online.target

[Service]
User=abiotic
Group=abiotic
WorkingDirectory=/home/abiotic/abioticserver/
ExecStartPre=/usr/games/steamcmd +@sSteamCmdForcePlatformType windows +force_install_dir /home/abiotic/abioticserver +login anonymous +app_update 2857200 +quit
ExecStart=/home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh
Restart=always

[Install]
WantedBy=multi-user.target

Save it

3. Enable the service sudo systemctl enable abiotic

4. Start the service sudo systemctl start abiotic

Use stop and disable commands to do that respectively.

That's it. It will auto restart on a power cycle and always update the server files to the latest build.

sirwillis92 commented 3 months ago

I was able to get it running with xvbf-run wine64

here is a copy of what my shell script looks like: $ cat examplestart.sh

!/bin/bash

xvfb-run wine64 AbioticFactor/Binaries/Win64/AbioticFactorServer-Win64-Shipping.exe -log -newconole -useperfthreads -NoAsyncLoadingThread -MaxServerPlayers=6 -PORT=7777 -QUERYPORT=27015 -ServerPassword=ServerPassword -SteamServerName="ServerName" -WorldSaveName="Cascade" `

I end up running into this error though: LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamCreateServer bWasSuccessful: 0' failed in 15.001264 seconds which seems to mean that the server is not listed on the steam server list. I am not sure how to fix this, and sine the game doesn't have a direct connect option in-game, me or my friends can't connect [2024.05.04-16.28.35:105][ 0]LogWorld: Bringing up level for play took: 0.265297 LogGameMode: Display: Match State Changed from EnteringMap to WaitingToStart [2024.05.04-16.28.35:208][ 0]LogGameMode: Display: Match State Changed from EnteringMap to WaitingToStart [2024.05.04-16.28.35:381][ 0]LogGameState: Match State Changed from EnteringMap to WaitingToStart [2024.05.04-16.28.35:382][ 0]LogLoad: Took 1.033981 seconds to LoadMap(/Game/Maps/Facility) LogInit: Display: Engine is initialized. Leaving FEngineLoop::Init() [2024.05.04-16.28.35:394][ 0]LogInit: Display: Engine is initialized. Leaving FEngineLoop::Init() [2024.05.04-16.28.35:394][ 0]LogLoad: (Engine Initialization) Total time: 3.48 seconds 0130:fixme:winsock:WS_setsockopt SO_SNDBUF ignoring request to disable send buffering 0130:fixme:winsock:WS_setsockopt SO_SNDBUF ignoring request to disable send buffering 0130:fixme:winsock:WS_setsockopt SO_SNDBUF ignoring request to disable send buffering 0130:fixme:winsock:WS_setsockopt SO_SNDBUF ignoring request to disable send buffering 0130:fixme:winsock:WS_setsockopt SO_SNDBUF ignoring request to disable send buffering LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamCreateServer bWasSuccessful: 0' failed in 15.001264 seconds [2024.05.04-16.28.50:232][443]LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamCreateServer bWasSuccessful: 0' failed in 15.001264 seconds 015c:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,00000000198AFC48,0000000000000000): stub

sirwillis92 commented 3 months ago

I was able to resolve this by adding the -tcp tag to the startup command (i placed it after the QUERYPORT tag. This has now loaded the game server 3 times in a row and is visible in the steam server list

xvfb-run wine64 AbioticFactor/Binaries/Win64/AbioticFactorServer-Win64-Shipping.exe -log -newconole -useperfthreads -NoAsyncLoadingThread -MaxServerPlayers=6 -PORT=7777 -QUERYPORT=27015 -tcp -ServerPassword=ServerPassword -SteamServerName="ServerName" -WorldSaveName="Cascade"

LogOnlineSession: Display: OSS: Session creation completed. Automatic start is turned on, starting session now. [2024.05.04-16.53.14:337][ 23] LogOnlineSession: Display: OSS: Session creation completed. Automatic start is turned on, starting session now.

titanbubu commented 3 months ago

Worked like a charm thank you @sirwillis92 ! @DFJacob please pin this for us Linux users! :D

So to compile the steps:

Installing the Abiotic Dedicated Server to Ubuntu

Note: Do not run as user root - make a user called anything else and give them sudo permissions Example: sudo useradd -m abiotic sudo -u abiotic -s Now login to that user and go to their home directory cd ~ to start this guide

1. Prepare the server with required packages sudo apt update sudo apt upgrade -y sudo apt install software-properties-common lsb-release wget

2. Install Wine Add repositories sudo mkdir -pm755 /etc/apt/keyrings sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key

sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/$(lsb_release -is | tr '[:upper:]' '[:lower:]')/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources

sudo dpkg --add-architecture i386 sudo apt update sudo apt install --install-recommends winehq-staging sudo apt install cabextract winbind screen xvfb

3. Set up SteamCMD sudo add-apt-repository multiverse sudo apt-add-repository non-free sudo apt update sudo apt install steamcmd

4. Install Abiotic server (example location - change it to whatever you like)

make a directory for server files to live in mkdir /home/abiotic/abioticserver download the game via steamcmd forcing it to use the windows files (you'll get an error if you don't do this) /usr/games/steamcmd +@sSteamCmdForcePlatformType windows +force_install_dir /home/abiotic/abioticserver +login anonymous +app_update 2857200 +quit

5. Configure server

create the shell script to run your server (we're basically changing the .bat instructions to .sh) touch /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh edit this new file with sudo nano /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh add this to the file and change your password, server name, and world save name if you import any server save from your single player etc. (thank you @sirwillis92 for the changes to this)

#!/bin/bash
xvfb-run wine64 /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/AbioticFactorServer-Win64-Shipping.exe -log -newconole -useperfthreads -NoAsyncLoadingThread -MaxServerPlayers=6 -PORT=7777 -QUERYPORT=27015 -tcp -ServerPassword=yourpassword -SteamServerName="yourserver" -WorldSaveName="Cascade"

save and close it (ctrl+x)

6. Forward your ports 7777 and 27015 to your server

7. Start the server by running your runserver.sh We can't start the .sh without getting file permissions chmod +x /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh then cross your fingers /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh you'll get a bunch of errors, but it should still work turn it off with ctrl+z

Running this as a script right in your terminal will take over your terminal so I recommend running it as a service. I seem to have to reboot between server launches but that's what LXCs are good at.

Run as a service

1. create the service file sudo nano /etc/systemd/system/abiotic.service

2. Fill it with this (edit as necessary for your own setup):

[Unit]
Description=Abiotic Factor  Server
Wants=network-online.target
After=network-online.target

[Service]
User=abiotic
Group=abiotic
WorkingDirectory=/home/abiotic/abioticserver/
ExecStartPre=/usr/games/steamcmd +@sSteamCmdForcePlatformType windows +force_install_dir /home/abiotic/abioticserver +login anonymous +app_update 2857200 +quit
ExecStart=/home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh
Restart=always

[Install]
WantedBy=multi-user.target

Save it

3. Enable the service sudo systemctl enable abiotic

4. Start the service sudo systemctl start abiotic

Use stop and disable commands to do that respectively.

That's it. It will auto restart on a power cycle and always update the server files to the latest build.

ToHold commented 3 months ago

I'm new to game server hosting, usually in website developpement I use systemctl to start or end service then I'm able to quit ssh sesssion and the service's still active. But with xvfb-run wine64 I'm forced to keep ssh shell open, is there a way to use it like a service ?

ToHold commented 3 months ago

I'm new to game server hosting, usually in website developpement I use systemctl to start or end service then I'm able to quit ssh sesssion and the service's still active. But with xvfb-run wine64 I'm forced to keep ssh shell open, is there a way to use it like a service ?

Ok found it : ssh -X -y user@address sudo /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh

Pleut commented 3 months ago

@sirwillis92 Thank you so much! I had created a Docker container (https://github.com/Pleut/abiotic-factor-linux-docker) for it, but so far it only started after several attempts (with the same error message). Up to now we hadn't found a solution for this but with your solution it works. If you don't mind me asking: How did you come up with the solution?

dvGrab commented 3 months ago

Anybody know where the world savegame is stored?

rlex commented 3 months ago

No luck for me. wine won't even start. I tried it with proton instead, and it starts, but it seems it doesn't start steam query port, so i can't connect. And in-game server browser doesn't have filter, so i can't find my server.

dvGrab commented 3 months ago

If you want to transfer your SaveGame from an ingame hosted lobby, you can take a look at your local PC. (%appdata%\Local\AbioticFactor\Saved\SaveGames\YOURMAPNAME).

Start the dedicated server once, to let the server create all neccessary folders.

Upload your local savegame to "abioticserver/AbioticFactor/Saved/SaveGames/Server/Worlds" and change the map name in your startparamter of the server.

dvGrab commented 3 months ago

Remove -NoAsyncLoadingThread from parameters for better server performance.

bensoutendijk commented 3 months ago

Seconding this. Please pin and help maintain this guide for linux based hosting. It worked like a charm!

I use Linux because it is simpler for me to plug in a computer without any peripherals and just ssh commands e.g. ./valheimserver start. A guide like this is very important to help me self-host a server for my friends.

titanbubu commented 3 months ago

I'm new to game server hosting, usually in website developpement I use systemctl to start or end service then I'm able to quit ssh sesssion and the service's still active. But with xvfb-run wine64 I'm forced to keep ssh shell open, is there a way to use it like a service ?

Ok found it : ssh -X -y user@address sudo /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh

I updated the guide to include service setup.

ejstrat commented 3 months ago

There was a hotfix today and now it's claiming the server has versioning issues. What's the procedure for updating the installed version with this method?

ejstrat commented 3 months ago

There was a hotfix today and now it's claiming the server has versioning issues. What's the procedure for updating the installed version with this method?

Ignore previous, poor reading comprehension on my part. For anyone needing an update of the server: sudo systemctl stop abiotic sudo systemctl start abiotic Ctrl+Z

Edit: interestingly enough, even though it was the server version that didn't have the most recent hotfix, in-game the error stated that the server version was more recent. Surely just a bug, but something for people to be aware of.

titanbubu commented 3 months ago

There was a hotfix today and now it's claiming the server has versioning issues. What's the procedure for updating the installed version with this method?

Ignore previous, poor reading comprehension on my part. For anyone needing an update of the server: sudo systemctl stop abiotic sudo systemctl start abiotic Ctrl+Z

This is the way! You can also restart the server - either way it will run the service script and update everything.

MiskatonicU commented 3 months ago

If you want a fairly "turnkey" solution for a dedicated server, I was able to run one on an Amazon Lightsail Instance using an Ubuntu 22 image, Docker and the Docker Compose setup created by @Pleut. The steps would also probably work on an Amazon EC2 instance, but 'free tier' instances like t2.micro don't have enough resources to make them viable.

Once the server was up in the Docker container I verified I was able to connect to the server via the in game server browser.

Here's a guide covering the steps I took.

Create an Amazon Lightsail Instance

  1. Create an AWS Account if you don't have one already, create one here.
  2. Once logged into AWS, access the Lightsail portal here.
  3. Click "Create Instance"
  4. Choose the Region that best makes sense for your location.
  5. Select "Linux" for the platform, then switch to "Operating System Only" and pick "Ubuntu 22.04 LTS"
  6. You can use the default SSH key or create a new one.
  7. Leave the network type on "Dual Stack" as you'll want a public IPv4 address.
  8. Select a Size, I went with the $12/Month option, but you might be able to use a smaller size. If you are a new Lightsail/AWS user, you should get 3 Months free on Sizes up to $12/Month.
  9. Give your instance a meaningful name, like "GameServer-1" or maybe "AbioticServer-1"
  10. Click "Create Instance".
  11. Wait for the instance to start.

The next steps will be to configure the Networking to allow the needed UDP ports for the server and logging into the ubuntu server instance using SSH.

Configure Networking and Connect to the Lightsail Instance over SSH

  1. If you don't automatically get redirected to the instance configuration page, you can find it by clicking "Instances" from the menu on the left, then clicking your instance, it should have the name you set.
  2. Switch to the Network tab for the instance and click "Add Rule"
  3. From the drop down pick "Custom UDP" and set the port to 7777, then click "Create".
  4. Repeat Steps 2 and 3, but set the port to 27015.
  5. You can also remove the HTTP port 80 Rule, as the server won't need it. Port 80 is typically used for web servers.
  6. Switch to the Connect tab.
  7. Connect to the server using either the web-based SSH client by clicking "Connect using SSH" or by using the SSH client of your choice. Using an external client will require downloading the SSH key and then using the -i option to connect as the ubuntu user using the Public IPv4 address assigned to the instance like so:
    ssh -i DownloadedKey.pem ubuntu@IPv4ServerAddress
  8. Once connected you should be logged in as the ubuntu user. Next we'll be installing Docker and Docker Compose so we can use the files created by @Pleut.

Install Docker

We'll be following the recommended steps to install Docker onto our ubuntu instance from the apt repository.

  1. Set up Docker's apt repository by running the following commands in order.
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

The next command is long and split across multiple lines using \, copy and paste the whole thing into your terminal to run it:

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Finally rerun apt update:

sudo apt-get update
  1. Install the Docker packages.

To install the latest version of Docker, Docker Compose and other necessary pieces, run the following command:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
  1. Verify that the Docker Engine installation is successful by running the hello-world image.
sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.

  1. Set docker to startup when the instance starts up sudo systemctl enable docker

  2. Optionally you can add the ubuntu user to the Docker group so that you no longer need to use sudo. sudo usermod -a -G docker $(whoami)

You'll need to disconnect and reconnect form the Lightsail instance for the group membership change to be picked up. You can do that now, or just continue to use sudo during this session. For subsequent steps I'll assume you reconnected and thus no longer need to use sudo.

Use Git to clone @Pleut 's Github Repo with the needed Docker container files.

The ubuntu image will already have Git installed, so we can clone @Pleut 's Github repo and then use it to run our server. You can pretty much just follow the directions outlined here after cloning the repo but I'll go through the steps below.

  1. Clone the Github repo:

    git clone https://github.com/Pleut/abiotic-factor-linux-docker.git
  2. This will create a folder abiotic-factor-linux-docker inside of which will be the Docker setup and compose file. Change directories to this new folder:

    cd abiotic-factor-linux-docker

Go ahead and make the data directory where the files exported by the Docker container will live.

mkdir data
  1. Inside the cloned directory you should find several files, including the main Docker compose file which we'll need to edit to set some server options. Open it with text editor, like 'vi':

    vi docker-compose.yml
  2. The contents of the file will be as follows:

    services:
    abiotic-server:
    image: abiotic:latest
    build:
      context: .
      dockerfile: Dockerfile
    restart: unless-stopped
    volumes:
      - "./data:/server/AbioticFactor/Saved"
    environment:
      - MaxServerPlayers=6
      - Port=7777
      - QueryPort=27015
      - ServerPassword=password
      - SteamServerName=Linux Server
      - UsePerfThreads=true
      - NoAsyncLoadingThread=true
      - WorldSaveName=Cascade
    #     - AutoUpdate=true
    #     - AdditionalArgs=-SandboxIniPath=Config/WindowsServer/Server1Sandbox.ini
    ports:
      - "0.0.0.0:7777:7777/udp"
      - "0.0.0.0:27015:27015/udp"

    At the very least you'll want to set ServerPassword and SteamServerName to something unique. You may also want to change the WorldSaveName to something other than the default.

Build and Start the server with Docker Compose.

We are now ready to build the Docker image for the server by running Docker Compose with the appropriate options.

  1. Run Docker Compose with the the -d and --build options so it will both build the container and run it in 'detached' mode.

    docker compose up -d --build
  2. It will take several minutes for the container to pull down the packages it needs, like SteamCMD and then download and install the Abiotiric Factor dedicated server. Once it's done building, it should start the server, after which you should be returned to an interactive terminal.

  3. To confirm the server is starting up, view the server's log by using docker logs to monitor the progress:

    docker logs abiotic-factor-linux-docker-abiotic-server-1

If you wish to continually follow the logs, add the -f option to the above command:

docker logs abiotic-factor-linux-docker-abiotic-server-1 -f

You can stop following the log by using CTRL-C to terminate the log follow.

  1. The server will take a few minutes to start up, during which you may seem some WARNINGS or ERRORS in the log, but once you see:
    LogInit: Display: Game Engine Initialized.
    LogInit: Display: Starting Game.

    The server is nearly started up and you should be able to find it in either the Steam Client's server browser, or the server browser inside of Abiotic Factor. It should have the name you set, and will require the password you set to connect.

While the server should be up at this point, it may be worth waiting a few more minutes until you see the first world save occur:

LogSaveWorld: Display: Finished autosaving

After which you'll be able to find the save file for the server under the data directory, though if you changed the WorldSaveName, it'll be what you set, rather than Cascade: /abiotic-factor-linux-docker/data/SaveGames/Server/Worlds/Cascade/

Enjoy your dedicated server in the cloud!

To shut down the server, from the same directory you ran docker compose up run:

docker compose down

I'd also recommend stopping the Lightsail instance when not in use to avoid additional costs.

ToHold commented 3 months ago

Am I the only one who the world is not saving since the update ? Figured it out yesterday by restarting the service because I wanted to change server's name.

Rights seems ok ?

ls -la /home/abiotic/abioticserver/AbioticFactor/Saved/SaveGames/Server -rw-r--r-- 1 abiotic abiotic 164 May 7 05:31 Admin.ini -rw-r--r-- 1 abiotic abiotic 1586 May 5 01:27 UserSettings.sav drwxr-xr-x 7 abiotic abiotic 4096 May 6 08:19 Worlds

ls -la /home/abiotic/abioticserver/AbioticFactor/Saved/SaveGames/Server/Worlds drwxr-xr-x 3 abiotic abiotic 4096 May 5 22:42 'My World'

ls -la /home/abiotic/abioticserver/AbioticFactor/Saved/SaveGames/Server/Worlds/My World drwxr-xr-x 2 abiotic abiotic 4096 May 5 12:33 PlayerData -rw-r--r-- 1 abiotic abiotic 2 May 5 10:38 SandboxSettings.ini -rw-r--r-- 1 abiotic abiotic 2838848 May 7 05:36 WorldSave_Facility.sav -rw-r--r-- 1 abiotic abiotic 19214 May 6 07:37 WorldSave_Facility_MFFoundry.sav -rw-r--r-- 1 abiotic abiotic 284939 May 5 22:07 WorldSave_Facility_MFHQ.sav -rw-r--r-- 1 abiotic abiotic 1643483 May 7 05:36 WorldSave_Facility_MFMines.sav -rw-r--r-- 1 abiotic abiotic 2594222 May 6 08:07 WorldSave_Facility_MFWest.sav -rw-r--r-- 1 abiotic abiotic 979002 May 5 22:37 WorldSave_Facility_Office1.sav -rw-r--r-- 1 abiotic abiotic 6583257 May 5 19:57 WorldSave_Facility_Office2.sav -rw-r--r-- 1 abiotic abiotic 2948052 May 5 13:55 WorldSave_Facility_Office3.sav -rw-r--r-- 1 abiotic abiotic 1827227 May 5 22:37 WorldSave_Facility_Office4.sav -rw-r--r-- 1 abiotic abiotic 1825 May 7 05:36 WorldSave_MetaData.sav -rw-r--r-- 1 abiotic abiotic 1810 May 5 14:25 WorldSave_V_Anteverse_A.sav -rw-r--r-- 1 abiotic abiotic 210136 May 5 22:12 WorldSave_V_Dummy.sav -rw-r--r-- 1 abiotic abiotic 7410 May 5 14:25 WorldSave_V_FOG.sav -rw-r--r-- 1 abiotic abiotic 122560 May 5 22:52 WorldSave_V_Train.sav

EDIT

ssh -X -y user@address sudo /home/abiotic/abioticserver/AbioticFactor/Binaries/Win64/runserver.sh\ Still works

But the service has no access to write : [2024.05.06-08.28.13:431][ 69]LogSaveWorld: Error: Failed to save world save to: Server/Worlds/My World /WorldSave_Facility [2024.05.06-08.28.13:439][ 69]LogSaveWorld: Error: Failed to save world save to: Server/Worlds/My World /WorldSave_Facility_MFMines [2024.05.06-08.28.13:439][ 69]LogSaveWorld: Error: Failed to save world save to: Server/Worlds/My World /WorldSave_MetaData [2024.05.06-08.28.13:452][ 69]LogSaveWorld: Error: Failed to save world save to: Server/Worlds/My World /WorldSave_Facility_MFWest [2024.05.06-08.28.13:453][ 69]LogSaveWorld: Error: Failed to save player save to: Server/Worlds/My World /PlayerData/Player_76561197971374969 [2024.05.06-08.28.13:453][ 69]LogScript: Error: Script Msg: Failed to complete save, check logs

titanbubu commented 3 months ago

@ToHold

I've never run into that but searching it up came to https://superuser.com/questions/1403601/systemd-service-permission-denied

another solution is https://www.reddit.com/r/linuxquestions/comments/szjn3w/permission_denied_when_starting_systemd_service/

clouduppance commented 3 months ago

I have encountered a problem.

[2024.05.07-16.30.17:392][ 34]LogOnlineSession: Warning: STEAM: Server setting ,StoryProgress_s:Office overflows Steam SetGameTags call
[2024.05.07-16.30.17:393][ 34]LogOnlineSession: Warning: STEAM: Server setting ,ModifiedRuleset_i:0 overflows Steam SetGameTags call
[2024.05.07-16.30.17:394][ 34]LogOnlineSession: Display: OSS: Session creation completed. Automatic start is turned on, starting session now.
[2024.05.07-16.30.21:080][146]LogOnlineSession: Warning: STEAM: Server setting ,StoryProgress_s:Office overflows Steam SetGameTags call
[2024.05.07-16.30.21:080][146]LogOnlineSession: Warning: STEAM: Server setting ,ModifiedRuleset_i:0 overflows Steam SetGameTags call
[2024.05.07-16.31.48:797][809]LogOnline: STEAM: Adding P2P connection information with user 76561198987654321 (Name: UNKNOWN [0x11000010B15701F])
[2024.05.07-16.32.03:777][264]LogOnline: STEAM: Removing P2P Session Id: UNKNOWN [0x11000010B15701F], Channel: -1, IdleTime: 14.980
[2024.05.07-16.32.05:291][310]LogOnline: STEAM: Closing all communications with user 76561198987654321
[2024.05.07-16.32.05:293][310]LogOnline: STEAM: 76561198987654321 has been removed.

Players cannot connect to the server. Does anyone know how to fix these warnings?

rlex commented 3 months ago

Managed to run it after all, looks like i was 2 or so versions of wine-staging behind.

Anyway, server goes offline after several hours. Nothing in logs, seems to be OK in general, but it disappears from server list and needs restart.

bensoutendijk commented 3 months ago

Nothing in logs, seems to be OK in general, but it disappears from server list and needs restart.

I had this happen to me as well. It happened almost immediately after starting the server (within < 10 minutes)

titanbubu commented 3 months ago

Nothing in logs, seems to be OK in general, but it disappears from server list and needs restart.

I had this happen to me as well. It happened almost immediately after starting the server (within < 10 minutes)

Check if your port is still available after it vanishes from Steam. It will help narrow down the problem. https://www.yougetsignal.com/tools/open-ports/

rlex commented 3 months ago

yeah ports are disappearing. Seems to be some wine socket issue?

Here is some logs after start:

LogInit: Display: Engine is initialized. Leaving FEngineLoop::Init()
LogOnlineSession: Warning: STEAM: Server setting ,StoryProgress_s:Office overflows Steam SetGameTags call
LogOnlineSession: Warning: STEAM: Server setting ,ModifiedRuleset_i:1 overflows Steam SetGameTags call
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
LogOnlineSession: Display: OSS: Session creation completed. Automatic start is turned on, starting session now.
LogOnlineSession: Warning: STEAM: Server setting ,StoryProgress_s:Office overflows Steam SetGameTags call
LogOnlineSession: Warning: STEAM: Server setting ,ModifiedRuleset_i:1 overflows Steam SetGameTags call
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
LogGameMode: Display: Match State Changed from WaitingToStart to InProgress
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
LogOnlineSession: Warning: STEAM: Server setting ,StoryProgress_s:Office overflows Steam SetGameTags call
LogOnlineSession: Warning: STEAM: Server setting ,ModifiedRuleset_i:1 overflows Steam SetGameTags call
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
LogSaveWorld: Display: Finished autosaving
LogOnlineSession: Warning: STEAM: Server setting ,StoryProgress_s:Office overflows Steam SetGameTags call
LogOnlineSession: Warning: STEAM: Server setting ,ModifiedRuleset_i:1 overflows Steam SetGameTags call
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
LogSaveWorld: Display: Finished autosaving
LogSaveWorld: Display: Finished autosaving
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
LogOnlineSession: Warning: STEAM: Server setting ,StoryProgress_s:Office overflows Steam SetGameTags call
LogOnlineSession: Warning: STEAM: Server setting ,ModifiedRuleset_i:1 overflows Steam SetGameTags call
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
LogAnimation: Warning: SLOTNODE: 'LeftArm' in animation instance class ABF_Scientist_AnimBP_C already exists. Remove duplicates from the animation graph for this class.
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
02b8:fixme:winsock:sock_errno_to_status unknown errno 126
LogSaveWorld: Display: Finished autosaving
LogOnlineSession: Warning: STEAM: Server setting ,StoryProgress_s:Office overflows Steam SetGameTags call
LogOnlineSession: Warning: STEAM: Server setting ,ModifiedRuleset_i:1 overflows Steam SetGameTags call
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
02c0:fixme:advapi:ReportEventW (00000000CAFE4242,0x0002,0x0000,0x80000002,0000000000000000,0x0001,0x00000000,0000000016C5FD88,0000000000000000): stub
LogSaveWorld: Display: Finished autosaving

Hope we will get native version soon instead of messing with wine.

titanbubu commented 3 months ago

@rlex I don't think you should lose the ability to ping a port using the tool I linked because of something non-firewall related (Wine). Did I read your message wrong?

MiskatonicU commented 3 months ago

@rlex At least with the Docker version, I've had the server up for days at a time and haven't seen the error you mentioned, admittedly it's not often populated and just idles the majority of the day. Perhaps it's a difference in the wine versions? From inside of the Docker image @Pleut created wine reports the following version information:

root@304ceefb2a8c:/steamcmd# apt show wine
Package: wine
Version: 6.0.3~repack-1
Status: install ok installed
Priority: optional
Section: otherosfs
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Wine Party <debian-wine@lists.debian.org>
Installed-Size: 200 kB
Provides: wine
Depends: wine64 (>= 6.0.3~repack-1) | wine32 (>= 6.0.3~repack-1), wine64 (<< 6.0.3~repack-1.1~) | wine32 (<< 6.0.3~repack-1.1~)
Suggests: q4wine, winbind, winetricks, playonlinux, wine-binfmt, dosbox (>= 0.74-4.2~), exe-thumbnailer | kio-extras
Breaks: libwine (<< 5.5-6), wine-stable (<< 3.0.1ubuntu1~)
Replaces: libwine (<< 5.5-6), wine-stable (<< 3.0.1ubuntu1~)
Homepage: https://www.winehq.org
Download-Size: unknown
APT-Manual-Installed: no
APT-Sources: /var/lib/dpkg/status
Description: Windows API implementation - standard suite

Wine is a free MS-Windows API implementation.
.
his package provides essential wrappers and convenience tools for the standard Wine components. It also employs the Debian alternatives system to provide the usual command names, e.g. "wine" instead of "wine-stable".
root@304ceefb2a8c:/steamcmd# wine --version
wine-6.0.3 (Ubuntu 6.0.3~repack-1)
root@304ceefb2a8c:/steamcmd# wine64 --version
wine-6.0.3 (Ubuntu 6.0.3~repack-1)
titanbubu commented 3 months ago

For those wondering about their wine version, here's mine. Server has been up since I opened this thread. Rebooted it a few times to change settings. Everything works perfectly. Screenshot_20240508-185650

For networking I use a Ubiquiti router forwarding the two ports to the LAN up of the server.

I'm running Ubuntu 23.04 as a virtual machine.

rlex commented 3 months ago

@rlex I don't think you should lose the ability to ping a port using the tool I linked because of something non-firewall related (Wine). Did I read your message wrong?

i hasn't pinged port, i just looked up listening ports with netstat. When server goes "down", it just shuts down ports and stops listening on them. I restarted it today and hasn't saw that behavior yet, but server was idling pretty much 99% of time. I assume with no players nothing is happening and server just freezes? Will continue to observe.

kwaio commented 3 months ago

Thanks for this. I didn't know about xvfb-run and stuggled to make it work with $DISPLAY, had to pop a windows VM with a X11 emulator + putty with X forwarding.

So you did not need vcredist2019 installed ? I feel like it couldn't start without on my wine setup...

conanbeach commented 3 months ago

did this worked sweet straight away

https://pimylifeup.com/abiotic-factor-dedicated-server-linux/

Fuzzypyro commented 3 months ago

I have been trying to deploy a server using the docker compose detailed here https://pimylifeup.com/abiotic-factor-dedicated-server-linux/ Coincidentally the link in the previous comment. I can not get this thing to show up on the server list. There seems to be some errors thrown within the logs but im unsure if they are considered normal. If someone could take a look at them and tell me if I am doing something wrong.

docker-compose.yml

services: abiotic-server: image: "ghcr.io/pleut/abiotic-factor-linux-docker:latest" restart: unless-stopped volumes:

My logs. abiotic-factor-docker-compose.log

dlejeune commented 1 month ago

Hey @titanbubu and @sirwillis92 - thanks so so much for putting this together. Just a super minor thing that tripped me up cause I copy-pasted without looking. In your run script, you have the -newconsole option written as -newconole (without the s) which causes problems. Fixing the typo fixed things for me. Not sure if you wanna update the text. Thanks again!

titanbubu commented 1 month ago

Hey @titanbubu and @sirwillis92 - thanks so so much for putting this together. Just a super minor thing that tripped me up cause I copy-pasted without looking. In your run script, you have the -newconsole option written as -newconole (without the s) which causes problems. Fixing the typo fixed things for me. Not sure if you wanna update the text. Thanks again!

Thank you for pointing that out! Fixed.

PFCraft-box commented 1 month ago

I was able to resolve this by adding the -tcp tag to the startup command (i placed it after the QUERYPORT tag. This has now loaded the game server 3 times in a row and is visible in the steam server list

xvfb-run wine64 AbioticFactor/Binaries/Win64/AbioticFactorServer-Win64-Shipping.exe -log -newconole -useperfthreads -NoAsyncLoadingThread -MaxServerPlayers=6 -PORT=7777 -QUERYPORT=27015 -tcp -ServerPassword=ServerPassword -SteamServerName="ServerName" -WorldSaveName="Cascade"

LogOnlineSession: Display: OSS: Session creation completed. Automatic start is turned on, starting session now. [2024.05.04-16.53.14:337][ 23] LogOnlineSession: Display: OSS: Session creation completed. Automatic start is turned on, starting session now.

I have discovered another potential solution. By using TCPDUMP to analyze communication packets, I found that in certain network environments, the server fails to obtain the correct external IP. Adding the MULTIHOME startup parameter can resolve this issue. If the -tcp parameter does not resolve the problem, you might want to try this solution.

Here’s the updated startup command:


xvfb-run wine64 AbioticFactor/Binaries/Win64/AbioticFactorServer-Win64-Shipping.exe -log -newconsole -useperfthreads -NoAsyncLoadingThread -MaxServerPlayers=6 -PORT=7777 -QUERYPORT=27015 -MULTIHOME=external_IP -ServerPassword=ServerPassword -SteamServerName="ServerName" -WorldSaveName="Cascade"
redredkrovy commented 20 hours ago

Has there been any changes since this guide was put out? I recently wanted to come back to Abiotic Factor but my server is not showing up on the in game server list now. I've updated it and played around with the ports with no luck. Looking at the firewall logs I can see traffic to port 27015 so I know port forwarding is working.

titanbubu commented 19 hours ago

Has there been any changes since this guide was put out? I recently wanted to come back to Abiotic Factor but my server is not showing up on the in game server list now. I've updated it and played around with the ports with no luck. Looking at the firewall logs I can see traffic to port 27015 so I know port forwarding is working.

Hi redredkrovy, I haven't played in a few weeks. Letting some content patches go by before my friends and I get back to it. If I have time this week I'll relaunch mine and see if there are any issues.