Page 1 of 1

[1.1.6] - Factorio server not getting path correctly

Posted: Fri Jan 01, 2021 2:53 pm
by oof2win2
When I run the commands below to load saves, create them etc, they do so in my current directory

Code: Select all

/opt/factorio/AwF-Bot-Test$ ../servers/test/bin/x64/factorio --start-server-load-latest
# tries to load the latest save from /opt/factorio/AwF-Bot-Test
/opt/factorio/AwF-Bot-Test$ ../servers/test/bin/x64/factorio --create testSaveMap
# creates a map called testSaveMap in /opt/factorio/AwF-Bot-Test
I believe this shouldn't however be their behavior, as they should instead do so in their respective directories, i.e.

Code: Select all

/opt/factorio/AwF-Bot-Test$ ../servers/test/bin/x64/factorio --start-server-load-latest
# should instead load a save from /opt/factorio/servers/test/saves
/opt/factorio/AwF-Bot-Test$ ../servers/test/bin/x64/factorio --create testSaveMap
# should instead create the map testSaveMap in /opt/factorio/servers/test/saves, not /opt/factorio/AwF-Bot-Test
I believe this is a bug, but it may as well not be one. In my opinion, the Factorio server should understand that it's directory should be in /opt/factorio/servers/test and it shouldn't try to work with things in other directories unless specifically told to. Since there is no command-line parameter to specify the location of the saves directory (unlike a mod directory), it is impossible to run commands to start/stop servers from locations on the disk except for where the Factorio server is located.

Re: [1.1.6] - Factorio server not getting path correctly

Posted: Sat Jan 02, 2021 6:45 pm
by Honktown
Have you tried with a custom config set?

Code: Select all

-c, --config PATH	config file to use
Relevant bits:

Code: Select all

[path]
read-data=__PATH__executable__\..\..\data
write-data=__PATH__executable__\..\..
A general suggestion, if you want a directory to be used a certain way, use a script, and set working directories and use absolute paths wherever possible instead of relying on default behaviors.

Re: [1.1.6] - Factorio server not getting path correctly

Posted: Sun Jan 03, 2021 8:43 am
by oof2win2
I have tried that, and it seems to not work either. In the config/config.ini file, I changed in the absolute path to the server - before it was relative to the Factorio executable I believe. It however still didn't fix it.
I tried also using factorio-init for this, but it doesn't support generating maps from a scenario that is given as a parameter (at least as far as I see)

Code: Select all

[path]
read-data=/opt/factorio/servers/test/data
write-data=/opt/factorio/servers/test/
[/code
Without custom config set
[code]
factorio@koelkast:/opt/factorio/AwF-Bot-Test$ ../servers/test/bin/x64/factorio --create awfmap
   0.000 2021-01-03 08:35:03; Factorio 1.1.6 (build 57355, linux64, headless)
   0.045 Operating system: Linux (Ubuntu 20.04)
   0.045 Program arguments: "../servers/test/bin/x64/factorio" "--create" "awfmap"
   0.045 Read data path: /opt/factorio/servers/test/data
   0.045 Write data path: /opt/factorio/servers/test [131172/223812MB]
   0.045 Binaries path: /opt/factorio/servers/test/bin
   0.051 System info: [CPU: Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz, 12 cores, RAM: 32017 MB]
   0.051 Environment: DISPLAY=<unset> WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=<unset> XDG_SESSION_DESKTOP=<unset> XDG_CURRENT_DESKTOP=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.051 Running in headless mode
   0.098 Loading mod settings creative-mod 1.7.1 (settings.lua)
   0.101 Loading mod settings even-distribution 1.0.5 (settings.lua)
   0.102 Loading mod core 0.0.0 (data.lua)
   0.145 Loading mod base 1.1.6 (data.lua)
   0.371 Loading mod creative-mod 1.7.1 (data.lua)
   0.489 Loading mod even-distribution 1.0.5 (data.lua)
   0.595 Loading mod base 1.1.6 (data-updates.lua)
   0.699 Loading mod creative-mod 1.7.1 (data-final-fixes.lua)
   0.829 Checksum for core: 707333919
   0.829 Checksum of base: 2570609689
   0.829 Checksum of creative-mod: 3049276990
   0.829 Checksum of even-distribution: 437213863
   0.994 Prototype list checksum: 3957921952
   1.032 Info PlayerData.cpp:70: Local player-data.json available, timestamp 1609624978
   1.032 Info PlayerData.cpp:77: Cloud player-data.json unavailable
   1.033 Factorio initialised
   1.033 Info Main.cpp:739: Creating new map /opt/factorio/AwF-Bot-Test/awfmap
   
With the --config set

Code: Select all

   0.000 2021-01-03 08:39:45; Factorio 1.1.6 (build 57355, linux64, headless)
   0.045 Operating system: Linux (Ubuntu 20.04)
   0.046 Program arguments: "/opt/factorio/servers/test/bin/x64/factorio" "--create" "awfmap" "--config" "/opt/factorio/servers/test/config/config.ini"
   0.046 Read data path: /opt/factorio/servers/test/data
   0.046 Write data path: /opt/factorio/servers/test [161367/223812MB]
   0.046 Binaries path: /opt/factorio/servers/test/bin
   0.055 System info: [CPU: Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz, 12 cores, RAM: 32017 MB]
   0.055 Environment: DISPLAY=<unset> WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=<unset> XDG_SESSION_DESKTOP=<unset> XDG_CURRENT_DESKTOP=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.055 Running in headless mode
   0.102 Loading mod settings creative-mod 1.7.1 (settings.lua)
   0.105 Loading mod settings even-distribution 1.0.5 (settings.lua)
   0.106 Loading mod core 0.0.0 (data.lua)
   0.148 Loading mod base 1.1.6 (data.lua)
   0.375 Loading mod creative-mod 1.7.1 (data.lua)
   0.494 Loading mod even-distribution 1.0.5 (data.lua)
   0.599 Loading mod base 1.1.6 (data-updates.lua)
   0.704 Loading mod creative-mod 1.7.1 (data-final-fixes.lua)
   0.832 Checksum for core: 707333919
   0.832 Checksum of base: 2570609689
   0.832 Checksum of creative-mod: 3049276990
   0.832 Checksum of even-distribution: 437213863
   0.998 Prototype list checksum: 3957921952
   1.035 Info PlayerData.cpp:70: Local player-data.json available, timestamp 1609662930
   1.035 Info PlayerData.cpp:77: Cloud player-data.json unavailable
   1.036 Factorio initialised
   1.036 Info Main.cpp:739: Creating new map /opt/factorio/AwF-Bot-Test/awfmap
   

Re: [1.1.6] - Factorio server not getting path correctly

Posted: Sun Jan 03, 2021 4:27 pm
by oof2win2
Hmm, seems to work now :thinking:. Will check & post an update if anything changes (i.e. it stops working again)

Re: [1.1.6] - Factorio server not getting path correctly

Posted: Tue Jan 05, 2021 4:04 pm
by Rseding91
Thanks for the report however that's just how it all works. The config file exists to specifically handle things like this.