Page 1 of 1

Let --generate-map-preview render several planets in one launch

Posted: Thu Aug 27, 2026 9:48 am
by skelgaard
TL;DR
Let --map-preview-planet accept a list of planets (or be repeatable), so one Factorio
launch can render previews for several planets - the way --map-gen-seed-max already
renders several seeds in one launch.
What?
Today --map-preview-planet takes exactly one planet, so generating previews for N planets
means N launches, and every launch re-runs the whole startup and data stage.

I would like either or both of:
  • --map-preview-planet nauvis,gleba,aquilo (comma separated), and/or the option being
    repeatable.
  • When several planets are requested, write into the directory form of
    --generate-map-preview (a path ending in / or \) and name the files after the planet,
    for example <planet>.png or <seed>_<planet>.png.
The precedent already exists along the seed axis: --map-gen-seed-max and
--generate-map-preview-random amortise a single startup across many previews and write
<seed>.png into the output directory. This is the same idea for planets.
Why?
I maintain a tool that generates map previews for every planet of a map exchange string,
so speedrunners can share a full multi-planet preview of a seed:
https://github.com/AntiElitz/FactorioPreviewToolkit

With a large modpack the startup cost dwarfs the actual work. Measured on 2.1.16 with 108
mods loaded (a planet mod collection), for a single planet:

Code: Select all

Startup + loading 108 mods    43.3 s
Map preview generation         0.3 s
Total per launch              45.6 s
That modpack provides 41 planets, so a full set takes 34 minutes, of which about
20 seconds is real work - the same mods are loaded 41 times. One launch rendering all 41
would turn that into roughly one minute.

Running launches in parallel is not a workaround: peak working set for a single preview
run with that modpack is 8.7 GB, so two concurrent instances already need ~17 GB.
Related: an unknown planet name is silently rendered as Nauvis
While testing the above I found behaviour that makes this worse, and that I would report
as a bug on its own. All of this is on 2.1.17 (build 87315), Windows 11, vanilla with an
empty mod directory - log attached.

What did you do?

Code: Select all

factorio --generate-map-preview=out.png --map-gen-settings=map-gen-settings.json \
         --map-preview-size=512 --map-preview-planet=totally-bogus-name
What happened?
Exit code 0, and not one mention of the planet anywhere in the output - no warning, no
error. out.png is written and is byte-for-byte identical to the Nauvis preview generated
from the same settings, so the unknown name silently falls back to the default planet.

What did you expect to happen instead?
An error, or at minimum a warning that the planet does not exist. Silently producing a
plausible-looking preview of a different planet than the one requested is the worst
possible outcome for an automated pipeline.

Does it happen always, once, or sometimes?
Always.

Why it matters here
This is also what happens to --map-preview-planet=nauvis,vulcanus - the whole string is
treated as one unknown planet name, so you get Nauvis. And in a tool that renders one
preview per planet, a typo, or a planet from a mod that failed to load, yields a Nauvis
image stored under another planet's name, with no way to detect it except hashing the
output against a Nauvis render.
Current behaviour, for reference
Verified on 2.1.17, vanilla, identical --map-gen-settings and --map-preview-size=512,
outputs compared by hash against known Nauvis and Vulcanus previews:
  • --map-preview-planet=nauvis --map-preview-planet=vulcanus produces one image,
    Vulcanus - the last value wins, no warning.
  • --map-preview-planet=nauvis,vulcanus produces one image, Nauvis - see above.
  • Directory output with one planet writes <seed>.png, so several planets in one
    directory would collide on the seed-based name as things stand today.

Re: Let --generate-map-preview render several planets in one launch

Posted: Thu Aug 27, 2026 9:51 am
by Bilka
Please do not post ideas and suggestion in bug reports. I've moved this topic to ideas and suggestions. If you want to report a bug regarding the validation of the command line parameters, do so separately.

Regarding the feature request, you may want to turn on the prototype cache to improve startup time, you can find the setting in the config file.

Re: Let --generate-map-preview render several planets in one launch

Posted: Thu Aug 27, 2026 11:21 am
by skelgaard
Thanks - I tried cache-prototype-data=true on 2.1.17. With my 133-mod set Factorio logs "Data stage cache not used." on every single launch and then rewrites the 115 MB cache file again. Three planets through tool: 177s without the cache, 184s with it, so it is marginally slower rather than faster. On vanilla the cache is used (startup 1.4s → 0.8s), so the option works in general - it just doesn't engage with this mod set, and per an earlier topic the engine deliberately doesn't say why. That's why one launch per planet still costs ~35s of prototype loading for 0.3s of rendering.