Random Map Generator

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Sophalin
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Jan 14, 2015 7:37 pm
Contact:

Random Map Generator

Post by Sophalin »

Hello all
I am new to the game but I understand the concepts quite well.
However I am trying to play the sandbox, so I create a random map. The only thing I changed in the categories is the line of the coal. I wanted lots of coal so I change it to very high frequency, Very large size and very good richness.
Although the areas of coal are rich, they are quite small in size and even though on some maps it seems that there are plenty of coal fields in most of them there are very few fields.

This is not the case with the copper and iron. even if I put normal amounts of them, I got many times large fields of copper and iron.

I tried about 50 maps...

is this some kind of bug or sheer bad luck?
n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

Re: Random Map Generator

Post by n9103 »

Frequency seems to be more of a divisor than a multiplier.
More frequent patches means smaller individual ones. Vice versa for less frequent.
Colonel Failure wrote:You can lose your Ecologist Badge quite quickly once you get to the point of just being able to murder them willy-nilly without a second care in the world.
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: Random Map Generator

Post by cube »

I should have drawn this a long time ago:
factorio-resources.png
factorio-resources.png (31 KiB) Viewed 16456 times
The blue wavy line is an internal noise function, black line is a "level" that is used to determine resource placement, red lines are actual placed resources.

The high frequency refers mainly to the noise function. Increasing the frequency increases count of resource fields and decreases their size and distance between them.

This mechanism is used all through the map generation in factorio, with some adjustments.
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Random Map Generator

Post by Choumiko »

cube wrote:The blue wavy line is an internal noise function, black line is a "level" that is used to determine resource placement, red lines are actual placed resources.

The high frequency refers mainly to the noise function. Increasing the frequency increases count of resource fields and decreases their size and distance between them.

This mechanism is used all through the map generation in factorio, with some adjustments.
Very interesting, so if the noise function where sinus, this would mean sth. like f(x) = sin(frequency*x)+size ( -1 < size < 1) ? And the distance between rising nullpoints (is that the term?) would be the placed ressources.
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: Random Map Generator

Post by cube »

Choumiko wrote:Very interesting, so if the noise function where sinus, this would mean sth. like f(x) = sin(frequency*x)+size ( -1 < size < 1) ? And the distance between rising nullpoints (is that the term?) would be the placed ressources.
Almost. The map generator works tile by tile, so the resources are placed on a tile x if f(x) > 0. The amount of resources on the tile is given by f(x) * richness.
katyal
Fast Inserter
Fast Inserter
Posts: 208
Joined: Wed Nov 12, 2014 8:42 pm
Contact:

Re: Random Map Generator

Post by katyal »

so low frequency = widely spaced large + poor deposits
high frequency = tightly spaced small rich deposits

do size and richness have any secondary effects or are they just modifiers?
User avatar
Xterminator
Filter Inserter
Filter Inserter
Posts: 981
Joined: Sun Jun 15, 2014 4:49 pm
Contact:

Re: Random Map Generator

Post by Xterminator »

Wow that's really interesting. Cool to know how it actually works. :D
In my experience if you want a map with a butt load of resources, it is usually nest to just increase size and richness, and not touch frequency.
Image Image Image
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: Random Map Generator

Post by cube »

katyal wrote:so low frequency = widely spaced large + poor deposits
high frequency = tightly spaced small rich deposits

do size and richness have any secondary effects or are they just modifiers?
Frequency doesn't modify the amount of resources on a tile. If you increase frequency then each of the deposists has less resources in total (because it covers less area), but per tile of a deposit there will be the same number of resources.
Also changing frequency doesn't affect the average ammount of resources in a (large) map, only their distribution.
katyal
Fast Inserter
Fast Inserter
Posts: 208
Joined: Wed Nov 12, 2014 8:42 pm
Contact:

Re: Random Map Generator

Post by katyal »

So cube to go with the combobox on the map settings screen would it be possible to see (hopefully even edit) the underlying values?

Also have you tried different algorithms for generating resources? If so...no matter the results you got, would it be possible to release them, like rso mod for example? OR maybe something like ssilk was suggesting in https://forums.factorio.com/forum/vie ... f=6&t=4692
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Random Map Generator

Post by ssilk »

@Katyal: this is the problem: finding an algorithm, which can be called _per tile_ without knowing anything else but the coordinates and the map-seed and return a map-tile (not a complete chunk), that matches fine into the neighborhood.

The point is: on this level of map generation, the algorithm can't know anything around him. And so it cannot change the generated amount of resources. Cause of missing input and disability to look at other map tiles around.

And to explain my idea again (for cube: see also https://forums.factorio.com/forum/vie ... 517#p63517): you cannot change this. But instead of that you can add a second map generator and tell him to be "blended in" in this area only.

So, this is what you need to do: generate a map. Open it with the map editor and look at it. Too less coal. Ok, let's add a second map, that has a coal patch, about here... The coal patch is blended in. You can play around with the looking of that coal patch, if you're lucky you can look more around.

The end of this process is a mod/scenario, that has a description, like "Katyal's totally weighted resources". It is not an already rendered map, it is a description for the map generator to run with this seed and add/overlap other maps with that seed at those coordinates.

You can do other cool things with this. Let's say you have an already finished map, which has a smelting area. So you can go into the map editor and tell him, to load this area of your map into that area of the generated. And suddenly you have a finished smelting area in your map, which is not included, when starting the map, it is only generated, when you generate that part of the map.

In other words: if you put over the current map generator an advanced map generator, that has the additional input parameters "a list of maps" and "rules, that tells which map should be blended in how strong at which coordinates", you can generate nearly anything. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Sophalin
Burner Inserter
Burner Inserter
Posts: 9
Joined: Wed Jan 14, 2015 7:37 pm
Contact:

Re: Random Map Generator

Post by Sophalin »

This seems odd to me

That means that if I use High freq, low size, good richness, I will have small very rich deposits but on my last game, the definitions were up-side-down than those, and i had huge deposits with more than 44K! of copper, iron and coal!

Btw, is there anything in the definitions to control forests size?
katyal
Fast Inserter
Fast Inserter
Posts: 208
Joined: Wed Nov 12, 2014 8:42 pm
Contact:

Re: Random Map Generator

Post by katyal »

The current method used to distribute resources is perlin noise...I was just asking if another method had been tried, and if so could we see the results.

What about having a few prerendered "resource maps" (greyscale images that affect resource placement). You keep the current map generation but the resource map would influence the results.
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

Re: Random Map Generator

Post by cube »

We've been planning to make some changes to world generation for a long time now:
1) Simpler gui, more relying on mods than on tons of combo boxes (how many resources, how many enemies, how much water)
2) guaranteed starting area resources + less probable islands (a trick with pre-generating rather large part of the world around start and checking if it meets the requirements)
3) lua code for autoplacer -- this would enable generating destroyed (or even working!) bases, treasure chests guarded by biters..... a lot of fun things :-)

Unfortunately all these have fairly low priority now, don't expect them for 0.12. But it will happen some day :-)
katyal
Fast Inserter
Fast Inserter
Posts: 208
Joined: Wed Nov 12, 2014 8:42 pm
Contact:

Re: Random Map Generator

Post by katyal »

Thats fantastic, no need to rush just knowing that these things are in the development pipeline is enough for now
Post Reply

Return to “Gameplay Help”