Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Modded Support #2

Open
spannerman79 opened this issue Mar 10, 2021 · 14 comments
Open

Modded Support #2

spannerman79 opened this issue Mar 10, 2021 · 14 comments

Comments

@spannerman79
Copy link

Hi,
To be able to mod stationeers I need to be able to mount the stationeers server location to an external location. For example;
--mount type=bind,source=/path/to/server_install,target=$APP_DIR and whatever $APP_DIR happens to be from looking at https://github.com/Hetsh/docker-stationeers/blob/master/Dockerfile#L38

@Hetsh
Copy link
Owner

Hetsh commented Mar 11, 2021

Hi, the content of $APP_DIR is /var/lib/steam/linux32/steamapps/content/app_600760/depot_600762. $APP_DIR is assigned at line 13 and $STEAM_DIR is a variable form the parent image.

Your bind mount example would override all server files of the docker image, but i doubt this is what you want to achieve? According to the unofficial stationeers wiki entry on modding dedicated servers, you need to mount the mod files into the docker container:
--mount type=bind,source=/path/to/mod_dir_on_host,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/mod_xxxx and create the modconfig.xml that also needs to be mounted into the container.

@spannerman79
Copy link
Author

spannerman79 commented Mar 11, 2021

According to the unofficial stationeers wiki entry on modding dedicated servers, you need to mount the mod files into the docker container:

No, usage of modconfig.xml on a dedicated linux server is actually ignored.

The xml files need to be added or modified directly onto the server itself. Hence needing actual access to the server install location in order to modify/change whats located in `/path/to/server/rocketstation_DedicatedServer_Data/StreamingAssets/Data

One such workshop item - take note of the "RUNNING DEDICATED SERVER" part.
https://steamcommunity.com/sharedfiles/filedetails/?id=1303058005

Or for this one - https://steamcommunity.com/sharedfiles/filedetails/?id=2066887850#comment_content_2919976282203653086:~:text=For%20a%20server%20version%20of%20this%2C,on%20the%20server%20between%20those%20two

Even joining the actual Stationeers Discord it is well known that the usage of modconfig.xml is ignored. Once you join (if you do) just do a search within the #dedicated-server text channel.

And because the way you have your docker images creating a container that doesn't auto update is handy - as you can move/copy out those modified files and later put them back in once a new tag is grabbed.

Edit: In fact I suggest you even "try" to follow that modding guide over at that wiki. Many people have tried and attempted to follow that. It never ends up working.

modconfig.xml is for P2P shared/co-op instances that are started in game - not dedicated servers.

Screenshot_20210311_210733

@Hetsh
Copy link
Owner

Hetsh commented Mar 11, 2021

I totally believe you, it would not be the first time the unofficial wiki would contain false information. 😁

To get to the server files, you can use the docker cp command while the container is running:
docker cp <your_container_id>:/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762 <destination>

But if you only want to override the original .xml file to apply a mod you can just mount the modded .xml on top:
--mount type=bind,source=/path/to/modded.xml,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/original.xml,readonly

Does this solve your problem?

@spannerman79
Copy link
Author

Actually yes it does!

Forgive me I am trying to get my head around the way that docker operates.

I'm going to assume if I --mount type=bind,source=/path/to/Data,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data,readonly, and the contents of /path/to/Data are empty the server contained within the docker image will see that directory as completely empty? (and thus the server will error out)

If that is the case then The two commands being;
docker cp <your_container_id>:/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762 <destination> to grab the file that might need to be appended

And;

--mount type=bind,source=/path/to/modded.xml,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/original.xml,readonly to overwrite the file within the docker container would be the way to go.


For smaller changes this would be fine, but for those that wish to setup not just simple autolathe changes, or mining drop rates or larger stacking but mods that change much more (ie mods that add different starting conditions) that would be a major PITA.

@Hetsh
Copy link
Owner

Hetsh commented Mar 13, 2021

I'm going to assume if I --mount type=bind,source=/path/to/Data,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data,readonly, and the contents of /path/to/Data are empty the server contained within the docker image will see that directory as completely empty? (and thus the server will error out)

You are correct.

If that is the case then The two commands being;
docker cp <container_id>:/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762 <destination> to grab the file that might need to be appended

You can also further specify the source path and just copy one file from the container:

docker cp <container_id>:/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/original.xml <destination>

And;
--mount type=bind,source=/path/to/modded.xml,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/original.xml,readonly to overwrite the file within the docker container would be the way to go.

Also correct.

For smaller changes this would be fine, but for those that wish to setup not just simple autolathe changes, or mining drop rates or larger stacking but mods that change much more (ie mods that add different starting conditions) that would be a major PITA.

I agree. You can also override a directory and apply many mods at once:

--mount type=bind,source=/path/to/modded_Data,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data

But until there is a standardized way to load mods this will remain hacky.

@spannerman79
Copy link
Author

spannerman79 commented Mar 17, 2021

I agree. You can also override a directory and apply many mods at once:
--mount type=bind,source=/path/to/modded_Data,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data

I think this would be better overall. I'm going to test it now - and especially since the new update ( https://steamcommunity.com/games/544550/announcements/detail/5212326506783997647 ). Don't worry I'll pull the correct docker tag as I saw you just updated the docker file a little bit ago 😛 and wait for DockherHub to update too.

@spannerman79
Copy link
Author

spannerman79 commented Mar 18, 2021

Akright, I did some testing.

Using --mount type=bind,source=/path/to/modded_Data,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data causes the server to not load at all. Doesn't matter if you have nothing in /path/to/modded_Data/ or a single modded file in there - Stationeers will not load for whatever reason.

However --mount type=bind,source=/path/to/modded.xml,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/original.xml,readonly does work.

Personally as I only have ~3 xml files it is no issue. But if anyone wants to use any custom world start settings and so on that mount list will be endless with however this docker image is setup.

Just to make sure and so that you don't need to ask;

ll
total 16K
drwxrwxrwx  4 rocket administrators 4.0K 2021-03-18 19:32 ./
drwxrwxrwx 60 admin  administrators 4.0K 2021-03-17 23:06 ../
drwxr-xr-x  2 rocket           1358 4.0K 2021-03-18 19:04 modded_Data/
drwxr-xr-x  6 rocket           1358 4.0K 2021-03-18 19:14 server_data/

modded_Data/ & server_data/ both chown -R 1358:1358

Edit:

My current docker compose (if you are curious);

version: "3.3"
services:
  stationeers:
    container_name: stationeers
    stdin_open: true            # docker run -i - added for testing
    tty: true                   # docker run -t - added for testing
    ports:
      - "27500:27500/udp"
      - "27500:27500/tcp"
      - "27015:27015/udp"
    image: hetsh/stationeers:7290294188270596278-1
    environment:
      - WORLD_TYPE=Mars
      - WORLD_NAME=mars_save
      - SAVE_INTERVAL=300
      - CLEAR_INTERVAL=-1
      - SERVER_OPTS=-bindip 192.168.196.212
    volumes:
      - "/share/stationeers_docker/modded_Data/Stacked.xml:/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/Stacked.xml:ro"
      - "/share/stationeers_docker/modded_Data/mineables.xml:/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/mineables.xml:ro"
      - "/share/stationeers_docker/modded_Data/autolathe.xml:/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/autolathe.xml:ro"
      - "/share/stationeers_docker/server_data:/stationeers"
      - "/etc/localtime:/etc/localtime:ro"

@Hetsh
Copy link
Owner

Hetsh commented Mar 18, 2021

Using --mount type=bind,source=/path/to/modded_Data,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data causes the server to not load at all. Doesn't matter if you have nothing in /path/to/modded_Data/ or a single modded file in there - Stationeers will not load for whatever reason.

This overrides the whole directory and if you only place the 3 modded .xml files in the modded_Data directory, the server is missing all of the other non-modded .xml files.
So this approach only makes sense if you have many, many modded .xml files and since you only have 3, the best approach is the one you currently use.

@Hetsh
Copy link
Owner

Hetsh commented Mar 18, 2021

Good compose file BTW. You can omit the SAVE_INTERVAL=300 if you want, since it is the default value.

@spannerman79
Copy link
Author

The general direction you desire is not a direction I wish to take. I thank you for your time. Issue resolved.

@Hetsh
Copy link
Owner

Hetsh commented Mar 21, 2021

I understand. Your contributions are still greatly appreciated, thank you!

@spannerman79
Copy link
Author

Using --mount type=bind,source=/path/to/modded_Data,target=/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data causes the server to not load at all. Doesn't matter if you have nothing in /path/to/modded_Data/ or a single modded file in there - Stationeers will not load for whatever reason.

This overrides the whole directory and if you only place the 3 modded .xml files in the modded_Data directory, the server is missing all of the other non-modded .xml files.
So this approach only makes sense if you have many, many modded .xml files and since you only have 3, the best approach is the one you currently use.

There is now a direction that the modding community is heading towards.

https://github.com/Erdroy/Stationeers.Addons

Example of one mod out of several from different mod devs;

https://steamcommunity.com/sharedfiles/filedetails/?id=2403825928

The way that you have your current docker setup will be (soon) impossible as the actual game server directory must be set as a mount point ( ref: #2 (comment) )

@spannerman79 spannerman79 reopened this Sep 1, 2021
@Hetsh
Copy link
Owner

Hetsh commented Sep 9, 2021

I don't have much time at the moment. I would appreciate you answering me some questions.
Is this project really actively maintained (last release is from February and only a dozen commits were made since then)?
Do the install instructions from their README also apply to the dedicated server?
How would it know the workshop subscriptions without a valid steam login?

@spannerman79
Copy link
Author

spannerman79 commented Sep 10, 2021

Is this project really actively maintained (last release is from February and only a dozen commits were made since then)?

Until Rocketwerkz changes how they develop their game there hasn't been any major changes needed to be made.

Think of this as like the forge mod loader that can be added to minecraft.

If Rocketwerkz changes anything critical I will assume that the modding community will shift towards using a system akin to https://github.com/BepInEx/BepInEx

Do the install instructions from their README also apply to the dedicated server?

I am already running a standard non docker instance setup using https://github.com/Erdroy/Stationeers.Addons . But I knew the pandantic type of person would ask such a thing .. so.. StationeersAddons/Stationeers.Addons#10

How would it know the workshop subscriptions without a valid steam login?

This doesn't apply to a dedicated server - so not sure how this question would even apply.

Wrokshop subs in regards to stationeers only apply to a client - not the server. Never have.

Edit: I am sure I stated this before but I will again. The most current up to date info about modding stationeers is always on their discord, in the #modding text channel. Once such mod that is being develped using this framework is based on capsule based modules for building shelters on the fly - info starts at https://discord.com/channels/276525882049429515/412447900120121344/884739017361489920 on in the official stationeers discord server

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants