mornedhels / enshrouded-server

Enshrouded Dedicated Server with autoupdate (supervisord)
MIT License
120 stars 8 forks source link

Save game doesnt exist and server difficulty Env does not work #87

Open jonneymendoza opened 1 month ago

jonneymendoza commented 1 month ago

Is there an existing issue for this?

Used image version

latest/1.30

Used docker compose file or docker command

Docker compose yml file:

services:
  enshrouded:
    image: mornedhels/enshrouded-server:latest
    container_name: enshrouded
    hostname: enshrouded
    restart: unless-stopped
    stop_grace_period: 90s
    ports:
      - "15637:15637/udp"
    volumes:
      - /home/config/enshrouded:/opt/enshrouded
    environment:
      - SERVER_NAME=MyServer
      - UPDATE_CRON=*/30 * * * *
      - BACKUP_CRON=*/10 * * * *
      - SERVER_SAVE_DIR=/home/me/enshrouded/save
      - BACKUP_DIR=/home/me/enshrouded/backup
      - PUID=1000
      - PGID=1000
      - SERVER_ROLE_0_NAME=Admin
      - SERVER_ROLE_0_PASSWORD=myPassword
      - SERVER_ROLE_0_CAN_KICK_BAN=true
      - SERVER_ROLE_0_CAN_ACCESS_INVENTORIES=true
      - SERVER_ROLE_0_CAN_EDIT_BASE=true
      - SERVER_ROLE_0_CAN_EXTEND_BASE=true
      - SERVER_ROLE_0_RESERVED_SLOTS=1
      - SERVER_ROLE_1_NAME=Friends
      - SERVER_ROLE_1_PASSWORD=mates
      - SERVER_ROLE_1_CAN_ACCESS_INVENTORIES=true
      - SERVER_ROLE_1_CAN_EDIT_BASE=true
      - SERVER_ROLE_1_CAN_EXTEND_BASE=true
      - SERVER_ROLE_1_RESERVED_SLOTS=6
      - SERVER_ROLE_2_NAME=Guests
      - SERVER_ROLE_2_PASSWORD=hello
      - SERVER_GS_PRESET=Custom
      - SERVER_GS_PLAYER_HEALTH_FACTOR=2
      - SERVER_GS_PLAYER_MANA_FACTOR=4
      - SERVER_GS_PLAYER_STAMINA_FACTOR=2
      - SERVER_GS_ENABLE_DURABILITY=true
      - SERVER_GS_ENABLE_STARVING_DEBUFF=false
      - SERVER_GS_FOOD_BUFF_DURATION_FACTOR=1
      - SERVER_GS_FROM_HUNGER_TO_STARVING=600000000000
      - SERVER_GS_SHROUD_TIME_FACTOR=1
      - SERVER_GS_RANDOM_SPAWNER_AMOUNT=Normal
      - SERVER_GS_MINING_DAMAGE_FACTOR=2
      - SERVER_GS_PLANT_GROWTH_SPEED_FACTOR=1
      - SERVER_GS_RESOURCE_DROP_STACK_AMOUNT_FACTOR=2
      - SERVER_GS_FACTORY_PRODUCTION_SPEED_FACTOR=2
      - SERVER_GS_PERK_UPGRADE_RECYCLING_FACTOR=0.5
      - SERVER_GS_PERK_COST_FACTOR=1
      - SERVER_GS_EXPERIENCE_COMBAT_FACTOR=1
      - SERVER_GS_EXPERIENCE_MINING_FACTOR=1
      - SERVER_GS_EXPERIENCE_EXPLORATION_QUESTS_FACTOR=1
      - SERVER_GS_AGGRO_POOL_AMOUNT=Normal
      - SERVER_GS_ENEMY_DAMAGE_FACTOR=1
      - SERVER_GS_ENEMY_HEALTH_FACTOR=1
      - SERVER_GS_ENEMY_STAMINA_FACTOR=1
      - SERVER_GS_ENEMY_PERCEPTION_RANGE_FACTOR=1
      - SERVER_GS_BOSS_DAMAGE_FACTOR=1
      - SERVER_GS_BOSS_HEALTH_FACTOR=1
      - SERVER_GS_THREAT_BONUS=1
      - SERVER_GS_PACIFY_ALL_ENEMIES=false
      - SERVER_GS_DAY_TIME_DURATION=1800000000000
      - SERVER_GS_NIGHT_TIME_DURATION=720000000000
      - SERVER_GS_TOMBSTONE_MODE=AddBackpackMaterials

Compose command i used: sudo docker compose -f enshrouded-compose.yml up -d

This is what the ensoruded_server.json file generates from the given compose yml and command on my ubuntu server

{
  "name": "MyServer",
  "saveDirectory": "/home/me/enshrouded/save",
  "logDirectory": "./logs",
  "ip": "0.0.0.0",
  "queryPort": 15637,
  "slotCount": 16,
  "gameSettingsPreset": "Default",
  "gameSettings": {
    "playerHealthFactor": 1,
    "playerManaFactor": 1,
    "playerStaminaFactor": 1,
    "enableDurability": true,
    "enableStarvingDebuff": false,
    "foodBuffDurationFactor": 1,
    "fromHungerToStarving": 600000000000,
    "shroudTimeFactor": 1,
    "tombstoneMode": "AddBackpackMaterials",
    "miningDamageFactor": 1,
    "plantGrowthSpeedFactor": 1,
    "resourceDropStackAmountFactor": 1,
    "factoryProductionSpeedFactor": 1,
    "perkUpgradeRecyclingFactor": 0.500000,
    "perkCostFactor": 1,
    "experienceCombatFactor": 1,
    "experienceMiningFactor": 1,
    "experienceExplorationQuestsFactor": 1,
    "randomSpawnerAmount": "Normal",
    "aggroPoolAmount": "Normal",
    "enemyDamageFactor": 1,
    "enemyHealthFactor": 1,
    "enemyStaminaFactor": 1,
    "enemyPerceptionRangeFactor": 1,
    "bossDamageFactor": 1,
    "bossHealthFactor": 1,
    "threatBonus": 1,
    "pacifyAllEnemies": false,
    "dayTimeDuration": 1800000000000,
    "nightTimeDuration": 720000000000
  },
  "userGroups": [
    {
      "name": "Admin",
      "password": "mypassword",
      "canKickBan": true,
      "canAccessInventories": true,
      "canEditBase": true,
      "canExtendBase": true,
      "reservedSlots": 1
    },
    {
      "name": "Friends",
      "password": "mates",
      "canKickBan": false,
      "canAccessInventories": true,
      "canEditBase": true,
      "canExtendBase": true,
      "reservedSlots": 6
    },
    {
      "name": "Guests",
      "password": "hello",
      "canKickBan": false,
      "canAccessInventories": false,
      "canEditBase": false,
      "canExtendBase": false,
      "reservedSlots": 0
    }
  ]
}

What you expected to see, versus what you actually saw

Save file to be in: home/me/enshrouded/save Backup saves to be in /home/me/enshrouded/backup Server difficulty to be set t Custom with the given settings i had tweaked.

Logs from the container

No response

cp-fabian-pittroff commented 1 month ago

Hey @jonneymendoza, thanks for the bug report. The savefiles should be an easy fix. You configured them to /home/me/enshrouded/save - but this is inside of the docker container. Enshrouded should handle the creation of the directory, but you would have to add the volumes to get the saves.

services:
  enshrouded:
    image: mornedhels/enshrouded-server:latest
    ...
    volumes:
      - /home/config/enshrouded:/opt/enshrouded
      - /host/path/save:/home/me/enshrouded/save
      - /host/path/backup:/home/me/enshrouded/backup

But I would stick to the default path. You could also add a different host directory for that explicitly (like /host/path/save:/opt/enshrouded/savegame).

For the gamesettings I don't see a clear solution. Would it be possilbe to start the container with debug logs enabled?

services:
  enshrouded:
    image: mornedhels/enshrouded-server:latest
    ...
    environment:
      - log_level=50
      - ...

Hopefully this will get us more insights, as to why the config is not getting applied correctly.

jonneymendoza commented 1 month ago

Thanks i will try the volumes edit.

Maybe this should be in the readme to specify that to have your save dir someewhere else, do so via the volume.

Do i still need the backup_dir defined? What does enshrouded use by default?

Also, how often does the game server saves?

last question: Where do i see the logs after adding the log level?

cp-fabian-pittroff commented 1 month ago

Maybe this should be in the readme to specify that to have your save dir someewhere else, do so via the volume.

I'll add a note for that in a future release.

Do i still need the backup_dir defined? What does enshrouded use by default?

If you leave it blank, it uses /opt/enshrouded/backup (./backup) as directory. The backup is a custom script that takes the latest savefile from enshrouded and copies it to the specified directory.

On the other hand, if you remove the SERVER_SAVE_DIR env var - it doesn't reset the configfile to the default value. You can update the enshrouded_server.json manually or set the env var to its default value of ./savegame.

Also, how often does the game server saves?

Last time I checked, enshrouded saves every 5 minutes. So a backup cron less than 5 minutes, doesn't help.

last question: Where do i see the logs after adding the log level?

You can access the docker logs with docker compose -f enshrouded-compose.yml logs -f (-f if you want to follow the logs).

jonneymendoza commented 1 month ago

Ok here is a snippet of the logs. when i search for gameSettings, i saw this mentioning no Custom preset was set?

enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server [os] Started thread 0x000000000367f240 (Task-background07) with stack range (0x000000000ff50000-0x0000000010350000 size:4,194,304) enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server CpuInfo: enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server Type: AMD enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server Vendor: 'AuthenticAMD' enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server Brand: 'AMD Ryzen 9 6900HX with Radeon Graphics' enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server Cpus: 16 enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server Perf: 16 1111111111111111 enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server Effi: 0 0 enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server CacheLine: 64 enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server Simd: SSE2,SSE3,SSSE3,SSE4a,SSE41,SSE42,AVX,AVX2 enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server Other: FMA,ABM,BMI1,BMI2,F16C,CTSC,AES,SHA,RDSEED,RDRAND enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server MemoryInfo: enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server PhysTotal: 31,259,119,616 enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server PhysAvail: 27,254,259,712 enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server SwapTotal: 39,849,054,208 enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server SwapAvail: 35,814,567,936 enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server OsSystemInfo: enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server ProductName: 'Windows 10 Pro' enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server DisplayVersion: '21H1' enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server Version: 10.0 (19043) enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server 'gameSettings' will not be applied Preset is not set to 'Custom' enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server [os] Started thread 0x0000000003681278 (BackgroundTask) with stack range (0x0000000010360000-0x0000000010460000 size:1,048,576) enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server [holistic] Backup log to '/opt/enshrouded/server/logs/backup/enshrouded_server_2024-09-14T17-30-06.log'. enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server [enshrouded] Create logfile enshrouded | 2024-09-14 17:30:06.891 supervisord: enshrouded-server enshrouded_server(detached HEAD) - version fd563a0389c99a6ba9ec59b8a233fe9df17e892d (master)

somemore stuff i found on the logs that may be of use?

enshrouded | 2024-09-14 17:21:54.721 supervisord: enshrouded-bootstrap INFO - Running enshrouded-bootstrap enshrouded | 2024-09-14 17:21:54.745 supervisord: enshrouded-bootstrap DEBUG - [30] - userGroups array does not exist, creating empty array enshrouded | 2024-09-14 17:21:54.752 supervisord: enshrouded-bootstrap DEBUG - [30] - group 0 does not exist, creating default group enshrouded | 2024-09-14 17:21:54.758 supervisord: enshrouded-bootstrap DEBUG - [30] - group 1 does not exist, creating default group enshrouded | 2024-09-14 17:21:54.764 supervisord: enshrouded-bootstrap DEBUG - [30] - group 2 does not exist, creating default group enshrouded | 2024-09-14 17:21:54.775 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 0 canAccessInventories to true enshrouded | 2024-09-14 17:21:54.783 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 0 canEditBase to true enshrouded | 2024-09-14 17:21:54.792 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 0 canExtendBase to true enshrouded | 2024-09-14 17:21:54.800 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 0 canKickBan to true enshrouded | 2024-09-14 17:21:54.808 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 0 name to Admin enshrouded | 2024-09-14 17:21:54.817 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 0 password to xxx enshrouded | 2024-09-14 17:21:54.825 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 0 reservedSlots to 1 enshrouded | 2024-09-14 17:21:54.834 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 1 canAccessInventories to true enshrouded | 2024-09-14 17:21:54.842 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 1 canEditBase to true enshrouded | 2024-09-14 17:21:54.850 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 1 canExtendBase to true enshrouded | 2024-09-14 17:21:54.859 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 1 name to Friends enshrouded | 2024-09-14 17:21:54.867 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 1 password to xxx enshrouded | 2024-09-14 17:21:54.875 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 1 reservedSlots to 6 enshrouded | 2024-09-14 17:21:54.884 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 2 name to Guests enshrouded | 2024-09-14 17:21:54.892 supervisord: enshrouded-bootstrap DEBUG - [30] - updating group 2 password to xxx enshrouded | 2024-09-14 17:21:55.112 supervisord: enshrouded-bootstrap Defaulting to user installation because normal site-packages is not writeable enshrouded | 2024-09-14 17:21:55.292 supervisord: enshrouded-bootstrap Collecting python-a2s==1.3.0 enshrouded | 2024-09-14 17:21:55.329 supervisord: enshrouded-bootstrap Downloading python_a2s-1.3.0-py3-none-any.whl.metadata (4.7 kB) enshrouded | 2024-09-14 17:21:55.352 supervisord: enshrouded-bootstrap Downloading python_a2s-1.3.0-py3-none-any.whl (15 kB) enshrouded | 2024-09-14 17:21:55.400 supervisord: enshrouded-bootstrap Installing collected packages: python-a2s enshrouded | 2024-09-14 17:21:55.429 supervisord: enshrouded-bootstrap Successfully installed python-a2s-1.3.0 enshrouded | 2024-09-14 17:21:55.477 supervisord: enshrouded-bootstrap DEBUG - [30] - creating cron for update checks (schedule: /30 ) enshrouded | 2024-09-14 17:21:55.477 supervisord: enshrouded-bootstrap DEBUG - [30] - creating cron for backups (schedule: /10 ) enshrouded | 2024-09-14 17:21:55,587 INFO spawned: 'enshrouded-updater' with pid 188

cp-fabian-pittroff commented 1 month ago

hm, the bootstrap just skips right over the gamesettings - could you please run docker compose -f enshrouded-compose.yml pull followed with an up -d? Just to be safe, that its on the latest image.

ItYoono commented 1 week ago

try setting "gameSettingsPreset": "Default" to "Custom"