Factorio Earth deprecated

by hyspeed

**NOTE**: I have released Cities of Earth 2 (https://mods.factorio.com/mod/CitiesOfEarth2) which doesn't need this mod. (I should probably deprecate both of them.) :) Mod that changes the world generation to be a map of Earth. This mod only overrides the generated tiles. Ore, biters, trees and other entities will still be randomly generated.

Content
3 years ago
0.18 - 1.1
813
Environment
Owner:
hyspeed
Source:
https://github.com/HySpeed/FactorioEarth
Homepage:
https://github.com/hyspeed/FactorioEarth
License:
GNU GPLv3
Created:
4 years ago
Latest Version:
0.20.0 (3 years ago)
Factorio version:
0.18 - 1.1
Downloaded by:
813 users

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:

  1. In ConvertMap.py change the image file path and output path:
    1. At the bottom there is a call to convert(...), change it's parameters to the paths you want to use
    2. The first argument is the image you want to convert
    3. The second argument is the file it will end up in (make sure it end in .lua)
  2. Change the color-codes
    1. 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).
  3. Run the Python converter file
  4. Copy the created lua file into the mod's folder
  5. In control.lua change the first line:
    1. It should be require "..."
    2. Change it to be require "your_newly_generated_lua_files_name" (note there is no .lua here)
  6. Again in control.lua, but now a few lines below, change the 'settings':
    1. It should read local offset = {x = 2000 * 4, y = 400 * 4}
    2. 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.
  7. 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.