v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "v0.34:Time"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
Line 11: Line 11:
  
 
== Applied mechanics ==
 
== Applied mechanics ==
=== Creatures ===
+
=== Creature movement ===
 
The amount of time it takes a [[creature]] to move, fight, or interact is at its root directly proportional to its [[speed]]. There is a {{tt|[SPEED:#]}} [[creature token]] in the creature [[raw file]]s that handles a creature's speed on land, and a separate {{tt|[SWIM_SPEED:#]}} token that does the same in water; this is then plugged into the formula 1000/(100 + {{tt|[SPEED]}}) to give the creature's adjusted speed. This means that lower speed values are actually better: the default speed on land is 900, the default [[swimming]] speed is 2500, and the default {{tt|[AQUATIC]}} swimming speed is 500.
 
The amount of time it takes a [[creature]] to move, fight, or interact is at its root directly proportional to its [[speed]]. There is a {{tt|[SPEED:#]}} [[creature token]] in the creature [[raw file]]s that handles a creature's speed on land, and a separate {{tt|[SWIM_SPEED:#]}} token that does the same in water; this is then plugged into the formula 1000/(100 + {{tt|[SPEED]}}) to give the creature's adjusted speed. This means that lower speed values are actually better: the default speed on land is 900, the default [[swimming]] speed is 2500, and the default {{tt|[AQUATIC]}} swimming speed is 500.
  
Line 18: Line 18:
 
In the case of fractional numbers, the last two digits (the remainder) will represent the chance out of a hundred that a creature will get to move after waiting out its basal period. So a creature whose speed is set to 975 will wait five ticks, then have a one in four chance of getting to move; if it fails this check, it must wait a further tick (because of their low base [[agility]], 975 is statistically where most dwarves fall). Thus the way speed is implemented its name is a bit of a misnomer: it is more of a turn delay. The entire formula put together, which is what the game uses internally, will tell you how many times per ten ticks a creature gets to move; it is probably implemented the way it is to allow fractional movement chances while preventing creatures from moving faster than once per tick, which is technically impossible.
 
In the case of fractional numbers, the last two digits (the remainder) will represent the chance out of a hundred that a creature will get to move after waiting out its basal period. So a creature whose speed is set to 975 will wait five ticks, then have a one in four chance of getting to move; if it fails this check, it must wait a further tick (because of their low base [[agility]], 975 is statistically where most dwarves fall). Thus the way speed is implemented its name is a bit of a misnomer: it is more of a turn delay. The entire formula put together, which is what the game uses internally, will tell you how many times per ten ticks a creature gets to move; it is probably implemented the way it is to allow fractional movement chances while preventing creatures from moving faster than once per tick, which is technically impossible.
  
This base speed is then modified by two [[Attributes#Body Attributes|physical attributes]], agility and strength, to which it is inversely proportional. A creature with maximum agility and strength attributes can move around three times faster than a creature with minimum stats. Agility and strength are trained by various physical-type tasks, which means that your [[military|soldiers]] can probably significantly faster than your [[bookkeeper]].
+
This base speed is then modified by two [[Attributes#Body Attributes|physical attributes]], agility and strength, to which it is inversely proportional. A creature with maximum agility and strength attributes can move around three times faster than a creature with minimum stats. Agility and strength are trained by various physical-type tasks, which means that your [[military|soldiers]] can probably significantly faster than your [[bookkeeper]]. These properties are multiplicative, so their relative effect decreases to nothing as the creature's basal speed approaches zero.
  
 
All creatures with default speed, regardless of their strength or agility, take between 5 and 16 ticks per orthogonal tile traveled. Diagonal tile travel times are 362/256 times that amount, so they take between 8 and 23 time units for creatures with default speed. Median dwarves take approximately 10.5 time units and 14.9 time units to travel orthogonally or diagonally respectively.
 
All creatures with default speed, regardless of their strength or agility, take between 5 and 16 ticks per orthogonal tile traveled. Diagonal tile travel times are 362/256 times that amount, so they take between 8 and 23 time units for creatures with default speed. Median dwarves take approximately 10.5 time units and 14.9 time units to travel orthogonally or diagonally respectively.
Line 24: Line 24:
 
400 is the fastest speed that you will see in the wild without modding; creatures this fast will move at twice the speed of your dwarves.
 
400 is the fastest speed that you will see in the wild without modding; creatures this fast will move at twice the speed of your dwarves.
  
=== Syndromes ===
+
=== Syndrome effects ===
 
[[Syndrome]] effects are defined by [[Syndrome#Creature effect tokens|creature effect tokens]], which use ticks as a basal unit. An example token would be {{tt|[CE_NECROSIS:SEV:300:PROB:100:LOCALIZED:VASCULAR_ONLY:RESISTABLE:START:50:PEAK:1000:END:2000]|As interpreted by the game, this syndrome will causes infallible but resistible mild targeted necrosis of vascular tissue.}}, of which the {{tt|START:50:PEAK:1000:END:2000}} end-line defines the timeline of the syndrome's effects. On a timer, {{tt|START}} tells you how many ticks will pass before the poison starts to take effect, {{tt|PEAK}} will tell you when it will peak, and {{tt|END}} will tell you after how many ticks it will end. A syndrome that lists its effect as starting at "5" means that for all but the [[Elf|fastest characters]], you will begin feeling the effects as soon as you take a step. "50" means 50 time units (or about five steps), and "500" reliably suggests that you'll be able to stagger all the way back to the hospital before your [[Giant desert scorpion|brain starts pouring out of your ears]]. Syndrome effects are stacked, and can cause short-term, medium-term, ''and'' long-term damage; for specifics see [[Syndrome]].
 
[[Syndrome]] effects are defined by [[Syndrome#Creature effect tokens|creature effect tokens]], which use ticks as a basal unit. An example token would be {{tt|[CE_NECROSIS:SEV:300:PROB:100:LOCALIZED:VASCULAR_ONLY:RESISTABLE:START:50:PEAK:1000:END:2000]|As interpreted by the game, this syndrome will causes infallible but resistible mild targeted necrosis of vascular tissue.}}, of which the {{tt|START:50:PEAK:1000:END:2000}} end-line defines the timeline of the syndrome's effects. On a timer, {{tt|START}} tells you how many ticks will pass before the poison starts to take effect, {{tt|PEAK}} will tell you when it will peak, and {{tt|END}} will tell you after how many ticks it will end. A syndrome that lists its effect as starting at "5" means that for all but the [[Elf|fastest characters]], you will begin feeling the effects as soon as you take a step. "50" means 50 time units (or about five steps), and "500" reliably suggests that you'll be able to stagger all the way back to the hospital before your [[Giant desert scorpion|brain starts pouring out of your ears]]. Syndrome effects are stacked, and can cause short-term, medium-term, ''and'' long-term damage; for specifics see [[Syndrome]].
  
=== Plants ===
+
=== Plant growth ===
 
Plants use a {{tt|[GROWDUR:#]}} [[plant token]] to constrain their growth times. Each {{tt|GROWDUR}} unit (short for "grow duration) is equivalent to a hundred ticks. The default value is 300 and it is usually set to 300 or 500 (30000 or 50000 ticks) for [[crop]]s; there are 1008 {{tt|GROWDUR}} units per [[calendar|season]].
 
Plants use a {{tt|[GROWDUR:#]}} [[plant token]] to constrain their growth times. Each {{tt|GROWDUR}} unit (short for "grow duration) is equivalent to a hundred ticks. The default value is 300 and it is usually set to 300 or 500 (30000 or 50000 ticks) for [[crop]]s; there are 1008 {{tt|GROWDUR}} units per [[calendar|season]].
  
=== Hives ===
+
=== Hive harvesting time ===
 
[[Vermin]] in [[hive]]s which produce items  (currently only [[honey bee]]s, which produce [[honeycomb]]s and [[royal jelly]]) have the {{tt|HIVE_PRODUCT:#:#:I...}} [[creature token]]. The first variable is the number of the item produced, the second is the time in ticks that it takes for the item to be produced, and the third is an [[item token]] for the item produced. When multiple products are expected, multiple such tokens are used.
 
[[Vermin]] in [[hive]]s which produce items  (currently only [[honey bee]]s, which produce [[honeycomb]]s and [[royal jelly]]) have the {{tt|HIVE_PRODUCT:#:#:I...}} [[creature token]]. The first variable is the number of the item produced, the second is the time in ticks that it takes for the item to be produced, and the third is an [[item token]] for the item produced. When multiple products are expected, multiple such tokens are used.
  
=== Lifespan and Development ===
+
=== Aging and lifespan ===
 
See [[Age]].
 
See [[Age]].
  

Revision as of 05:53, 13 July 2013

This article is about an older version of DF.

Time is an integral part of any simulation, none the least in a simulation as complex as Dwarf Fortress. Time is measured internally in unnamed units, commonly dubbed "ticks" by the community. Each tick represents one step in the Dwarf Fortress program, requiring calculations related to unit movement, fluid movement, temperature transfer, various event checks, combat checks, pathing checks, job changes, experience ticks - basically everything required to run the program, broken up between individual lumps of time. These ticks are then bundled up against days, months, seasons, and then years under the dwarven calendar, which are then further engrossed within individual, context-sensitive ages. For a discussion on the greater passage of time, see Calendar; this page is focused on the lower-level, "unit-based", in-game passage of time.

Basic mechanics

How much a tick in time is worth against the yearly dwarven calendar depends on the game mode, as time in fortress mode is much more heavily accelerated than it is in adventurer mode. Fortress mode counts 1200 ticks per day and 403200 per year, while adventurer mode counts 86400 ticks to a day and therefore 29030400 ticks per year. According to these rates, each tick is equivalent to a real-world second in adventurer mode, but 1.2 minutes in fortress mode, making adventurers 72 times faster than your dwarves tick-for-tick. This is intended behavior, as the pacing in fortress mode is much, much faster than when adventuring.

How quickly time appears to pass in your game, especially in fortress mode, has as much to do with your hardware as with the number of ticks in a year. The number of frames per second is a direct reflection of how many ticks a second your processor is working through. This should be distinguished from the frame refresh rate, which is how many frames appear on your screen per second - since there's a limit to how many frame changes the human eye can see, there's not much purpose to displaying every single one of them on-screen. You can set your FPS to be visible by changing [FPS:NO] to [FPS:YES] in your Init.txt file, which will display two numbers in the top-right corner of your game window, the first being the frames per second and the second being the refresh rate. By default the framerate is capped at 100 FPS, but this setting can be changed or even removed: see Frames per second#Controlling FPS for a technical discussion. For tips on maximizing framerate, see the (topically named) Maximizing framerate article.

Dwarf Fortress is an extremely processor-intensive game, and so how many frames you actually get per second will depend on the strength of your machine, how far into the game and how clutter there is in it, whether or not you are not taking any fps-saving measures, what mods or other programs you are running, and so on. Regardless of mode, there are 28 days in a month and 12 months in a year. Assuming an FPS of 100, not counting pauses an hour of fortress mode gameplay will translate into a year in-game.

Applied mechanics

Creature movement

The amount of time it takes a creature to move, fight, or interact is at its root directly proportional to its speed. There is a [SPEED:#] creature token in the creature raw files that handles a creature's speed on land, and a separate [SWIM_SPEED:#] token that does the same in water; this is then plugged into the formula 1000/(100 + [SPEED]) to give the creature's adjusted speed. This means that lower speed values are actually better: the default speed on land is 900, the default swimming speed is 2500, and the default [AQUATIC] swimming speed is 500.

No (unmodded) creature in the game gets to move every tick: indeed, an average creatures moves only once every ten ticks. To make this easier to understand, you should think about a creature's defined speed in terms of the mod x operator, which shears off the last x digits of a number: for instance, 926 mod 1 would give you 920. A creature's default speed is modded by two by the game to arrive at the number of ticks a creature must wait before it can move. Thus a creature with the default speed of 900 must wait nine ticks before it can move, and then must wait nine ticks more; a creature with a speed set to 500 would have to wait only five before it can spend a tick moving. A speed of 0 will result in a creature moving every tick.

In the case of fractional numbers, the last two digits (the remainder) will represent the chance out of a hundred that a creature will get to move after waiting out its basal period. So a creature whose speed is set to 975 will wait five ticks, then have a one in four chance of getting to move; if it fails this check, it must wait a further tick (because of their low base agility, 975 is statistically where most dwarves fall). Thus the way speed is implemented its name is a bit of a misnomer: it is more of a turn delay. The entire formula put together, which is what the game uses internally, will tell you how many times per ten ticks a creature gets to move; it is probably implemented the way it is to allow fractional movement chances while preventing creatures from moving faster than once per tick, which is technically impossible.

This base speed is then modified by two physical attributes, agility and strength, to which it is inversely proportional. A creature with maximum agility and strength attributes can move around three times faster than a creature with minimum stats. Agility and strength are trained by various physical-type tasks, which means that your soldiers can probably significantly faster than your bookkeeper. These properties are multiplicative, so their relative effect decreases to nothing as the creature's basal speed approaches zero.

All creatures with default speed, regardless of their strength or agility, take between 5 and 16 ticks per orthogonal tile traveled. Diagonal tile travel times are 362/256 times that amount, so they take between 8 and 23 time units for creatures with default speed. Median dwarves take approximately 10.5 time units and 14.9 time units to travel orthogonally or diagonally respectively.

400 is the fastest speed that you will see in the wild without modding; creatures this fast will move at twice the speed of your dwarves.

Syndrome effects

Syndrome effects are defined by creature effect tokens, which use ticks as a basal unit. An example token would be [CE_NECROSIS:SEV:300:PROB:100:LOCALIZED:VASCULAR_ONLY:RESISTABLE:START:50:PEAK:1000:END:2000], of which the START:50:PEAK:1000:END:2000 end-line defines the timeline of the syndrome's effects. On a timer, START tells you how many ticks will pass before the poison starts to take effect, PEAK will tell you when it will peak, and END will tell you after how many ticks it will end. A syndrome that lists its effect as starting at "5" means that for all but the fastest characters, you will begin feeling the effects as soon as you take a step. "50" means 50 time units (or about five steps), and "500" reliably suggests that you'll be able to stagger all the way back to the hospital before your brain starts pouring out of your ears. Syndrome effects are stacked, and can cause short-term, medium-term, and long-term damage; for specifics see Syndrome.

Plant growth

Plants use a [GROWDUR:#] plant token to constrain their growth times. Each GROWDUR unit (short for "grow duration) is equivalent to a hundred ticks. The default value is 300 and it is usually set to 300 or 500 (30000 or 50000 ticks) for crops; there are 1008 GROWDUR units per season.

Hive harvesting time

Vermin in hives which produce items (currently only honey bees, which produce honeycombs and royal jelly) have the HIVE_PRODUCT:#:#:I... creature token. The first variable is the number of the item produced, the second is the time in ticks that it takes for the item to be produced, and the third is an item token for the item produced. When multiple products are expected, multiple such tokens are used.

Aging and lifespan

See Age.

Clocks

Based on the fact that pressure plates take 100 steps to reset, some people have built various time-keeping devices to do various things around the fort, like flooding a trap once a month, or just for fun.