In other languages: Deutsch Українська

Map structure: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(Initial creation of page, merged from Tile, Chunk and Region)
 
(Finished merge of tile, chunk and region into Map_structure. Added some example images.)
Line 1: Line 1:
{{Languages}}
{{Languages}}


'''Map structure''' refers to...
'''Map structure''' refers to the physical division of the game world into standard [[Units|units]] of area: tiles, chunks and regions. Tiles are the building blocks of the game upon which all distance and area measurements are based. Chunks are blocks of 32x32 tiles used for various area-based calculations. Regions are much less commonly used, and may be seen only in certain debug text.


== Tile ==
== Tile ==
[[File:MapStructure-GridExample.png|thumb|right|400px|The tile grid shown in-game; chunks (32x32 tiles) are indicated by the thicker black lines. Click to see at higher resolution.]]


A '''tile''' is the smallest piece of the world map. The whole [[Factorio]] world is made out of them.
A '''tile''' is a square area which defines the smallest possible piece of the game world; the map is built on a grid of tiles. The size of all entities is defined as a certain area of tiles, for example a [[rocket silo]] - the largest entity in the game - is 9 tiles wide and 9 tiles high, usually referred to as 9x9. The smallest possible entity is the same size as one tile, or 1x1. Examples of 1x1 entities include [[transport belt]]s, all [[chests]], and [[small electric pole]] and [[medium electric pole]]s.


Tiles are used as a [[Units|unit]] for measuring area and distance.
The maximum number of tiles available in one map is 4 trillion - the [[World_generator#Maximum_map_size_and_used_memory|maximum size of the game map]] is a square 2 million tiles on a side. In practice the average game map is likely to consist of up to a few million tiles.


A [[Chunk]] (32×32 tiles) is the next largest unit for area/distance.
=== Tile grid alignment ===


=== How to see tiles and chunks? ===
Almost all placeable entities are aligned to the tile grid when the player places them in the game. Exceptions include the [[landmine]] and vehicles such as the [[car]], [[tank]], [[locomotive]] and [[wagon]]s.  Non-placeable entities that do not align to the grid include enemies, [[trees]] and certain decorative items.


You can either
[[File:MapStructure-PlaceableOffGridExample.png|thumb|none|300px|A few entities can be placed without aligning to the tile grid; this example shows cars, tanks and landmines.]]
* pause the game (by default with [[Keyboard bindings|Shift-Space]]) or
* you can use the [[Debug mode]] to turn the tile-layer on.


== Examples ==
=== Example distances ===


* Area covered by [[Radar]]: about 100 tiles diameter (100 tiles in each direction, bounded to the matching [[Chunk]], read about [[Radar]] to understand this)
* Area covered by [[Radar]]: about 100 tiles diameter (100 tiles in each direction, bounded to the matching [[#Chunk|chunk]]. Ror more information see [[Radar]].
* Speed of a basic [[Transport belt]]: about 1.8 tiles/sec.
* It takes about 1 minutes and 52 seconds to run 1000 tiles without speed up. <sup>[https://wiki.factorio.com/Talk:Exoskeleton#Movement%20speed%20experiments]</sup> (As a side note, this would mean that the character is a very healthy person.)
* It takes about 1 minutes and 52 seconds to run 1000 tiles without speed up. <sup>[https://wiki.factorio.com/Talk:Exoskeleton#Movement%20speed%20experiments]</sup> (As a side note, this would mean that the character is a very healthy person.)


== Real size of tiles ==
=== Real size of tiles ===


1 tile is generally assumed to be 1 square meter in size (like Minecraft). According to [http://www.factorioforums.com/forum/viewtopic.php?f=5&t=9182&p=73352#p73349 this discussion], this assumption seems to be true.
1 tile is generally assumed to be 1 square meter in size (like Minecraft), as [https://forums.factorio.com/viewtopic.php?f=5&t=9182&p=73352#p73266 this discussion] confirms.


== Chunk ==
== Chunk ==


A Chunk is a [[units|unit]] defined as either an area of the map 32×32 [[tile]]s in size (containing 1024 tiles in total) ''or'' a distance of 32 tiles.
A '''chunk''' is a unit defined as either an area of the map 32×32 tiles in size (containing 1024 tiles in total) ''or'' a distance of 32 tiles.


Chunks are used for:
Chunks are used for:
* Map generation. When the [[player]] runs around, has a [[radar]] explore the map via sectors or has [[artillery shell]]s fired across long distances, the map is revealed in chunks.
* Map generation. When the [[player]] moves, has a [[radar]] explore the map via sectors, or has [[artillery shell]]s fired across long distances, the map is revealed in chunks.
* Chunks are "switched off" to save CPU cycles. If nothing important happens in a chunk (e.g. there are only fishes swimming around in the chunk) the chunk is not computed in the next [[Tick]].
* Chunks are "switched off" to save CPU cycles. If nothing important happens in a chunk (e.g. nothing has moved except [[fish]]) the chunk is not computed in the next [[Tick|tick]].
* The [[pollution]] model is based on chunks, and pollution spreads to neighboring chunks.
* The [[pollution]] model is based on chunks, and pollution spreads to neighboring chunks.
* [[Enemy]] expansion is based on chunks. The game scans the map chunk by chunk to decide whether each chunk is a valid expansion target. Valid chunks are called 'candidate chunks' and assigned a score from 0 to 1.0 according to their suitability. A chunk is then picked at random using a weighted dice roll.
== Visualizing tiles and chunks in-game ==
A tile grid overlay is available which shows the grid upon which the map is built:
* The grid can be shown whenever the player pauses the game (by default with {{Keybinding|Shift-Space}}).
** This is configured under Settings->Interface->'''Show grid when game is paused'''
* To see the grid while the game is still running, [[Debug mode|debug settings]] can be used:
** Pressing {{Keybinding|F4}} will show the '''Debug settings''' window.
** Ticking '''show-tile-grid''' under '''always''' will show the grid at all times; ticking it under '''debug''' while show it when debug mode is activated.
** If '''debug''' is chosen, the grid will become visible whenever {{Keybinding|F5}} is used to enable debug display. Configuring debug mode in this way allows {{Keybinding|F5}} to be used as a convenient toggle for turning the grid on and off, which can be useful when attempting to place entities according to a neat and/or symmetrical design.


== Region ==
== Region ==


A '''Region''' is 16 by 16 [[Chunk]]s large.
A '''Region''' is an area of 16 by 16 chunks; 268,435,456 tiles.


Regions are actually not used anywhere in-game except for the debug info (no game mechanic depends on regions, no scripting functions have access to regions), and currently they are only used for organizing allocations.
No game mechanic depends on regions and there are no [[modding]] APIs that access the game by region. Currently they are only used internally for organizing allocations, and there is a chance that they will be removed from the game in the future.


There is a chance that they will be removed completely in the future.
=== References ===
 
== References ==
* http://www.factorioforums.com/forum/viewtopic.php?f=18&t=5754
* http://www.factorioforums.com/forum/viewtopic.php?f=18&t=5754
== See also ==

Revision as of 15:53, 15 March 2019


Map structure refers to the physical division of the game world into standard units of area: tiles, chunks and regions. Tiles are the building blocks of the game upon which all distance and area measurements are based. Chunks are blocks of 32x32 tiles used for various area-based calculations. Regions are much less commonly used, and may be seen only in certain debug text.

Tile

The tile grid shown in-game; chunks (32x32 tiles) are indicated by the thicker black lines. Click to see at higher resolution.

A tile is a square area which defines the smallest possible piece of the game world; the map is built on a grid of tiles. The size of all entities is defined as a certain area of tiles, for example a rocket silo - the largest entity in the game - is 9 tiles wide and 9 tiles high, usually referred to as 9x9. The smallest possible entity is the same size as one tile, or 1x1. Examples of 1x1 entities include transport belts, all chests, and small electric pole and medium electric poles.

The maximum number of tiles available in one map is 4 trillion - the maximum size of the game map is a square 2 million tiles on a side. In practice the average game map is likely to consist of up to a few million tiles.

Tile grid alignment

Almost all placeable entities are aligned to the tile grid when the player places them in the game. Exceptions include the landmine and vehicles such as the car, tank, locomotive and wagons. Non-placeable entities that do not align to the grid include enemies, trees and certain decorative items.

A few entities can be placed without aligning to the tile grid; this example shows cars, tanks and landmines.

Example distances

  • Area covered by Radar: about 100 tiles diameter (100 tiles in each direction, bounded to the matching chunk. Ror more information see Radar.
  • It takes about 1 minutes and 52 seconds to run 1000 tiles without speed up. [1] (As a side note, this would mean that the character is a very healthy person.)

Real size of tiles

1 tile is generally assumed to be 1 square meter in size (like Minecraft), as this discussion confirms.

Chunk

A chunk is a unit defined as either an area of the map 32×32 tiles in size (containing 1024 tiles in total) or a distance of 32 tiles.

Chunks are used for:

  • Map generation. When the player moves, has a radar explore the map via sectors, or has artillery shells fired across long distances, the map is revealed in chunks.
  • Chunks are "switched off" to save CPU cycles. If nothing important happens in a chunk (e.g. nothing has moved except fish) the chunk is not computed in the next tick.
  • The pollution model is based on chunks, and pollution spreads to neighboring chunks.
  • Enemy expansion is based on chunks. The game scans the map chunk by chunk to decide whether each chunk is a valid expansion target. Valid chunks are called 'candidate chunks' and assigned a score from 0 to 1.0 according to their suitability. A chunk is then picked at random using a weighted dice roll.

Visualizing tiles and chunks in-game

A tile grid overlay is available which shows the grid upon which the map is built:

  • The grid can be shown whenever the player pauses the game (by default with Shift-Space).
    • This is configured under Settings->Interface->Show grid when game is paused
  • To see the grid while the game is still running, debug settings can be used:
    • Pressing F4 will show the Debug settings window.
    • Ticking show-tile-grid under always will show the grid at all times; ticking it under debug while show it when debug mode is activated.
    • If debug is chosen, the grid will become visible whenever F5 is used to enable debug display. Configuring debug mode in this way allows F5 to be used as a convenient toggle for turning the grid on and off, which can be useful when attempting to place entities according to a neat and/or symmetrical design.

Region

A Region is an area of 16 by 16 chunks; 268,435,456 tiles.

No game mechanic depends on regions and there are no modding APIs that access the game by region. Currently they are only used internally for organizing allocations, and there is a chance that they will be removed from the game in the future.

References