See pictures above. If you want to move both the lake and the ore patches, move the lake first, because it changes the ore patches.
Compatibility:
- Should be compatible with most other mods, including mods that add resources.
- Tested with vanilla, Industrial Revolution 3, and Alien Biomes.
- Not compatible with Resource Spawner Overhaul (RSO).
- Probably not compatible with Space Exploration. It seems to work for the starting planet, though the starting patches are controlled by the "other resources" settings. I haven't tested how it affects the other planets/etc. and I think it probably messes them up.
- Compatible with my other mod Finer World Options.
With some mods that change world generation, this mod can't figure out what counts as a starting patch. In that case, you can use the "other resources" settings to move starting patches.
This mod can only move resources when creating a new game. To move patches in an existing game, try Ore Patch Organizer, Ore Mover/Manager, or Omnimover.
Technical details
To offset the resource patches, this mod checks all resource prototypes for autoplace specifications, then recursively looks through the noise expression tree to find every place where x
or y
are used. It then replaces those with subtrees representing x + log(xOffset) * offsetScale * offsetScale * 64
, and similarly for y
. The log
is necessary because the game thinks the offsets are "frequency multipliers".
The autoplace specifications have nodes for starting and non-starting area patches all jumbled up, making it impossible to neatly differentiate between them, so we must instead use a "creative solution". The game records the filename and line number where each noise expression was created, so we check those to guess whether the patch is a starting-area patch or not. If a Factorio update modifies that file, or if an overhaul mod changes how autoplace specifications are created, this mod will incorrectly categorize starting patches as non-starting patches. But that's not a big problem because people can still use the "other resources" settings to move them.
If a mod doesn't work, and the resource patches don't respond at all to the offset sliders, it's probably because the mod is creating autoplace specifications in the data-final-fixes stage. You can fix that by just adding an optional dependency on that mod. If the sliders work but the starting patches are controlled by the "other resources" sliders, you can fix that by modifying isStartingVariable
here for whatever overhaul mod you're using, or for vanilla if they've changed the file.
The starting lake offsets work differently. This mod sets the map-gen "elevation" expression to a new expression that is a copy of the base game's elevation function, but with a few extra lines inserted for the new controls.