Sign inSign up

thatcasualgamingguy/plainsofpain-server

By thatcasualgamingguy

•Updated 27 days ago

Plains of Pain Dedicated Server with autoupdate (supervisord)

Image
0

1.2K

thatcasualgamingguy/plainsofpain-server repository overview

⁠Plains-of-Pain-Dedicated-Server

GitHub

GitHub

Docker image for the game Plains of Pain. The repo is based on the enshrouded-server⁠ repo made by mornedhels⁠ and uses supervisor to handle startup, automatic updates and cleanup.

⁠Environment Variables

VariableRequiredDefaultContraintsDescriptionWIP
SERVER_NAMEPlains of Pain ServerstringThe name of the server️
SERVER_PASSWORDstringThe password for the server
SERVER_SEED40377integerThe server's map seed
SERVER_WORLD_ID0integerThe server's world ID
SERVER_DIFFICULTY2integerThe server's difficulty setting. (0 = Tourist, 1 = Rookie, 2 = True Wastelander, 3 = Veteran, 4 = Overlord, 255 = Custom Difficulty⁠️
SERVER_MAP_ID768integerID of the map that should be used (768 = Wasteland v0.8)️
SERVER_WORLD_SIZE31integerSize of the server's map (11 = S, 21 = M, 31 = L, 41 = XL, 51 = XXL)️
SERVER_SLOT_COUNT10integer (1-200)Max allowed concurrent players
SERVER_PORT7777integerThe game server's port
SERVER_QUERYPORT27016integerThe steam query port for the server
SERVER_ADMIN_ACCOUNTSstringDetermines who can use admin console commands. Multiple steam Account IDs (not Steam IDs) separated by comma. i.e. 457896521,245785
SERVER_TTR0integerTime To Restart (in seconds) automatically saves and quits Dedicated Server application, i.e. 14400 seconds = 4 hours
PUID4711integerThe UID to run server as (file permission)
PGID4711integerThe GID to run server as (file permission)
UPDATE_CRONstring (cron format)Update game server files cron (eg. */30 * * * * check for updates every 30 minutes)
UPDATE_CHECK_PLAYERSfalseboolean (true, false)Should the update check if someone is connected
GAME_BRANCHpublicstringSteam branch (eg. testing) of the Plains of Pain server
STEAMCMD_ARGSvalidatestringAdditional steamcmd args for the updater
USERDIRstringRoot folder for game saves
NAMESPACEmainstringSubfolder of USERDIR containing all game saves

All environment Variables prefixed with SERVER are the available config.json options

⁠Additional Information
  • During the update process, the container temporarily requires more disk space (up to 2x the game size).
⁠Hooks
VariableDescriptionWIP
BOOTSTRAP_HOOKCommand to run after general bootstrap
UPDATE_PRE_HOOKCommand to run before update
UPDATE_POST_HOOKCommand to run after update
BACKUP_PRE_HOOKCommand to run before backup & cleanup
BACKUP_POST_HOOKCommand to run after backup & cleanup

The scripts will wait for the hook to resolve/return before continuing.

⁠Image Tags

TagDescription
latestLatest image
<version>Pinned image (>= 1.x.x)
devDev build

⁠Ports (default)

PortDescription
7777/udpServer port
27016/udpSteam query port

⁠Volumes

VolumeDescription
/opt/plainsofpainGame files (steam download path)
/home/plainsofpain/.config/unity3d/CobraByteDigital/PlainsOfPainWorld files and character files

Note: By default the volumes are created with the UID and GID 4711 (that user should not exist). To change this, set the environment variables PUID and PGID.

  • 50-250 kbps of bandwidth per 1 player
  • 4 GB RAM and 2 CPU cores (for small world)
  • 8 GB RAM and 4-6 CPU cores (for large world)
  • 16-32 GB RAM, 8-16 CPU cores for 200 players on any size world
  • Disk: >= 400MB

⁠Usage

⁠Docker
docker run -d --name plainsofpain \
  --hostname plainsofpain \
  --restart=unless-stopped \
  -p 7777:7777/udp \
  -p 27016:27016/udp \
  -v ./game:/opt/plainsofpain \
  -e SERVER_NAME="Plains of Pain Server" \
  -e SERVER_SEED=40377 \
  -e SERVER_WORLD_ID=0 \
  -e SERVER_DIFFICULTY=2 \
  -e SERVER_MAP_ID=768 \
  -e SERVER_WORLD_SIZE=31 \
  -e SERVER_SLOT_COUNT=10 \
  -e SERVER_PASSWORD="secret" \
  -e UPDATE_CRON="*/30 * * * *" \
  -e PUID=4711 \
  -e PGID=4711 \
  -e NAMESPACE="server-1" \
  ghcr.io/traxo-xx/plainsofpain-server:latest
⁠Docker Compose
services:
  plainsofpain:
    image: ghcr.io/traxo-xx/plainsofpain-server:latest
    container_name: plainsofpain
    hostname: plainsofpain
    restart: unless-stopped
    stop_grace_period: 90s
    ports:
      - "7777:7777/udp"
      - "27016:27016/udp"
    volumes:
      - ./game:/opt/plainsofpain
      - ./worldfiles:/home/plainsofpain/.config/unity3d/CobraByteDigital/PlainsOfPain
    environment:
      - SERVER_NAME=Plains of Pain Server
      - SERVER_SEED=40377
      - SERVER_WORLD_ID=0
      - SERVER_DIFFICULTY=2
      - SERVER_MAP_ID=768
      - SERVER_WORLD_SIZE=31
      - SERVER_SLOT_COUNT=10
      - SERVER_PASSWORD=secret
      - UPDATE_CRON=*/30 * * * *
      - PUID=4711
      - PGID=4711
      - NAMESPACE=server-1

Note: The volumes are created next to the docker-compose.yml file. If you want to create the volumes in the default location (eg. /var/lib/docker), you can use the following compose file:

services:
  plainsofpain:
    image: ghcr.io/traxo-xx/plainsofpain-server:latest
    container_name: plainsofpain
    hostname: plainsofpain
    restart: unless-stopped
    stop_grace_period: 90s
    ports:
      - "7777:7777/udp"
      - "27016:27016/udp"
    volumes:
      - game:/opt/plainsofpain
      - worldfiles:/home/plainsofpain/.config/unity3d/CobraByteDigital/PlainsOfPain
    environment:
      - SERVER_NAME=Plains of Pain Server
      - SERVER_SEED=40377
      - SERVER_WORLD_ID=0
      - SERVER_DIFFICULTY=2
      - SERVER_MAP_ID=768
      - SERVER_WORLD_SIZE=31
      - SERVER_SLOT_COUNT=10
      - SERVER_PASSWORD=secret
      - UPDATE_CRON=*/30 * * * *
      - PUID=4711
      - PGID=4711
      - NAMESPACE=server-1

volumes:
  game:
  worldfiles:

Note

The image is also available on Docker Hub: [thatcasualgamingguy/plainsofpain-server](https://hub.docker.com/r/thatcasualgamingguy/plainsofpain-server)

⁠Commands

  • Force Update:
    docker compose exec plainsofpain supervisorctl start plainsofpain-force-update
    
⁠Custom Difficulty

Note

The only documentation I've found about this is a [How To topic](https://discord.com/channels/1037813254765948989/1481759619499036704/1481759619499036704) in the official Plains of Pain Discord. The following instructions are based on that.
  1. Set SERVER_DIFFICULTY to 255
  2. In your worldfiles mount there is a file called info.log in which you can find a value SteamAccountId ... If not, locate <worldfiles>/main/profiles and there should be a folder with a number - that number is SteamAccountId
  3. Set SERVER_ADMIN_ACCOUNTS to "123456789", where 123456789 is your SteamAccountId
  4. After a server started and you connect to it (as a player via standard game), go to Main Menu -> Settings -> Difficulty
  5. (now you see what difficulty is set on server) Just set values you want (it switches difficulty to Custom) and click on Apply, that sends custom difficulty to server, where the settings is persisted (and loaded after any future restart)
⁠Known Issues
  • The server doesn't start or the update fails with following error:

    Error! App '2278520' state is 0x202 after update job.
    

    That means there is probably something wrong with your file permissions. Make sure the PUID and PGID are correct and the files are owned by the correct user.

  • Server is showing as IPAddress:Port in the game’s server list instead of its set name.

    That means Steam cannot reach your SERVER_QUERYPORT. Double-check your port forwarding/firewall.

  • Server is showing correct name, but I can't connect to game.

    That means players cannot reach your SERVER_PORT. Double-check your port forwarding/firewall. Maybe another software occupies that port.

Tag summary

Content type

Image

Digest

sha256:a36a1d934…

Size

242.2 MB

Last updated

3 months ago

docker pull thatcasualgamingguy/plainsofpain-server