Page 2 of 4

Map Generator Config Templates

Posted: Sun Oct 18, 2015 5:59 pm
by UberWaffe
Idea
Allow pre-defined templates to be made (and saved) for the map generation config.
A template would set the options to that as defined in the file (config option not specified by the file simply remain unchanged).
Options can still be changed after a template is chosen, a template simply does a once-off set of the config values.

Reasons
There are certain config options that I enjoy playing with, without wanting to go as far as using a map exchange string (which also specifies the world seed). I'd like to be able to save and load them, without having to remember and re-setup each time.
Especially when more resource types are introduced via mods, it can become a pain to set everything to the values that I enjoy. (I know they retain unless you quit the game, but you don't always realize a map start is bad until you've played a bit. Which often includes saving and quitting and thus losing the settings.)
Predefined templates shipped with the game for 'easy', 'medium', and 'hard' will also make map generation easier to understand for new players (at least I didn't really understand the impact of changing the settings until I had played through a game once. I had messed with the settings before I played my first game, and only afterwards had I understood what I had done. And only then really when I had done several map generations in the map editor to see what it results in.)
Overhaul Mods can also provide one or two 'suggested' map-gen-config option files, which help people new to the mod to get it with more than just pure 'normal' settings.

Description
A template file could look something like this:

Code: Select all

{
  type = "map-gen-template",
  name = "easy",
  -- description = "", -- This is in the locale file.
  peaceful_mode = false,
  terrain_segmentation = 3,  -- 1 (Very Low) -> 5 (Very High)
  water = 3,  -- 0 (Only in starting area) -> 5 (Very Big)
  starting_area = 5,  -- 0 (None) -> 5 (Very Big)
  resource_configs =
  {
    {
      name = "iron-ore",
      frequency = 4,  -- 1 (Very Low) -> 5 (Very High)
      size = 3,  -- 0 (None) -> 5 (Very Big)
      richness = 5,  -- 1 (Very Poor) -> 5 (Very Rich)
    },
    {
      name = "copper-ore",
      frequency = 4,  -- 1 (Very Low) -> 5 (Very High)
      size = 3,  -- 0 (None) -> 5 (Very Big)
      richness = 5,  -- 1 (Very Poor) -> 5 (Very Rich)
    },
    {
      name = "coal",
      frequency = 4,  -- 1 (Very Low) -> 5 (Very High)
      size = 3,  -- 0 (None) -> 5 (Very Big)
      richness = 5,  -- 1 (Very Poor) -> 5 (Very Rich)
    },
    {
      name = "stone",
      frequency = 4,  -- 1 (Very Low) -> 5 (Very High)
      size = 3,  -- 0 (None) -> 5 (Very Big)
      richness = 5,  -- 1 (Very Poor) -> 5 (Very Rich)
    },
    {
      name = "crude-oil",
      frequency = 4,  -- 1 (Very Low) -> 5 (Very High)
      size = 4,  -- 0 (None) -> 5 (Very Big)
      richness = 4,  -- 1 (Very Poor) -> 5 (Very Rich)
    },
    {
      name = "aliens",
      frequency = 1,  -- 1 (Very Low) -> 5 (Very High)
      size = 3,  -- 0 (None) -> 5 (Very Big)
      richness = 5,  -- 1 (Very Poor) -> 5 (Very Rich)
    }
  }
}

Re: Map Generator Config Templates

Posted: Mon Oct 19, 2015 12:39 pm
by TuckJohn
I am all for it. Yes please

Alternatively, you could save what the map generation settings are at to a file, and whenever creating a world preset all of the drop-down menus to how they were last time. You would have to have a "reset to default" button, though.

User-Made Difficulty Presets

Posted: Mon Apr 24, 2017 8:39 pm
by Nemoricus
With the addition of difficulty presets, it would be nice if players could make and name their own. I personally use a custom set of settings that doesn't match up neatly with any of the official presets, and it would be nice if I could save and load them.

Yes, map strings let you do this, but that doesn't let you give them a custom name and it requires you to save the string outside of the game if you want to use it later.

Save custom world presets

Posted: Wed Apr 26, 2017 5:15 pm
by hanli427
With the new 0.15.x, there are a number of presets with the game, such as marathon, death world and rail world. But how about letting the players save their own custom presets for reusing, or sharing with others.

Re: Save custom world presets

Posted: Wed Apr 26, 2017 5:23 pm
by impetus maximus
+1

i'm trying to find a good setting for trains. would love to save, or share the setting i end up with.

welcome to the forums hanli427. :)

Re: Save custom world presets

Posted: Wed Apr 26, 2017 10:18 pm
by mattj256
+1

Re: Save custom world presets

Posted: Thu Apr 27, 2017 12:11 pm
by Lav
+1. Was going to suggest this myself. Factorio now has enough options that restoring my custom preset is getting annoying.

Re: Save custom world presets

Posted: Thu Apr 27, 2017 12:24 pm
by hoho
+1

I was rather surprised that being able to save (and share) presets was not already in game. Having just a handful of them pre-made seems weird.

Re: Save custom world presets

Posted: Fri Apr 28, 2017 5:26 pm
by credomane
hoho wrote:Having just a handful of them pre-made seems weird.
The intention behind that was to enable someone to say I beat the game with this preset and everyone knows exactly what that is with what settings. Before death world/rail world/marathon would all very a little between users.

Not being able to create your own list of presets does suck. Mods can add new ones though. :/

Re: Save custom world presets

Posted: Fri Apr 28, 2017 9:02 pm
by hoho
credomane wrote:The intention behind that was to enable someone to say I beat the game with this preset and everyone knows exactly what that is with what settings. Before death world/rail world/marathon would all very a little between users.
Yes, I know why they added those premade ones. I was just surprised that people can't add to them :)

Re: Save custom world presets

Posted: Sat Apr 29, 2017 4:58 pm
by Karakaz
+1

Re: Save custom world presets

Posted: Sat Apr 29, 2017 5:03 pm
by 5thHorseman
+1000 would instantly install a mod that added this (hint hint) :D

Re: Save custom world presets

Posted: Sat Apr 29, 2017 5:08 pm
by orzelek
You do realize that custom preset changes actual map gen setting which are contained in map exchange string already?

There is nothing else tied to them - no special functionality etc. It's only changes to other tabs.

Re: Save custom world presets

Posted: Sat Apr 29, 2017 5:35 pm
by Rseding91
hanli427 wrote:With the new 0.15.x, there are a number of presets with the game, such as marathon, death world and rail world. But how about letting the players save their own custom presets for reusing, or sharing with others.
This is what the map exchange string is. Literally - it copies all settings in that display and restores them when pasting it into the exchange string field.

Re: Save custom world presets

Posted: Sat Apr 29, 2017 9:22 pm
by Lav
Copying a map exchange string is not the same as selecting a preset in the list - it requires a lot more manual actions and an outside storage. It also includes map seed, which is not needed for a preset.

When I find a set of map generation parameters which result in maps that I find interesting, I want that set to be available to me every time I start a new game. Storing a map exchange string in a separate file somewhere on the disk absolutely defeats that purpose - it's probably easier to setup all settings manually than bother with map exchange strings.

Re: Save custom world presets

Posted: Sat Apr 29, 2017 9:23 pm
by impetus maximus
boy do i feel dumb. :lol:

Re: Save custom world presets

Posted: Mon May 01, 2017 12:45 pm
by ssilk
Lav wrote:Copying a map exchange string is not the same as selecting a preset in the list - it requires a lot more manual actions and an outside storage. It also includes map seed, which is not needed for a preset.
Agreed, it could be more comfortable, but I use a text-editor and paste the string and when I use it I can or cannot remove the seed.

I think the problem is, that there is a difference between the both use-cases:
A) I want to have filled out all of the configuration so that it can be used as preset to generate a new world.
B) I want to generate exactly the same world as in my (last) game.../I want to share this world

Re: Save custom world presets

Posted: Mon May 01, 2017 1:52 pm
by Lav
That's right, except presets list caters exclusively to the first option, but is incomplete at the moment.

Re: Save custom world presets

Posted: Mon Jul 31, 2017 3:37 am
by bagaznal
I found out how you can make your own custom preset!

If you want to proceed, you'll need two things:

Notepad++
Minor Coding knowledge (if you can edit minecraft configs and the such, that should be enough)

Go to this address on your computer:

C:\Program Files (x86)\Steam\steamapps\common\Factorio\data\base\prototypes

In this folder you will see a file that says map-gen-presets.lua. Open this with Notepad++

WARNING: BEFORE YOU PROCEED, MAKE A BACKUP OF THIS FILE. IF THE FORMATTING IN THIS FILE IS INCORRECT, THEN FACTORIO WILL FAIL TO START.

To create a "preset", you need to type it in the EXACT same format as the other. I attached a picture to explain some of it. Unfortunately, I have no clue as for specifics, all I know is that when I tested this, it made a new preset with a weird name, and it generated a world from it perfectly fine. Basically, just perfectly match the previous presets, and you should be good to go!

Re: Save custom world presets

Posted: Mon Jul 31, 2017 12:47 pm
by Jap2.0
Also, map strings don't carry over custom settings regarding biters and pollution (last I checked).