Page 1 of 1

[0.17.x] Headless server. Editing --map-gen-setting yields error, and does not apply new settings.

Posted: Sun Mar 03, 2019 6:55 am
by lazybatman
[im new to this...]

Problem - I am trying to generate a map with peaceful mode activated by editing the map-gen-settings.json file, but the map is not generated with the changes active.

I am running a headless server on a t2.micro AWS instance.
I downloaded the server from the headless experimental release here https://www.factorio.com/get-download/l ... ss/linux64

It's been extracted, and I am using winscp to edit some of the settings.json files.

I am trying to create a save and apply some --map-gen-settings in the map-gen-settings.json file. Specifically, I am trying to create a map with peaceful mode ON.

Here is the contents of my map-gen-settings.json file (named "map-gen-settings.seventeen.json" for reference.)

Code: Select all

{
  "_comment": "Sizes can be specified as none, very-low, low, normal, high, very-high",

  "terrain_segmentation": "normal",
  "water": "normal",
  "width": 0,
  "height": 0,
  "starting_area": "normal",
  "peaceful_mode": true,

  "autoplace_controls":
  {
    "coal": {"frequency": "normal", "size": "normal", "richness": "normal"},
    "stone": {"frequency": "normal", "size": "normal", "richness": "normal"},
    "copper-ore": {"frequency": "normal", "size": "normal","richness": "normal"},
    "iron-ore": {"frequency": "normal", "size": "normal", "richness": "normal"},
    "uranium-ore": {"frequency": "normal", "size": "normal", "richness": "normal"},
    "crude-oil": {"frequency": "normal", "size": "normal", "richness": "normal"},
    "trees": {"frequency": "normal", "size": "normal", "richness": "normal"},
    "enemy-base": {"frequency": "normal", "size": "normal", "richness": "normal"}
  },
  "cliff_settings":
  {
    "name": "cliff",
    "cliff_elevation_0": 10,
    "cliff_elevation_interval": 10
  },

  "_comment_seed": "Use null for a random seed, number for a specific seed.",
  "seed": null
}
When I run the following command:
./bin/x64/factorio --create saves/tbagame.zip --map-gen-settings map-gen-settings.seventeen.json
I yield the following result:

Code: Select all

[ec2-user@ip-172-31-41-41 factorio]$ ./bin/x64/factorio --create saves/tbagame.zip --map-gen-settings map-gen-settings.seventeen.json
   0.000 2019-03-02 20:45:55; Factorio 0.17.4 (build 43174, linux64, headless)
   0.000 Operating system: Linux
   0.000 Program arguments: "./bin/x64/factorio" "--create" "saves/tbagame.zip" "--map-gen-settings" "map-gen-settings.seventeen.json"
   0.000 Read data path: /home/ec2-user/factorio/data
   0.000 Write data path: /home/ec2-user/factorio [6491/8179MB]
   0.000 Binaries path: /home/ec2-user/factorio/bin
   0.006 System info: [CPU: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz, 1 core, RAM: 985 MB]
   0.006 Environment: DISPLAY=<unset>, WAYLAND_DISPLAY=<unset>
   0.006 Running in headless mode
   0.009 Loading mod core 0.0.0 (data.lua)
   0.052 Loading mod base 0.17.4 (data.lua)
   0.246 Loading mod base 0.17.4 (data-updates.lua)
   0.333 Checksum for core: 3928040144
   0.333 Checksum of base: 60305742
   0.858 Info PlayerData.cpp:69: Local player-data.json unavailable
   0.858 Info PlayerData.cpp:74: Cloud player-data.json unavailable
   0.859 Custom inputs active: 0
   0.861 Factorio initialised
   0.862 Info GlobalContext.cpp:678: Waiting for child processes to exit:
   0.881 Goodbye
   0.000  Error Util.cpp:83: filesystem error: file_size(p): unknown error: No such file or directory [map-gen-settings.seventeen.json]
Notice the final line in the snippet above: 0.000 Error Util.cpp:83: filesystem error: file_size(p): unknown error: No such file or directory [map-gen-settings.seventeen.json]

The file does exist on the server here:
/home/ec2-user/factorio/data
I can't seem to find any info online what can help me avoid or fix this error. I'm hoping someone here might be able to help.

Just some additional info - I can run the following command and the server starts up just fine with all the settings in the server-settings.seventeen.json file active:
./bin/x64/factorio --start-server-load-latest --server-settings ./data/server-settings.seventeen.json
Please let me know if have any ideas, or if you need any additional info.

Thanks!

Re: [0.17.x] Headless server. Editing --map-gen-setting yields error, and does not apply new settings.

Posted: Sun Mar 03, 2019 12:40 pm
by orzelek
Will placing the map settings file next to executable help?

Re: [0.17.x] Headless server. Editing --map-gen-setting yields error, and does not apply new settings.

Posted: Sun Mar 03, 2019 2:17 pm
by lazybatman
orzelek wrote: Sun Mar 03, 2019 12:40 pm Will placing the map settings file next to executable help?
I'm not quite sure what you mean. Would you mind showing me the syntax?

Re: [0.17.x] Headless server. Editing --map-gen-setting yields error, and does not apply new settings.

Posted: Sun Mar 03, 2019 6:46 pm
by orzelek
You are reporting that file with settings is not found when placed in data folder. Unless you give relative path to it.
So place it one folder up in base folder and it should work.

Re: [0.17.x] Headless server. Editing --map-gen-setting yields error, and does not apply new settings.

Posted: Mon Mar 04, 2019 1:25 am
by lazybatman
I think this is what you're suggesting?
./bin/x64/factorio --create --map-gen-settings map-gen-settings.seventeen.json saves/tbagame.zip
Tried that and I did not get an error. however, it did not generate a save file.

I ended up creating a save file locally and ftping it up to the server as a workaround... not exactly resolved, but I have it running the way I want it now.

Thanks for your help.

Re: [0.17.x] Headless server. Editing --map-gen-setting yields error, and does not apply new settings.

Posted: Mon Mar 04, 2019 4:02 pm
by Momitsu
You're lacking the whole path to the settings file. Tried that on my server receiving the same result.

After I gave the whole path (in my case /home/fctrserver missing at the pathe of the json-file) it was working as expected

Code: Select all

./serverfiles/bin/x64/factorio --create /home/fctrserver/serverfiles/save1 --map-gen-settings /home/fctrserver/serverfiles/data/map-gen-settings.momi.json

Re: [0.17.x] Headless server. Editing --map-gen-setting yields error, and does not apply new settings.

Posted: Mon Mar 04, 2019 5:56 pm
by Eiermann
Works fine on debian with relative paths:

Code: Select all

./bin/x64/factorio --create ./saves/free-2019.zip --map-gen-settings ./data/map-gen-settings.example.json --map-settings ./data/map-settings.example.json --server-settings ./data/server-settings.example.json