automatic map generation

Enhance your gameplay with these tools. This category is also the right place for tools useful for modders.
Mod databases, calculators, cheatsheets, multiplayer, scripts, libs and other useful stuff that is not strictly in-game mods.
gheift
Fast Inserter
Fast Inserter
Posts: 188
Joined: Tue Mar 03, 2015 9:20 pm
Contact:

automatic map generation

Post by gheift »

Based on a reddit thread I created a script, which creates screenshot of maps on linux.

The script creates a screenshot of a new generated map in the script-output directory. The current format is netpbm ppm and can be converted to jpeg or png, if the netpbm is installed. To do this after the generation, just uncomment the commands in ./map-gen.sh.

Since the game does not provide a function to generate a screenshot of the map (at least I do not found one), I implemented it myself in lua. Therefore there are currently no nests and trees on the map.

To use it you do the following:
  • download the headless server from https://www.factorio.com/download-headless/experimental
  • unpack it somewhere
  • download the attached script
  • unpack the content in the directory of the headless server, this will overwrite data/base/scenarios/freeplay/control.lua
  • open a terminal and change into the directory of the headless server
  • run ./map-gen.sh
  • Profit!
This takes around 30 to 45 seconds and will (hopefully) produce output like this:

Code: Select all

# generating map...
# starting server...
# request the chunk generation
# 205 of 1024 chunks generated
# 308 of 1024 chunks generated
# 410 of 1024 chunks generated
# 512 of 1024 chunks generated
# 615 of 1024 chunks generated
# 717 of 1024 chunks generated
# 820 of 1024 chunks generated
# 871 of 1024 chunks generated
# 973 of 1024 chunks generated
# all chunks generated
# map generated: ./script-output/seed_1841311017-terrain_normal-water_normal.ppm
seed_1841311017-terrain_normal-water_normal.png
seed_1841311017-terrain_normal-water_normal.png (63.21 KiB) Viewed 5157 times
Attachments
map-gen-v1.zip
(9.69 KiB) Downloaded 288 times
Peppe
Fast Inserter
Fast Inserter
Posts: 223
Joined: Fri Nov 28, 2014 6:48 pm
Contact:

Re: automatic map generation

Post by Peppe »

gheift
Fast Inserter
Fast Inserter
Posts: 188
Joined: Tue Mar 03, 2015 9:20 pm
Contact:

Re: automatic map generation

Post by gheift »

I am aware of this command, but AFAIK you can not create an image of the map with it. If you set the zoom to 1/32 (1 pixel per tile) the result is much noisier than the map. Here is the result of the seed I used above:
screenshot.jpg
screenshot.jpg (299.77 KiB) Viewed 4750 times
Post Reply

Return to “Tools”