[0.15.31] Linux headless server random map generation

This subforum contains all the issues which we already resolved.
Post Reply
MrGoodbits
Inserter
Inserter
Posts: 25
Joined: Mon Jun 27, 2016 9:33 pm
Contact:

[0.15.31] Linux headless server random map generation

Post by MrGoodbits »

I am running Ubuntu 16.04 Linux headless and have found some issues generating maps. I get the same map under several condition including when "seed": null is set as per the example mag-gen-settings.json
"_comment_seed": "Use null for a random seed, number for a specific seed.",
"seed": null

Command line I used to generate worlds:
./bin/x64/factorio --map-gen-settings map-gen-settings.json --create saves/world.zip

What I have found (below is the seed line from the .json file, and the results on server from the /seed command:

"seed": null
/seed
1

"seed": ""
/seed
1

"seed": 1
/seed
1
^ This is actually correct

by removing the seed line completely
/seed
1

"seed":
0.000 Error Util.cpp:62: Unexpected character at map-gen-settings.json:23
^ Error from syntax incorrect

"seed": "123"
/seed
1

"seed": 123
/seed
4040535837
^ seed didn't match what I requested

ran again
"seed": 123
/seed
3000332189
^ a different seed was used

Summary:
Anytime I generate a map with null or a quoted number, I get a map with seed = 1.
Anytime I generate a map with a specific seed number, I get a random map.


I hope my notes are clear and this is helpful.

Thank you,
Mr Goodbits

Rseding91
Factorio Staff
Factorio Staff
Posts: 13202
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.15.31] Linux headless server random map generation

Post by Rseding91 »

Thanks for the report. I noticed as well that it's not working as desired :)

How it's meant to work:
  • If you give a seed in map-gen-settings.json it uses that.
  • If you don't define a seed in map-gen-settings.json and you defined a seed via --map-gen-seed it uses that else it uses a random seed
Right now it works like this:
  • If you define no seed it uses "1" as the seed
  • If you define a map-gen-settings.json seed it uses a random seed
  • If you define a seed with --map-gen-seed it uses that.
If you want to get ahold of me I'm almost always on Discord.

MrGoodbits
Inserter
Inserter
Posts: 25
Joined: Mon Jun 27, 2016 9:33 pm
Contact:

Re: [0.15.31] Linux headless server random map generation

Post by MrGoodbits »

I would recommend the process be:

if --map-gen-seed is provided, use that
then use map-gen-settings.json seed if given
then fall to random if none given anywhere

perhaps check for "--map-gen-seed random" on the command line to enable forcing random to over ride .json.

This would allow the runtime command line option to take precedence and over the json. I figure anything given on the command line should be used.

Thanks,
MrGoodbits

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [0.15.31] Linux headless server random map generation

Post by posila »

Thanks for the report.
Fixed for next release.

Post Reply

Return to “Resolved Problems and Bugs”