Add multiple preview generation to the CLI

peet1993
Inserter
Inserter
Posts: 25
Joined: Fri Sep 01, 2017 8:46 pm
Contact:

Add multiple preview generation to the CLI

Post by peet1993 »

Hi,

It would be neat being able to generate multiple previews without needing to setup/tear down factorio fully from the command line for every preview generated.
Examples how that feature could work:

Code: Select all

./factorio --generate-map-preview path/to/store/pics/ --generate-map-preview-count N // For random maps
./factorio --generate-map-preview path/to/store/pics/ --map-gen-seed 1,2,3,4 // For N specific seeds
For file names, the game can use the seed number and prepend ".png". Generating the same seed twice would just overwrite the file, which is not a problem because the result is the same anyways. If the previewcount argument or multiple seeds are given, "--generate-map-preview" would expect a directory instead of a filename.

Thanks in advance if you decide to implement this! :D

Greetings,
peet1993
cactauz
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Feb 26, 2019 7:45 pm
Contact:

Re: Add multiple preview generation to the CLI

Post by cactauz »

Another idea would be to add the ability to specify a range of seeds ex:

Code: Select all

 // generates 1.png ... 999.png
 ./factorio --generate-map-preview path/to/store/pics/ --map-gen-seed-min 1 --map-gen-seed-max 999
+1 thanks if you implement this in any way!
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Add multiple preview generation to the CLI

Post by Bilka »

Okay, I added map-gen-seed-max which generates every second seed from map-gen-seed to map-gen-seed-max. I also added generate-map-preview-random, it generates random seeds for N number of times (if no max seed is given). In general, generate-map-preview now needs PATH instead of PNGFILE. The file is now always named after the seed.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
peet1993
Inserter
Inserter
Posts: 25
Joined: Fri Sep 01, 2017 8:46 pm
Contact:

Re: Add multiple preview generation to the CLI

Post by peet1993 »

Thats amazing, thank you! Even better than I had wished for :D
TOGoS
Former Staff
Former Staff
Posts: 97
Joined: Fri Jun 24, 2016 2:29 pm
Contact:

Re: Add multiple preview generation to the CLI

Post by TOGoS »

I wanted to keep the old behavior where --generate-map-preview's argument is treated as the filename (because I have a set of scripts that depends on the meaning of that argument being consistent across Factorio versions). So if you want the 'directory full of maps with different seeds' behavior, just make sure to end the paths provided to --generate-map-preview with a slash (as in peet1993's original suggestion).
Post Reply

Return to “Implemented mod requests”