In other languages: Čeština Deutsch Español Français 日本語 한국어 Nederlands Polski Português, Brasil Русский Українська 简体中文

Time: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
No edit summary
m (Fixed a typo)
 
(17 intermediate revisions by 9 users not shown)
Line 1: Line 1:
{{Languages}}
{{Languages}}__NOTOC__
[[File:Time.png|150px|right|Crafting time icon.]]
[[File:clock_hi_res.png|80px|left]]
=== Crafting time ===
The concept of '''Time''' in Factorio is used for many different implements, most notably crafting time and game time.
When hovering over an item recipe, you may see a clock symbol and a number. This is the amount of time needed to craft the item in [[Game-second|game seconds]]. [[Assembling machine|Assembling machines]] have a multiplier that determines their crafting speed. [[Module|Modules]] may also affect crafting time, either speeding it up or slowing it down for some other benefit.


=== Game time ===
== Crafting time and speed ==
When hovering over an item recipe, the player may see a clock symbol and a number. This is the amount of time needed to craft the item in seconds at crafting speed 1. The player always crafts at speed 1 while [[assembling machine]]s have different crafting speeds. [[Module]]s may also affect crafting time, either speeding it up or slowing it down for some other benefit. The player, when handcrafting, crafts with a multiplier of 1, so items that claim to take 10 seconds to craft will take 10 seconds, but an [[assembling machine 1]] with a multiplier of 0.5 will take 20 seconds. It is important to take this into consideration when creating setups with proper ratios.{{clear}}


Time in Factorio may also refer to:
== Ticks ==
The base unit of all time inside Factorio. When running at game speed 1, there should always be 60 ticks in every real-time second leading to the figure of 60 updates per second, short UPS. This means that 1 tick should ideally always take 1/60th of a real-time second (0.01667 seconds). However, it is possible to change the [http://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.speed game speed] using mods or console commands, so it is possible that ticks don't take 0.01667 real-time seconds. Furthermore, game speed will automatically slow down when the computer that is running the game is unable to do all needed calculations in the wanted 0.01667 real-time seconds. The "show-fps" [[debug mode|debug option]] allows to see the current UPS which can be used to estimate how long a tick currently takes.


* [[Lua/Game#tick|game time]]: measured in [[Game-tick]]s or [[Game-second]]s. This is very important.
== Seconds ==
* [[Lua/Game#speed|game speed factor]]: the factor that is used to multiply real time to achieve game time.
As stated above, there should always be 60 ticks in every second, so 1 in-game second equals 60 in-game ticks. The 60 to 1 ratio is also applied when the game runs at lower speeds, so an in-game second can take longer than a real-time second.


Real time and game time is normally equal, so the factor is normally 1. It can be changed using the [[Console commands|console]] and setting the variable [[Lua/Game#speed|game.speed]].
== Days ==
[[File:day_night_comparison.png|thumb|270px|right|Juxtaposition of day and night.]]


Game time may also be slowed if the game processing cannot keep up (e.g. 100% of CPU resources are being used). If the game cannot keep up with real time, then the game time automatically decreases to the needed amount, resulting in stuttering gameplay.
An in-game day on [[Nauvis]] lasts 25200 ticks or 7 in-game minutes.


=== See also ===
The light varies throughout the day in a cycle consisting of 4 phases:
{| class="wikitable"
! Phase Name !! Internal name !! Behaviour !! Time of day at start !! Time of day at end !! Duration (in ticks) || Duration (in seconds)
|-
|day || dawn ||fully light ||0.75 ||0.25 ||12600 ||210
|-
|sunset|| dusk ||darkening ||0.25 ||0.45 ||5040 ||84
|-
|night || evening ||fully dark ||0.45 ||0.55 ||2520 ||42
|-
|sunrise || morning ||lightening ||0.55 ||0.75 ||5040 ||84
|}


* [[Lua/Game#tick]]
  ------------- day -------><----- sunset ----->< night -><----- sunrise ----><-------- day ------------
* [[Game-tick]]
 
* [[Game-second]]
% 0    5    10  15  20  25  30  35  40  45  50  55  60  65  70  75  80  85  90  95  100
* [[Game-day]]
  |----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
* [[Units]]
 
During sunset, the light level decreases linearly from fully light to fully dark. During sunrise, it increases linearly from dark to light. This linear slope does not necessarily apply to the values returned by [https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.darkness LuaSurface.darkness]. During night time, [[player]]s will passively activate their flashlights (or headlights if in a [[vehicle]]), and placed [[lamp]]s will turn on automatically if powered.
 
Note: The actual time between phases can vary +/- a tick due to rounding errors.
 
{{C|Main}}

Latest revision as of 14:04, 28 October 2024

Clock hi res.png

The concept of Time in Factorio is used for many different implements, most notably crafting time and game time.

Crafting time and speed

When hovering over an item recipe, the player may see a clock symbol and a number. This is the amount of time needed to craft the item in seconds at crafting speed 1. The player always crafts at speed 1 while assembling machines have different crafting speeds. Modules may also affect crafting time, either speeding it up or slowing it down for some other benefit. The player, when handcrafting, crafts with a multiplier of 1, so items that claim to take 10 seconds to craft will take 10 seconds, but an assembling machine 1 with a multiplier of 0.5 will take 20 seconds. It is important to take this into consideration when creating setups with proper ratios.

Ticks

The base unit of all time inside Factorio. When running at game speed 1, there should always be 60 ticks in every real-time second leading to the figure of 60 updates per second, short UPS. This means that 1 tick should ideally always take 1/60th of a real-time second (0.01667 seconds). However, it is possible to change the game speed using mods or console commands, so it is possible that ticks don't take 0.01667 real-time seconds. Furthermore, game speed will automatically slow down when the computer that is running the game is unable to do all needed calculations in the wanted 0.01667 real-time seconds. The "show-fps" debug option allows to see the current UPS which can be used to estimate how long a tick currently takes.

Seconds

As stated above, there should always be 60 ticks in every second, so 1 in-game second equals 60 in-game ticks. The 60 to 1 ratio is also applied when the game runs at lower speeds, so an in-game second can take longer than a real-time second.

Days

Juxtaposition of day and night.

An in-game day on Nauvis lasts 25200 ticks or 7 in-game minutes.

The light varies throughout the day in a cycle consisting of 4 phases:

Phase Name Internal name Behaviour Time of day at start Time of day at end Duration (in ticks) Duration (in seconds)
day dawn fully light 0.75 0.25 12600 210
sunset dusk darkening 0.25 0.45 5040 84
night evening fully dark 0.45 0.55 2520 42
sunrise morning lightening 0.55 0.75 5040 84
  ------------- day -------><----- sunset ----->< night -><----- sunrise ----><-------- day ------------
  
% 0    5    10   15   20   25   30   35   40   45   50   55   60   65   70   75   80   85   90   95  100
  |----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|

During sunset, the light level decreases linearly from fully light to fully dark. During sunrise, it increases linearly from dark to light. This linear slope does not necessarily apply to the values returned by LuaSurface.darkness. During night time, players will passively activate their flashlights (or headlights if in a vehicle), and placed lamps will turn on automatically if powered.

Note: The actual time between phases can vary +/- a tick due to rounding errors.