In other languages: Deutsch 日本語 Português, Brasil Русский Українська 简体中文

Map generator: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (→‎Generation: don't link to mobile versions of Wikipedia pages. Mobile browsers will usually switch to the version of the page automatically, if it's available, but contrariwise, most desktop browsers will not switch to the desktop version)
(Grammatical overhaul. Incomplete.)
Line 1: Line 1:
{{Languages}}
{{Languages}}
Many players have problems to understand the Map Generator. This is a try to explain the basic function. But it must be also said, that a complete rework/rewrite or whatever is on the devs todo-list, but will take some more time. So the players must live with that, how it works, and if you understand the principle it is really not that bad.
World generation is, in short, a number of settings which define what the world will look like once generated. This can dramatically alter gameplay- a new player is advised to start with the default settings before deciding to change their world.


==How it works==
==How it works==
: [[File:MapGeneratorOverview.png]]
: [[File:MapGeneratorOverview.png]]
Basically you need to know, that the map generator generates most parts of the world with an algorithm, called "Perlin Noise". See below for details. You just need to know, that it works a bit like the waves in the sea.
A more technical explanation of world generation mechanics is that the map generator generates most parts of the world with an algorithm named "Perlin Noise". In short, it works a bit like the waves in the sea.


[[File:Water-ocean-waves-sea-high-resolution-pictures.jpg|thumb|left|300px]]
[[File:Water-ocean-waves-sea-high-resolution-pictures.jpg|thumb|left|300px]]
Line 10: Line 10:




Everything above a defined level, defines the existing (or non-existing) of some type of terrain.
Everything above a defined level defines the existing (or non-existing) features of some type of terrain.




You also need to know, that the map is not generated at game start. Only the parts you see are generated, everything else is not. The map will be generated, when you explore more terrain. See below for more technical details.
The player should also know that the map is not generated at game start. Only the parts they see are generated, everything else is not. The map will be generated gradually as the player explores more terrain. See below for more technical details.


<br clear=all>
<br clear=all>
Line 19: Line 19:
===The top row===
===The top row===
====Frequency====
====Frequency====
This is '''not''', how frequent ore, coal, oil etc. is.
This is '''not''', how frequent ore, coal, oil etc. is, instead determining the number of individual deposits the player will encounter.


This defines - to keep in this picture - the wavelength of the wave-generators.
This defines the wavelength of the wave-generators used by the Perlin Noise algorithm above, but not the total size of all the waves.


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.
What this means is that frequency doesn't modify the amount of resources on a tile, instead modifying the size of each deposit. If the player decreases frequency then each of the deposits 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.
Additionally, changing frequency doesn't affect the average amount of resources in a limited map, only their distribution.


''High frequency'': For Terrain segmentation it means: Many different types of terrain, forest, dessert and swamp could be within 10 tiles or less. For resources: Many, but very small patches of resources.
''High frequency'': For Terrain segmentation it means: Many different types of terrain, forest, desert and swamp could be within 10 tiles or less. Recommended for players interested in the different biomes of the world.
For resources: Patches of resources are very common but frequently small and wear out quickly. Recommended for players who are willing to constantly reset equipment in exchange for a constant supply of resources.


''Low frequency'': For Terrain segmentation it means: Big landscapes, vast areas only with forests. For resources: Not many, but if you found one very big patches of resources.
''Low frequency'': For Terrain segmentation it means: Big landscapes, vast areas typically only with forests. Recommended for players who want to consistently experience what they have near their spawn point.
For resources: Resource patches are fairly rare but almost always very large and rich in resources. Recommended for players who don't want to move equipment often or who prefer to explore the world.


In short: Low terrain segmentation means large areas with same terrain. High segmentation is the contrary, the terrain changes nature often. Typically huge forests vs. lots of small woods.
In short: Low terrain segmentation means large areas with same terrain. High terrain segmentation is the opposite, the terrain changing nature often. Typically huge forests vs. lots of small woods.
 
This also causes enemy bases to appear more often using the same distribution rules as ores and biomes- however, this can lead to rapid [[Enemy]] expansion due to the much higher number of nest clusters.


====Size====
====Size====
This defines the "level" (see below!): Everything above that defined level, defines the existing (or non-existing) of some type of terrain.
This defines the size of generated ore patches and water through defining "levels."
 
It increases the average diameter of ore patches and lakes, allowing one to adjust the size of both of these.


That means, that the same shaped wave, could look completely different, if you shift this level up and down, but in the end you increase or decrease the average diameter of an ore-patch, of lakes.
It's as simple as it seems- Small size would mean small ore patches and water masses, large means large ore patches and water masses. Note that this is effected by frequency, though it is presumably able to increase the total ore and water of the world where frequency simply re-balances it.


With small size you get small ore-patches, with big size you get big ore patches. It is a bit dependent on the frequency, of course.
Finally, this causes enemy bases to spawn larger, though bases created through the "natural process" of expansion are going to adhere to different rules.


====Richness====
====Richness====
This defines the average wave-height. A high wave means: Much resources per [[Tile]].
This defines the actual content of each generated ore patch, oil field, and [[Enemies]]' base drops, through changing the "height" of the wave.


If you put this to high for Enemy bases, you get as result for killing a "rich" [[Enemies#Spawners]] much more [[Alien artifact]]s.
Note that with bases this does not make them more difficult, but rather increases the [[Alien artifact]] yield.


===The left column===
===The left column===
* Terrain segmentation: How often the terrain changes. There are some different types of terrain. This depends also the water.
* Terrain segmentation: How often the terrain changes between biomes. This can include water, so beware of lower settings as they can limit world size artificially.
* Water: How big the lakes get. They can be really big, can take you an hour or more to surround by car. This influences also the chance, to be fully surrounded by water!
* Water: How water is generated on each map. Be warned that, since water is currently impassible except over lighter regions of water, this can potentially create very small or hard to navigate maps.
* Copper, Stone, Coal, Crude oil: Needed resources. See above about Frequency, size and richness.
* Copper, Stone, Coal, Crude oil: Resources required to progress in the game. See above for more detailed explanations about each of these change.
* Enemy bases: How many and how big could the starting enemy bases. Note, that the enemies develop and build new villages during the game.
* Enemy bases: How many and how large starting bases are. Note that new bases are created over time, making low enemy base counts somewhat less significant.


===Starting area===
===Starting area===
This is A special value. It defines a special starting area around the central coordinates. This area will have different ore frequency, etc. from the rest of the map. The settings of this area usually guarantee better starting-conditions, although it may very by your map seed.
This is a value defining a special area around the central coordinates of the map which will have different ore frequency, etc. from the rest of the map. Generally, this results in at least one confirmed ore source, always results in a water source, and always removes biter nests from spawning for an area around spawn. The settings of this area usually guarantee better starting conditions, although conditions may vary- the player may spawn completely isolated from the rest of the world!


Note: if you set "size" here very low or none, the map generator can generate maps that are impossible to survive. You might start on a very small island, or on a big island without resources, or even in the middle of a biter nest and many more issues.
The player may choose to make this area small or remove it entirely, however, this is not recommended as this opens the possibility of spawning in an impossible situation, or even in a biter nest.


It is generally a good idea for you to explore a bit outside this area before you begin to build. It is not necessarily a bug if the map generator generates maps that are almost completely useless.
It is generally a good idea for the player to explore a bit outside this area before they begin to build. While this area will almost always appear very fertile, it's possible that map generation will have made a situation where it is impossible to beat the game.


===Peaceful mode===
===Peaceful mode===
The [[Enemies]] don't begin to fight, only if you hit them. This can be also switched on during the game, look into [[Console/Lua_commands#Useful_commands_.28cheats.29|Console commands]].
The [[Enemies]] don't begin fights, only responding if the player hits them. This can be also switched on during the game- look into [[Console/Lua_commands#Useful_commands_.28cheats.29|Console commands]].


===Map-width and -height===
===Map-width and -height===
If you limit the width and/or height you can generate maps with limited width and height. See below "Generating when exploring".
If the player limits the width and/or height they may generate maps with limited width and height. This is recommended for multiplayer servers running on weaker machines or players seeking extra challenge.


===Map seed / Map Exchange String===
===Map seed / Map Exchange String===


; Map Seed
; Map Seed:
: Random number generator seed
: Random number generator seed
; Map Exchange String
; Map Exchange String

Revision as of 02:32, 14 March 2016

World generation is, in short, a number of settings which define what the world will look like once generated. This can dramatically alter gameplay- a new player is advised to start with the default settings before deciding to change their world.

How it works

MapGeneratorOverview.png

A more technical explanation of world generation mechanics is that the map generator generates most parts of the world with an algorithm named "Perlin Noise". In short, it works a bit like the waves in the sea.


Everything above a defined level defines the existing (or non-existing) features of some type of terrain.


The player should also know that the map is not generated at game start. Only the parts they see are generated, everything else is not. The map will be generated gradually as the player explores more terrain. See below for more technical details.


The top row

Frequency

This is not, how frequent ore, coal, oil etc. is, instead determining the number of individual deposits the player will encounter.

This defines the wavelength of the wave-generators used by the Perlin Noise algorithm above, but not the total size of all the waves.

What this means is that frequency doesn't modify the amount of resources on a tile, instead modifying the size of each deposit. If the player decreases frequency then each of the deposits has less resources in total (because it covers less area), but per tile of a deposit there will be the same number of resources. Additionally, changing frequency doesn't affect the average amount of resources in a limited map, only their distribution.

High frequency: For Terrain segmentation it means: Many different types of terrain, forest, desert and swamp could be within 10 tiles or less. Recommended for players interested in the different biomes of the world. For resources: Patches of resources are very common but frequently small and wear out quickly. Recommended for players who are willing to constantly reset equipment in exchange for a constant supply of resources.

Low frequency: For Terrain segmentation it means: Big landscapes, vast areas typically only with forests. Recommended for players who want to consistently experience what they have near their spawn point. For resources: Resource patches are fairly rare but almost always very large and rich in resources. Recommended for players who don't want to move equipment often or who prefer to explore the world.

In short: Low terrain segmentation means large areas with same terrain. High terrain segmentation is the opposite, the terrain changing nature often. Typically huge forests vs. lots of small woods.

This also causes enemy bases to appear more often using the same distribution rules as ores and biomes- however, this can lead to rapid Enemy expansion due to the much higher number of nest clusters.

Size

This defines the size of generated ore patches and water through defining "levels."

It increases the average diameter of ore patches and lakes, allowing one to adjust the size of both of these.

It's as simple as it seems- Small size would mean small ore patches and water masses, large means large ore patches and water masses. Note that this is effected by frequency, though it is presumably able to increase the total ore and water of the world where frequency simply re-balances it.

Finally, this causes enemy bases to spawn larger, though bases created through the "natural process" of expansion are going to adhere to different rules.

Richness

This defines the actual content of each generated ore patch, oil field, and Enemies' base drops, through changing the "height" of the wave.

Note that with bases this does not make them more difficult, but rather increases the Alien artifact yield.

The left column

  • Terrain segmentation: How often the terrain changes between biomes. This can include water, so beware of lower settings as they can limit world size artificially.
  • Water: How water is generated on each map. Be warned that, since water is currently impassible except over lighter regions of water, this can potentially create very small or hard to navigate maps.
  • Copper, Stone, Coal, Crude oil: Resources required to progress in the game. See above for more detailed explanations about each of these change.
  • Enemy bases: How many and how large starting bases are. Note that new bases are created over time, making low enemy base counts somewhat less significant.

Starting area

This is a value defining a special area around the central coordinates of the map which will have different ore frequency, etc. from the rest of the map. Generally, this results in at least one confirmed ore source, always results in a water source, and always removes biter nests from spawning for an area around spawn. The settings of this area usually guarantee better starting conditions, although conditions may vary- the player may spawn completely isolated from the rest of the world!

The player may choose to make this area small or remove it entirely, however, this is not recommended as this opens the possibility of spawning in an impossible situation, or even in a biter nest.

It is generally a good idea for the player to explore a bit outside this area before they begin to build. While this area will almost always appear very fertile, it's possible that map generation will have made a situation where it is impossible to beat the game.

Peaceful mode

The Enemies don't begin fights, only responding if the player hits them. This can be also switched on during the game- look into Console commands.

Map-width and -height

If the player limits the width and/or height they may generate maps with limited width and height. This is recommended for multiplayer servers running on weaker machines or players seeking extra challenge.

Map seed / Map Exchange String

Map Seed
Random number generator seed
Map Exchange String
All settings for the map creation (Map Seed, settings for resources, settings for size, etc.)

Map Seed

This is the starting value for the random number generator, that Factorio uses for anything in the game. (Random number in Factorio and on computers in generally aren't really random, they are calculated with complicated algorithmns, that need a seed as startng value, see http://en.wikipedia.org/wiki/Random_seed).

So even with the same map-exchange string, but different map seed the map could look quite differently. But it might also be quite similar.

Map Exchange String

A string, that looks for example like so:

>>>AAALABAABgADAwYAAAAEAAAAY29hbAMDAgoAAABjb3BwZXItb3Jl
AwMCCQAAAGNydWRlLW9pbAMDAgoAAABlbmVteS1iYXNlAwMCCAAAAGl
yb24tb3JlAwMCBQAAAHN0b25lAwMCORcrDUQ7AACMCwAAAAAAAAAAAA
ADAFR8w0Q=<<<

There is a thread for exchanging new strings: http://www.factorioforums.com/forum/viewtopic.php?f=36&t=5807

Where can I use this string?

It can be used in the map-generator: there is an extra field where you can paste this string into. (Control-V under windows)

Where can I get this string from?

In the Load Game dialog, select the game whose string you want, then click the Map Exchange String button in the lower left corner. When the string pops up, highlight it with your mouse and press Control-C to copy it. (Command-C on Mac.) You can now paste it in the map generator or send it to a friend.

Generation

The map generator (world generator) is based on modificated Perlin noise algorithm. A more detailed description is in the API docu.

From the article, which describes the generation:

Factorio-Perlin-Noise.png

Top: Normal settings, Middle: The same, but with higher frequency (note the same curve, but more condensed shape), Down: Same as top, but higher level = increased size.

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. 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.

Generating when exploring

A map is normally endless (if not other defined with limits, see "Map-width and -height" above!).

Because of that, the whole map isn't generated from start. A new Chunk of map is generated only, when explored. This means you come to the current visible borders and then the needed chunks are generated. It makes no difference, if you discover that, or if it is discovered by Radar or the game (silently) discovers some (hidden) chunks for some biter village.

For endless maps, the size is limited only by your computers memory. Which is quite big. If a tile is one square meter, and you have 8 GiB free memory you can discover an area about the size of the state of Lichtenstein. :) (quite raw estimation!)

But you can also generate maps with limited width and height. Note, that you can also limit only the width or only the height, so you can generate "stripes" of land. There are players, that love to play maps with a height of only 20 tiles (or less).

Note also, that everything around the map-limits (end of world) is just water. You can place a Pump at the edge of a map and it will suck water out of nothing.

See also