FactorioEarth
A mod for factorio that changes the map into a map of Earth.
Note that it only changes the terrain, and not the spawning of trees and resources.
This mod is an updated version of The Oddler's 'factorio world':
- https://mods.factorio.com/mods/TheOddler/factorio-world
Usage
- Simply start a new game
- You should then start in England
Note that it can take a long time to load all the required data.
This means your game will hang for a while when starting a map.
To see progress of the loading run your game from the console (so you can see debug messages).
In steam add "cmd /c %command%" to your launch options, as this will also show the console.
Selecting map size
To change the scale of the map change the variable scale
in control.lua
.
Versions
v0.20.0
Updated to Factorio 1.1
v0.18.2
- Fixed serialization bug
v0.18.1
- Added check for surface to be
nauvis
to help with compatibility with Space Exploration and similar mods. - This change was made & tested by ptx0 - many thanks!
v0.18.0 * Convert to Factorio v0.18
Generating your own maps
The mod reads lua files generated by a converter writen in Python.
These files are generated based on images.
Currently I'm using the "Natural Earth II with Shaded Relief, Water, and Drainages" image from Natural Earth.
The generator simply iterates over each pixel, and assigns a tile-type to it.
The algorithm uses reference colors, and checks which one is closer to encode the types.
To compress the data a little I use a scheme where every tile-letter is followed by how many tiles there are of this type of that row.
The mod then takes these strings (one for each line of pixels), decompresses it to something it can read very quickly, and assigns the tiles a new type when a chunk is generated.
Require Python libraries
- Pillow - for processing the images:
pip install Pillow
- tqdm - for some nice loading bars while you wait for the slow converter:
pip install tqdm
Usage of Custom Map Generator
To generate a new lua file and load in into your game you'll have to do a little manual labour:
- In ConvertMap.py change the image file path and output path:
- At the bottom there is a call to
convert(...)
, change it's parameters to the paths you want to use - The first argument is the image you want to convert
- The second argument is the file it will end up in (make sure it end in .lua)
- At the bottom there is a call to
- Change the color-codes
- At the top in ConvertMap.py there is a list called
terrain_codes
.
This is the data used to figure out which color should be which tile type.
Change the colors (first values in the tuples) to match your image.
You can see two examples, one for the Natural Earth maps, and one for a map of Britain (though slightly editied by me to increase size and remove text).
- At the top in ConvertMap.py there is a list called
- Run the Python converter file
- Copy the created lua file into the mod's folder
- In control.lua change the first line:
- It should be
require "..."
- Change it to be
require "your_newly_generated_lua_files_name"
(note there is no .lua here)
- It should be
- Again in control.lua, but now a few lines below, change the 'settings':
- It should read
local offset = {x = 2000 * 4, y = 400 * 4}
- Change this offset to something so your guy doesn't drown instantly
- The offset is in pixel-coordinates. 0,0 is the most upper left pixel of the image.
- It should read
- Run the game and start a new game.
- I think if you use the mod on an existing save, it will start working on newly generated chunks, but that's untested atm.