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.

Editing Computing

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.

If you are creating a redirect to the current version's page, do not use any namespace. For example: use #REDIRECT [[Cat]], not #REDIRECT [[Main:Cat]] or #REDIRECT [[cv:Cat]]. See DF:Versions for more information.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{migrated article}}
+
{{Quality|Exceptional}}
{{Quality|Unrated}}
 
 
{{Computing}}
 
{{Computing}}
 
{{av}}
 
{{av}}
  
Computing in ''Dwarf Fortress'' is the practice of setting up complex constructions to perform logical operations and calculations; ideally, to control some functionality of your fortress. Even if it isn't a young concept anymore, there is still much room for improvement and development. One reason is that there are many ways to solve one problem. Innovation and invention are encouraged.
+
Computing in Dwarf Fortress is the practice of setting up complex constructions to perform logical operations and calculations; ideally, to control some functionality of your fortress. Even if it isn't a young concept anymore, there is still much room for improvement and development. One reason is that there are many ways to solve one problem. Innovation and invention are encouraged.
 
=== Binary information ===
 
=== Binary information ===
 
Binary information can have one of two possible states: true or false, respectively 1 or 0. In dwarf fortress they can be represented by different entities:
 
Binary information can have one of two possible states: true or false, respectively 1 or 0. In dwarf fortress they can be represented by different entities:
Line 14: Line 13:
 
* present [[minecart]]s on track
 
* present [[minecart]]s on track
  
Electronic devices and computers are based on this elementary form of information, and if you want to go into computing, you’ll have to familiarize yourself with it: [http://en.wikipedia.org/wiki/Propositional_calculus propositional calculus]
+
Electronic devices and computers base on this elementary form of information, and if you want to go into computing, you’ll have to familiarize yourself with it. [http://en.wikipedia.org/wiki/Propositional_calculus propositional calculus]
 
=== Input/Output ===
 
=== Input/Output ===
 
Input can be any device which can be linked to another device with mechanisms, such as [[lever|levers]] or [[pressure plate|pressure plates]]. Pressure plates can measure water or magma depth, or creature or minecart weight, and can be set to react to your own dwarves if measuring creature weight. If measuring water or magma you specify the minimum and maximum levels at which it should output 'on', and at all other levels it will output an 'off' signal. Regardless of the actual amount of water or magma or the exact weight of a creature or cart on your pressure plate, the plate can only output an 'on' or 'off' signal (1 or 0) to whatever devices it is linked to. So everything you build will have a binary base.
 
Input can be any device which can be linked to another device with mechanisms, such as [[lever|levers]] or [[pressure plate|pressure plates]]. Pressure plates can measure water or magma depth, or creature or minecart weight, and can be set to react to your own dwarves if measuring creature weight. If measuring water or magma you specify the minimum and maximum levels at which it should output 'on', and at all other levels it will output an 'off' signal. Regardless of the actual amount of water or magma or the exact weight of a creature or cart on your pressure plate, the plate can only output an 'on' or 'off' signal (1 or 0) to whatever devices it is linked to. So everything you build will have a binary base.
Line 24: Line 23:
 
According to input, output can be anything that is able to react to an on/off signal. This can be doors, bridges, floodgates allowing or stopping flow, gears controlling pumps and much more. In some special configurations - when [[mechanical logic]] is involved - output may not be an on/off signal but power, thus running or not running a machine component.
 
According to input, output can be anything that is able to react to an on/off signal. This can be doors, bridges, floodgates allowing or stopping flow, gears controlling pumps and much more. In some special configurations - when [[mechanical logic]] is involved - output may not be an on/off signal but power, thus running or not running a machine component.
  
Currently, to convert from power to an on/off signal, the only way is to use a kind of [[Mechanical_logic#Power_to_signal_converter|power to signal converter]]. This can be a screw pump connected to that power source, and a pressure plate to measure whether water is being pumped, or a minecart moved by a roller over a closed track with a pressure plate activated by its passage.
+
Currently to convert from power to an on/off signal, the only way is to use a kind of [[Mechanical_logic#Power_to_signal_converter|power to signal converter]]. This can be a screw pump connected to that power source, and a pressure plate to measure whether water is being pumped, or a minecart moved by a roller over a closed track with a pressure plate activated by its passage.
 
<!-- ...screw pump connected to that power source <s>with an unlimited amount of water and drainage at the output</s>, and a pressure plate to measure whether water is being pumped<s> out by the pump</s>. -->
 
<!-- ...screw pump connected to that power source <s>with an unlimited amount of water and drainage at the output</s>, and a pressure plate to measure whether water is being pumped<s> out by the pump</s>. -->
  
Line 32: Line 31:
  
 
=== Binary logic ===
 
=== Binary logic ===
Basic binary logic takes one or two input bits and creates an output based on them. The devices that perform these operations are commonly called '''logic gates'''.
+
Basic binary logic takes one or two input bits and creates an output based on them. The devices that perform these operations are commonly called '''logic gates'''.<br />
 
+
* NOT - takes one input and returns the opposite of the input<br /><br />
* NOT - takes one input and returns the opposite of the input
 
 
 
 
{| class="wikitable" border=1
 
{| class="wikitable" border=1
 
|-
 
|-
Line 46: Line 43:
 
| 1
 
| 1
 
| 0
 
| 0
|}
+
|}<br />
 
 
 
* AND - takes two inputs and returns true if both inputs are true
 
* AND - takes two inputs and returns true if both inputs are true
 
* OR - takes two inputs and returns true if at least one input is true
 
* OR - takes two inputs and returns true if at least one input is true
Line 53: Line 49:
 
* NAND - takes two inputs and returns true if either input is false
 
* NAND - takes two inputs and returns true if either input is false
 
* NOR - takes two inputs and returns true if both inputs are false
 
* NOR - takes two inputs and returns true if both inputs are false
* XNOR - takes two inputs and returns true if both inputs are identical
+
* XNOR - takes two inputs and returns true if both inputs are identical<br /><br />
 
 
 
{| class="wikitable" border=1
 
{| class="wikitable" border=1
 
|-
 
|-
Line 101: Line 96:
 
| 0
 
| 0
 
| 1
 
| 1
|}
+
|}<br />
 
 
 
The most human-understandable logic system requires NOT, AND and OR gates, but having a design for either a NAND or a NOR gate is enough to build any of the other gates. Some gates are easier to create or need fewer components than others depending on what discipline your logic relies on. Designing each individual gate that you will need (or using designs that had each individual gate designed) rather than building a gate out of multiple NAND gates or the like will generally result in your dorfputer reacting faster and using less resources (power, water, kittens, construction materials, what-have-you).
 
The most human-understandable logic system requires NOT, AND and OR gates, but having a design for either a NAND or a NOR gate is enough to build any of the other gates. Some gates are easier to create or need fewer components than others depending on what discipline your logic relies on. Designing each individual gate that you will need (or using designs that had each individual gate designed) rather than building a gate out of multiple NAND gates or the like will generally result in your dorfputer reacting faster and using less resources (power, water, kittens, construction materials, what-have-you).
  
Line 111: Line 105:
  
 
== Disciplines ==
 
== Disciplines ==
There are four main disciplines of dwarfputing, depending on what would drive the dwarfputer. Each of them has its assets and drawbacks.
+
There are 4 main disciplines of dwarfputing, depending on what would drive the dwarfputer. Each of them has its assets and drawbacks.
  
 
The four disciplines are:
 
The four disciplines are:
 
=== Fluid logic ===
 
=== Fluid logic ===
[[Fluid logic]] is controlling the ''flow of fluid'' over different pressure plates. Fluid logic can be easily constructed and every known logic gate in dwarf fortress has already been built with it. On the other hand, this discipline depends on a somehow unlimited source of the used fluid to deal with its [[evaporation]] and [[Water#Water in Fortress Mode|destruction]].
+
[[Fluid logic]] is controlling the ''flow of fluid'' over different pressure plates. Fluid logic can be easily constructed and every known logic gate in dwarf fortress has already been built with it. On the other hand this discipline depends on a somehow unlimited source of the used fluid to deal with its [[evaporation]] and [[Water#Water in Fortress Mode|destruction]].
  
 
=== Mechanical logic ===
 
=== Mechanical logic ===
[[Mechanical logic]] uses systems of axles and [[gear assembly|gear assemblies]] to build logical gates. Mechanical logic reacts very fast and can be easily constructed. Since every gear can itself be linked to a trigger (or multiple triggers), and automatically connects to adjacent gears for transferring either power or load, mechanical logic gates are very flexible and don't require anywhere near the number of different devices that tend to be used in fluid logic gates. On the negative side, this discipline uses a LOT of mechanical power and basic mechanic gates output no signals but power. If you need a signal as output, either to control signal-operated buildings like doors or bridges or to perform further logical operations, you will need power->signal converters.  There is, however, a fully functional fluid-preserving "rotation sensor" design. With the advent of [[Minecart]]s, compact fluid-less power->signal converters have become available, making [[Minecart logic]] an attractive alternative for deploying mechanical logic in your fortress. Along with advanced techniques to construct logic gates by "pre-toggling" a gear assembly (see [[Pre-Toggled Mechanical Logic]]), any logical circuit can be built, given enough space in the game to do it.  
+
[[Mechanical logic]] uses systems of axles and [[gear assembly|gear assemblies]] to build logical gates. Mechanical logic reacts very fast and can be easily constructed. Since every gear can itself be linked to a trigger (or multiple triggers), and automatically connects to adjacent gears for transferring either power or load, mechanical logic gates are very flexible and don't require anywhere near the number of different devices that tend to be used in fluid logic gates. On the negative side, this discipline uses a LOT of mechanical power and basic mechanic gates output no signals but power. If you need a signal as output, either to control signal-operated buildings like doors or bridges or to perform further logical operations, you will need power->signal converters.  There is, however, a fully functional fluid preserving "rotation sensor" design. With the advent of [[Minecart]]s, compact fluid-less power->signal converters have become available, making [[Minecart logic]] an attractive alternative for deploying mechanical logic in your fortress. Along with advanced techniques to construct logic gates by "pre-toggling" a gear assembly (see [[Pre-Toggled Mechanical Logic]]), any logical circuit can be built, given enough space in the game to do it.  
  
 
=== Creature logic ===
 
=== Creature logic ===
[[Creature logic]] uses pressure plates and constraints on creatures' movement through buildings such as doors and [[hatch cover|hatches]], in conjunction with their [[path]]ing behavior, to build logic gates.  Creature logic is very space intensive, but requires no power, fluid, or valuable materials.  Every kind of logical circuit can be built with creature logic.
+
[[Creature logic]] uses pressure plates and constraints on creatures' movement through buildings such as doors and [[hatch cover|hatches]], in conjunction with their [[path]]ing behavior, to build logical gates.  Creature logic is very space intensive, but requires no power, fluid, or valuable materials.  Every kind of logical circuit can built with creature logic.
  
[[Animal logic]] is a special kind of creature logic that relies on animals attempting to path through tightly closed doors. Animal logic circuits can be much more space-efficient than other forms of creature logic, but are somewhat unreliable.
+
[[Animal logic]] is a special kind of creature logic that relies on animals attempting to path through tightly closed doors. Animal logic circuits can be much more space efficient than other forms of creature logic, but are somewhat unreliable.
  
=== Minecart logic ===
+
=== Minecart Logic ===
[[Minecart logic]] involves the control of the paths of [[minecart]]s over pressure plates to build logical gates.  Minecart logic integrates easily with mechanical logic.  Power, perhaps surprisingly, is optional.  Minecart logic is complete and compact.  It lacks the brute speed of which mechanical circuits are capable, but minecart circuit design may be much simpler and more intuitive to some architects.
+
[[Minecart logic]] involves the control of the paths of [[minecart]]s over pressure plates to build logical gates.  Minecart integrates easily with mechanical logic.  Power, perhaps surprisingly, is optional.  Minecart logic is complete and compact.  It lacks the brute speed of which mechanical circuits are capable, but minecart circuit design may be much simpler and more intuitive to some architects.
  
 
===Examples of things you could do with logic gates===
 
===Examples of things you could do with logic gates===
Line 141: Line 135:
  
 
== Examples ==
 
== Examples ==
There are a few examples of a really useful dwarfputer and some concepts which have the potential to become useful for others. But in most cases, they are made just for fun. That's not to diminish their designers' achievements, because these are in general the more complex ones. At the moment there are no known examples of animal or borg logic.
+
There are few examples of a really useful dwarfputer and some concepts which have the potential to become useful for others. But in most cases they are made just for fun. What doesn't mean to diminish their designers achievements, because these are in general the more complex ones.<br />At the moment there are no known examples of animal or borg logic.
 
=== Useful ===
 
=== Useful ===
 
* Magma trap
 
* Magma trap
** This is an example of a useful dwarfputer controlling a magma trap. It automatically floods an area with lava, cleans up and resets afterwards. The timing is perfectly adjusted to let the victims vanish only leaving their valuable metal behind
+
** This is an example of a useful dwarfputer controlling a magma trap. It automatically floods an area with lava, cleans up and resets afterwards. The timing is perfectly adjusted to let the victims vanish only leaving their valuable metal behind.<br />video: http://mkv25.net/dfma/movie-1808-perfectmagmatrap<br />design: http://i576.photobucket.com/albums/ss208/kanddak/magmatrap.png
*** video: http://mkv25.net/dfma/movie-1808-perfectmagmatrap
 
*** design: http://i576.photobucket.com/albums/ss208/kanddak/magmatrap.png
 
  
 
=== Concepts ===
 
=== Concepts ===
Line 154: Line 146:
 
** mechanical logic, 6-bit: http://mkv25.net/dfma/movie-1561-addingmachine
 
** mechanical logic, 6-bit: http://mkv25.net/dfma/movie-1561-addingmachine
 
** fluid logic, 8-bit: http://mkv25.net/dfma/movie-1084-numberabbeydemonstration
 
** fluid logic, 8-bit: http://mkv25.net/dfma/movie-1084-numberabbeydemonstration
[[File:Armoc Invaders intro.png|thumb|right|200px|''[[User:BaronW#Armok_Invaders|Armok Invaders]], a playable game'']]
 
 
=== Such a doddle ===
 
=== Such a doddle ===
 
* decimal display for 4-bit binary input
 
* decimal display for 4-bit binary input
Line 162: Line 153:
 
* tic tac toe
 
* tic tac toe
 
** mechanical logic http://mkv25.net/dfma/movie-1813-tictactoev10simple
 
** mechanical logic http://mkv25.net/dfma/movie-1813-tictactoev10simple
* Armok Invaders
+
 
** mechanical & minecart logic: https://www.youtube.com/watch?v=j2cMHwo3nAU
 
  
 
== Related user pages ==
 
== Related user pages ==
*[[User:BaronW]] - The Almighty Dwarven Calculator and Armok Invaders
+
*[[User:BaronW]] - The Almighty Dwarven Calculator
 
*[[User:Jong/Dwarven_Computer]] - The first fully programmable digital Dwarven Computer
 
*[[User:Jong/Dwarven_Computer]] - The first fully programmable digital Dwarven Computer
 
*[[User:SL/Logic Gates]] - These use mechanisms for connecting gates and devices and so forth, but fluid for logic. They're built on top of a body of water, and require power (for a pump or two per gate).
 
*[[User:SL/Logic Gates]] - These use mechanisms for connecting gates and devices and so forth, but fluid for logic. They're built on top of a body of water, and require power (for a pump or two per gate).
 
*[[User:Kyace/Adder]] - A full adder built using fluid logic, with a video of a rough prototype. Trivial to combine 8 of these to make a fluid device capable of adding two 8 bit numbers together.
 
*[[User:Kyace/Adder]] - A full adder built using fluid logic, with a video of a rough prototype. Trivial to combine 8 of these to make a fluid device capable of adding two 8 bit numbers together.
*[[User:Soundandfury#Logic_Gates]] - These have a water supply reservoir above and a drain below.  The drained water can be pumped back into the supply reservoir.
+
*[[User:Soundandfury#Logic_Gates]] - These have a water supply reservoir above and a drain below.  The drained water can be pumped back to the supply reservoir.
 
*[[User:Bidok]] - Animal logic with all gates, memory, repeater and counter. All powered by kittens.
 
*[[User:Bidok]] - Animal logic with all gates, memory, repeater and counter. All powered by kittens.
*[[User:LordOOTFD#Animal_Logic]] - Animal logic with fast complex gates, building upon Bidok's kitten-powered systems.
+
*[[User:LordOOTFD#Animal_Logic]] - Animal logic with fast complex gates, building upon Bidok's kitten powered systems.
 
*[[User:Hussell#Assorted_Devices]] - Fluid logic
 
*[[User:Hussell#Assorted_Devices]] - Fluid logic
 
*[[User:Gammon]] - Fluid logic. Very detailed CMOS gates.
 
*[[User:Gammon]] - Fluid logic. Very detailed CMOS gates.
Line 178: Line 168:
 
*[[User:Vasiln/Goblin Logic 1]] - Theory and practice of invader-based creature logic.
 
*[[User:Vasiln/Goblin Logic 1]] - Theory and practice of invader-based creature logic.
 
*[[User:Larix]] - Various engineering projects, including the second fully programmable Dwarven Computer (arguably the first capable of autonomous execution) and a thorough treatment of logic based on moving minecarts.
 
*[[User:Larix]] - Various engineering projects, including the second fully programmable Dwarven Computer (arguably the first capable of autonomous execution) and a thorough treatment of logic based on moving minecarts.
*[[User:Gnidan]] - Minecart routing system, to move goods point-to-point using shared track
+
 
 +
{{buildings}}
 
{{Category|Computing}}
 
{{Category|Computing}}
[[ru:Computing]]
 

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

This page is a member of 1 hidden category: