Map generator: Difference between revisions
(→Mechanics: commented out outdated explanation) |
No edit summary |
||
Line 291: | Line 291: | ||
== Mechanics == | == Mechanics == | ||
=== Resource and terrain generation === | |||
The map generator (world generator) is based on a modified [http://en.wikipedia.org/wiki/Perlin_noise Perlin noise algorithm]. | The map generator (world generator) is based on a modified [http://en.wikipedia.org/wiki/Perlin_noise Perlin noise algorithm]. | ||
A [http://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification more detailed description] can be found in the API documentation. | A [http://lua-api.factorio.com/latest/Concepts.html#AutoplaceSpecification more detailed description] can be found in the API documentation. | ||
Line 299: | Line 299: | ||
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'''. | 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. | 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. | ||
=== Chunks === | === Chunks === |
Revision as of 20:41, 29 August 2018
World generation is the procedure by which the in game landscape is generated. In short: a number of settings, editable at the start of a new world, define what that world will look like. This can dramatically alter gameplay — a new player is advised to start with the default settings before deciding to change their world.
Map generation presets
A preset may be chosen instead of manually configuring the generation.
Default
Normal settings.
All terrain and resource settings set to regular/normal/medium.
Advanced settings
All settings are set to their defaults:
Pollution | Default | Evolution | Default | |
---|---|---|---|---|
Absorbed per damaged tree | 500 | Enabled | Yes | |
Diffusion ratio | 2% | Time factor | 0.00000400 | |
Dissipation rate | 1 | Destroy factor | 0.00200000 | |
Enabled | Yes | Pollution factor | 0.00001500 | |
Minimum damage to trees | 3500 |
Enemy expansion | Default | Recipes/Technology | Default | |
---|---|---|---|---|
Enabled | Yes | Recipe difficulty | Normal | |
Maximum expansion distance | 7 | Technology difficulty | Normal | |
Minimum group size | 5 | Technology price multiplier | 1 | |
Maximum group size | 20 | |||
Minimum cooldown (Minutes) | 4 | |||
Maximum cooldown (Minutes) | 60 |
Rich resources
Resources patches have a larger richness, so you don't have to expand far.
Difference from default: Resources have very good richness instead of regular.
Marathon
Recipes and technologies are more expensive.
Difference from default: Expensive recipes and technology, technology price multiplier 4.
Death world
Biters are more dangerous and evolve faster.
Difference from default: Very high frequency and size enemy bases, small starting area, enemy evolution time factor and pollution factor are both set to 0.00002.
Death world marathon
Recipes and technologies are expensive and biters are dangerous and plentiful. Only select this if you are a Factorio veteran.
Combines "Marathon" and "Death world".
Rail world
Resource patches are large and spread far apart, to encourage train systems. Biters won't create any new bases or re-expand into cleared territory.
Difference from default: Coal, copper ore, iron ore, and stone are set to very low frequency and big size instead of normal/medium. Uranium ore and crude oil are set to low frequency and high size. Water has a very low frequency and a big size. The evolution time factor is set to 0.000002 and enemy expansion is disabled.
Manual configuration
Basic settings
Peaceful mode
The enemies don't begin fights, only responding if the player hits them.
Enable replay
- Main article: Replay system
Record all the actions that the player(s) perform during the game, so that they can later be played back as essentially a timelapse of the save file.
Map-width and -height
If the player limits the width and/or height they may generate maps with finite resources and area. Another option is to make the world infinite in only one axis, this is commonly referred to as a ribbon world.
Map seed
This is the starting value for the random number generator that Factorio uses for generating the world based on the generation settings. Know that 'random number' is really a misnomer in Factorio and on computers in general, as they aren't really random, instead being calculated with complicated algorithms that require a seed as starting value (For more detail, see http://en.wikipedia.org/wiki/Random_seed).
So even with the same map-exchange string but a different seed maps can change dramatically, or appear very similar. It's up to chance. In order to get a true copy of a world, giving the map exchange string and allowing the string to fill out the seed is important.
Map exchange string
A map exchange string generally looks like this:
>>>eNpjYBBg0GdgYGBm5mFJzk/MYWZm4UrOLyhILdLNL0plZmTmTC4q TUnVzc/MYWFmZktJLU4tKmEGqkrJBNNcqXmpuZW6SYnFqUAea3pRYnE xkMGRWZSfBzKBEai0ODEvBSRZXJKfB1TFyFpSlJoKUsVdWpSYl1maC7 aKhZmBMcvcibmhRY4BhP/XMxj8/w/CQNYFoBNBGORSBkagAAywJudkp qUxMCg4gjAjI2O1yDr3h1VT7Bkh8noOUMYHqEjEbqjIg1YoI2I1lNFx GMpwmA9j1MMY/Q6MxmDw2R7BgNhVAjQZagmHA4IBkWwBSTIy9r7duuD 7sQt2jH9Wfrzkm5Rgz5gpG+orUPreDijJDtTAyAQnZs0EgZ0wHzDAzH xgD5W6ac949gwIvLFnZAXpEAERDhZA4oA3MHgE+ICsBT1AQkGGAeY0O 5gxIg6MaWDwDeaTxzDGZXt0f6g4MNqADJcDESdABNhCuMsYocxIB4iE JEIWqNWIAdn6FITnTsJsPIxkNZobVGBuMHHA4gU0ERWkgOcC2ZMCJ14 wwx0BDMEL7DAeMG6ZGRDgg/3WD0/SAKZ2kr0=<<<
The map exchange string can be used to share all map generation settings between different players. The player can paste the string (using CTRL + V) into the map exchange string field and the game will set the generation settings to the settings saved in the string, resulting in a complete copy of the map when generated.
The map exchange string can be retrieved from save files by going into the load game screen, selecting the desired map, clicking the Map Exchange String button in the lower left corner and copying the string from the window that pops up.
For a technical description of the map exchange string, see map exchange string format.
Resource and terrain settings
Frequency
For resources, frequency determines the frequency of ore/oil patches. The higher the frequency, the more patches can be found in a given area. Although the ore patches are of a smaller size, a higher frequency still results in more ore tiles being generated.
Frequency modifies the area of each deposit and the number of deposits. If resource frequency is increased, each of the deposits is smaller and has less resources in total (because it covers less area) and deposits are very common. If resource frequency is decreased, the deposits are larger but more rare.
Terrain, including enemy bases and trees, is affected in the same way: The higher the frequency, the more terrain "blobs"/nest clusters/forests can be found in a given area, while their sizes decrease with higher frequency.
Cliffs are affected in a similar way: The higher the frequency, the more cliffs can be found. However, the overall cliff area size increases with higher frequency, while the cliff "lines" are broken up more often, meaning that higher frequencies result in many big cliff blobs composed of short cliff "lines".
Size
For resources, the size setting adjusts the size of generated ore/oil patches.
It's as simple as it seems — Small size would means small ore/oil patches, large means large ore/oil patches, thus increasing the resource count in a given area. Note that ore/oil patch size is also affected by frequency.
Due to a bug, enemy bases are currently not affected by the size setting. Their size can only be changed by changing their frequency.
The other terrain types, including water and trees, are affected the same way as resources.
Due to a bug, the effect of the size setting on cliffs cannot be reliably predicted. Any size setting above small may lead to cliffs spawning in the starting area. Big and very big size seem to always spawn cliffs everywhere, while medium size and below may not spawn any cliffs.
The following table shows how the frequency and size settings affects the generation of ore patches. For more detail, open the images in a new tab.
Frequency \ Size | Very small | Small | Medium | Big | Very big |
---|---|---|---|---|---|
Very low | |||||
Low | |||||
Normal | |||||
High | |||||
Very high |
Starting area
The starting area is a special area around the central coordinates of the map which has different ore, water and enemy generation, from the rest of the map. Generally, this results in at least one confirmed ore source each of coal, iron ore, copper ore, and stone, always results in a water source, and always removes biter nests from spawning for an area around spawn. Uranium ore and crude oil should not spawn in the starting area. Cliffs should not spawn in the starting area[1], but due to a bug they may spawn there. The size of the starting area is adjusted by changing the size setting.
Very small | Small | Medium | Big | Very big |
---|---|---|---|---|
Richness
This defines the actual content of every ore patch and oil field. The higher the richness, the more ore or oil each resource tile contains. Resource field richness increases by distance.
For trees, the richness setting changes the density of their leaves. The higher the richness, the higher their leaf density, the more pollution they absorb.[2]
For enemy bases, the richness setting does not have an effect.[3]
Very poor | Poor | Regular | Rich | Very rich |
---|---|---|---|---|
Advanced settings
These settings do not affect world generation, instead they allow to change some constants related to the map in general.
Pollution
These settings allow to enable/disable pollution and further adjust it when keeping it enabled.
Setting | Description |
---|---|
Diffusion ratio | The amount of pollution diffused into neighboring chunks per second. |
Dissipation rate | Controls how fast pollution dissipates naturally. |
Minimum to damage trees | Any pollution above this amount starts to damage trees. |
Absorbed per damaged tree | The amount of pollution absorbed by a tree when it is damaged by pollution. |
Evolution
These settings allow to enable/disable evolution and further adjust it when keeping it enabled.
Setting | Description |
---|---|
Time factor | Controls how fast evolution increases over time. |
Destroy factor | Controls how fast evolution increases due to destroying enemy spawners. |
Pollution factor | Controls how fast evolution increases due to producing pollution. |
Enemy expansion
These settings allow to enable/disable enemy expansion and further adjust it when keeping it enabled.
Setting | Description |
---|---|
Maximum expansion distance | The maximum distance enemies will look to expand from other enemy bases. |
Minimum group size | The minimum size of an enemy expansion party modified by the current evolution level. |
Maximum group size | The maximum size of an enemy expansion party modified by the current evolution level. |
Minimum cooldown | The minimum time between enemy expansions being sent out. |
Maximum cooldown | The maximum time between enemy expansions being sent out. |
Recipes/Technology
This setting allows to change the recipe/technology difficulty and multiply the technology cost.
Currently, setting the technology difficulty does not have an effect in vanilla.
Mechanics
Resource and terrain generation
The map generator (world generator) is based on a modified Perlin noise algorithm. A more detailed description can be found in the API documentation.
From the article which describes the generation:
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.
Chunks
A map is endless by default, though its size can be limited by height and width — see above. Because it is technically endless, the whole map is not generated from the start. Instead, a new chunk of the map is generated only when needed, similar to other procedurally generated world games.
Invisible chunks (fog of war)
Outside of the visible chunk area, an invisible area of about 3 chunks wide is generated as a preloading mechanism. Enemies may be located inside these invisible chunks and can attack the player from there, while artillery turrets and wagons may automatically shoot enemy bases in these chunks if they are within their automatic range. Invisible chunks are also generated if pollution is generated heavily; the game generates (invisible) chunks as it needs to spread the pollution into the area.
Charting (removing fog of war)
As long as a chunk is invisible, the part of the players map stays black. This changes when a chunk is charted, which means when it is "touched" by a radar. This can be either the player's internal radar, which is always available and continually charts chunks around the player, or the radar entity. If a far-away and thus ungenerated chunk is charted, it will be generated, together with the above-mentioned invisible 3 chunk radius of map around it.
Maximum map size and used memory
The map size is limited to 2,000 x 2,000 kilometers; internally, this is a square 2,000,000 tiles on a side, with an area of 4,000,000,000,000 (4 trillion) square tiles (assuming 1 tile = 1 meter on a side yields 2,000 x 2,000 km = 4 million square km). In real-world terms, this is between the sizes of India and Australia (or about 40% the area of the United States, or over 10 times the area of Germany). It would take around 200 game-minutes (ca 3.3 hours real time) to reach that border from the center when riding a train fueled with rocket or nuclear fuel. This makes the world essentially endless for practical purposes.
Because chunks are only generated in and close around the area revealed by radar, it is possible to reach that border without overloading your computer, as the size of the map in computer memory is dependent only on chunks actually generated. If only a narrow stripe of land is explored to far away, this remains manageable.
The generated chunks are fully mapped and stored in the player's RAM, which is the practical limiting factor of exploration.
History
- 0.16.0:
- Added cliffs.
- New terrains and new terrain generation.
- Trees can now be configured in the generate-map GUI.
- Terrain can be configured in the generate map GUI.
- Biters scale less with distance and there are generally less biters.
- No uranium as a starting resource also no uranium is ever generated near the starting area, you need to go look for it.
- 0.15.0:
- Extended map generator settings to include an advanced section.
- Added map generator presets.
- The map seed is used to generate unique maps instead of just shifting the starting position.
- 0.13.7:
- Map size is now limited to 2000 km by 2000 km with a black bar rather than crashing when reaching this distance.
- 0.13.0:
- Map generator algorithm changed, further resource field now have greater richness.
See also
- Some technical info
- Temperature based biome-model (how trees are placed)