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 "40d:Computing"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Fixing links within namespace (188/997))
Line 8: Line 8:
 
=== 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:
* on/off state or signal of a [[40d:trigger|trigger]]
+
* on/off state or signal of a {{L|trigger}}
* power or connection state of a [[40d:machine component|machine component]]
+
* power or connection state of a {{L|machine component}}
* open or closed state of a [[40d:door|door]] or similar buildings
+
* open or closed state of a {{L|door}} or similar buildings
* [[40d:pressure plate|low/high]] or [[40d:flow|flowing/standing]] [[40d:water|fluid]]
+
* {{L|pressure plate|low/high}} or {{L|flow|flowing/standing}} {{L|water|fluid}}
* present [[40d:creature|creature]]s and [[40d:dwarf|borgs]]
+
* present {{L|creature}}s and {{L|dwarf|borgs}}
 
* ...
 
* ...
 
Electronic devices and computers base on this elementary form of information, and if you want to go into computing, you’ll have to familiarize 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 with it. [http://en.wikipedia.org/wiki/Propositional_calculus propositional calculus]
 
=== Input/Output ===
 
=== Input/Output ===
Input can be any trigger - [[40d:lever|lever]] or [[40d:pressure plate|pressure plate]]. Typically your dwarfs are pulling levers, creatures are walking over your pressure plates, or fluid is covering those plates to initiate computing. The bottom line is you'll always have levers, pressure plates, or a combination of both sending binary signals: on/off.<br />
+
Input can be any trigger - {{L|lever}} or {{L|pressure plate}}. Typically your dwarfs are pulling levers, creatures are walking over your pressure plates, or fluid is covering those plates to initiate computing. The bottom line is you'll always have levers, pressure plates, or a combination of both sending binary signals: on/off.<br />
Note: Although [[40d:pressure plates|pressure plates]] can be constructed to trigger at different fluid levels, the output will always be just a binary on/off. So everything you build will have a binary base.<br />
+
Note: Although {{L|pressure plates}} can be constructed to trigger at different fluid levels, the output will always be just a binary on/off. So everything you build will have a binary base.<br />
 
<br />
 
<br />
 
Input elements
 
Input elements
* manual: [[40d:lever|lever]] -> binary on/off signal
+
* manual: {{L|lever}} -> binary on/off signal
* triggered: [[40d:pressure plate|pressure plate]] -> binary on/off signal
+
* triggered: {{L|pressure plate}} -> binary on/off signal
  
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. Just refer to the [[40d:lever#On/Off states|lever]] page for a detailed list. Independent of what you finally want to control with your dwarfputer, there are always pressure plates generating this signal. In some special configurations - when [[40d:mechanical logic|mechanical logic]] is involved - output may not be a on/off signal but power, thus running or not running a machine component.<br />
+
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. Just refer to the {{L|lever#On/Off states|lever}} page for a detailed list. Independent of what you finally want to control with your dwarfputer, there are always pressure plates generating this signal. In some special configurations - when {{L|mechanical logic}} is involved - output may not be a on/off signal but power, thus running or not running a machine component.<br />
 
<br />
 
<br />
 
Output elements
 
Output elements
* signal: [[40d:pressure plate|pressure plate]] -> binary on/off signal -> linkable Object(s)
+
* signal: {{L|pressure plate}} -> binary on/off signal -> linkable Object(s)
* power: [[40d:gear assembly|gear assembly]] -> binary power on/power off -> machine
+
* power: {{L|gear assembly}} -> binary power on/power off -> machine
  
 
=== Binary logic ===
 
=== Binary logic ===
Line 98: Line 98:
 
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.
 
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.
 
=== Complex gates ===
 
=== Complex gates ===
* [[40d:Latch|Latch]] - storing and reading a single binary value
+
* {{L|Latch}} - storing and reading a single binary value
* [[40d:Repeater|Repeater]] - sending a repeating signal
+
* {{L|Repeater}} - sending a repeating signal
* [[40d:Counter|Counter]]/[[40d:Adder|Adder]] - binary calculation
+
* {{L|Counter}}/{{L|Adder}} - binary calculation
 
== Disciplines ==
 
== Disciplines ==
 
There are 4 main disciplines of dwarfputing, depending on what will drive the dwarfputer. Each of them has its assets and drawbacks.  
 
There are 4 main disciplines of dwarfputing, depending on what will drive the dwarfputer. Each of them has its assets and drawbacks.  
 
=== Fluid logic ===
 
=== Fluid logic ===
[[40d: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 [[40d:evaporation|evaporation]] and [[40d:Water#Water_in_Fortress_Mode|destruction]].
+
{{L|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 {{L|evaporation}} and {{L|Water#Water_in_Fortress_Mode|destruction}}.
 
=== Mechanical logic ===
 
=== Mechanical logic ===
[[40d:Mechanical logic|Mechanical logic]] uses systems of axles and [[40d:gear assemblies|gear assemblies]] to build logical gates. Mechanical logic reacts very fast and can be easily constructed. Especially the feature of gears to toggle on every signal instead of reacting different to on/off signals makes mechanical logic gates very flexible. On the other hand this discipline depends on much mechanical power. And because of the lack of some kind of rotation sensor, you will generally need a pump, a pressure plate and any fluid to convert power into on/off signals.
+
{{L|Mechanical logic}} uses systems of axles and {{L|gear assemblies}} to build logical gates. Mechanical logic reacts very fast and can be easily constructed. Especially the feature of gears to toggle on every signal instead of reacting different to on/off signals makes mechanical logic gates very flexible. On the other hand this discipline depends on much mechanical power. And because of the lack of some kind of rotation sensor, you will generally need a pump, a pressure plate and any fluid to convert power into on/off signals.
 
=== Borg logic ===
 
=== Borg logic ===
[[40d:Borg logic|Borg logic]] controlling the path of your dwarves to direct them over pressure plates. They will be driven by constant hauling jobs or military designations. Pressure plates are used in similar setups to those in the fluid logic method. It is theorized that Borg logic would be quicker and easier to set up than fluid logic, although it would require a very large population dedicated to nothing but borging. The tendency of dwarves to eat, sleep, drink, makes this discipline quite unreliable. There are no known examples of borg logic, and it is purely theoretical at this time. Maybe the discovery of [[40d:one-way|one-way]] ramps will push its development.
+
{{L|Borg logic}} controlling the path of your dwarves to direct them over pressure plates. They will be driven by constant hauling jobs or military designations. Pressure plates are used in similar setups to those in the fluid logic method. It is theorized that Borg logic would be quicker and easier to set up than fluid logic, although it would require a very large population dedicated to nothing but borging. The tendency of dwarves to eat, sleep, drink, makes this discipline quite unreliable. There are no known examples of borg logic, and it is purely theoretical at this time. Maybe the discovery of {{L|one-way}} ramps will push its development.
 
=== Animal logic ===
 
=== Animal logic ===
[[40d:Animal logic|Animal logic]] is like borg logic but uses animals or captured hostiles to trigger pressure plates. Animals have a natural 'follow the leader' tendency and never starve. Hostiles will always target your dwarves and will also need no food or sleep.
+
{{L|Animal logic}} is like borg logic but uses animals or captured hostiles to trigger pressure plates. Animals have a natural 'follow the leader' tendency and never starve. Hostiles will always target your dwarves and will also need no food or sleep.
 
== Examples ==
 
== Examples ==
 
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.
 
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.
Line 132: Line 132:
  
 
== See Also ==
 
== See Also ==
* [[40d:Animal logic|Animal logic]]
+
* {{L|Animal logic}}
* [[40d:Fluid logic|Fluid logic]]
+
* {{L|Fluid logic}}
* [[40d:Mechanical logic|Mechanical logic]]
+
* {{L|Mechanical logic}}
* [[40d:Repeater|Repeater]]
+
* {{L|Repeater}}
  
 
== Related user pages ==
 
== Related user pages ==

Revision as of 16:37, 12 April 2010

Template:Human

This article is about an older version of DF.

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, or such a doddle. Even if it isn't a young concept anymore, there is still lots of room for improvement and development. One reason is that there are many ways to solve one problem. Innovation and invention is encouraged.

General

Concepts of computing in dwarf fortress are far away from what you can call a programmable computer. Even though all necessary components are proven to exist, a construction working like a real computer may be too complex to be built in dwarf fortress. Nevertheless, early computing machines and electronic devices are comparably simple. These concepts can be easily transferred into dwarf fortress. So dwarfputing is more or less a kind of electronics, casting logic in hardware.

Basics

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:

Electronic devices and computers base on this elementary form of information, and if you want to go into computing, you’ll have to familiarize with it. propositional calculus

Input/Output

Input can be any trigger - Template:L or Template:L. Typically your dwarfs are pulling levers, creatures are walking over your pressure plates, or fluid is covering those plates to initiate computing. The bottom line is you'll always have levers, pressure plates, or a combination of both sending binary signals: on/off.
Note: Although Template:L can be constructed to trigger at different fluid levels, the output will always be just a binary on/off. So everything you build will have a binary base.

Input elements

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. Just refer to the Template:L page for a detailed list. Independent of what you finally want to control with your dwarfputer, there are always pressure plates generating this signal. In some special configurations - when Template:L is involved - output may not be a on/off signal but power, thus running or not running a machine component.

Output elements

  • signal: Template:L -> binary on/off signal -> linkable Object(s)
  • power: Template:L -> binary power on/power off -> machine

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.

  • NOT - takes one input and returns the opposite of the input

input A NOT
0 1
1 0


  • 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
  • XOR - takes two inputs and returns true if exactly one input is true
  • NAND - takes two inputs and returns true if either input is false
  • NOR - takes two inputs and returns true if both inputs are false
  • NXOR - takes two inputs and returns true if both inputs are identical

input A input B AND OR XOR NAND NOR NXOR
0 0 0 0 0 1 1 1
0 1 0 1 1 1 0 0
1 0 0 1 1 1 0 0
1 1 1 1 0 0 0 1


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.

Complex gates

Disciplines

There are 4 main disciplines of dwarfputing, depending on what will drive the dwarfputer. Each of them has its assets and drawbacks.

Fluid logic

Template:L 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 Template:L and Template:L.

Mechanical logic

Template:L uses systems of axles and Template:L to build logical gates. Mechanical logic reacts very fast and can be easily constructed. Especially the feature of gears to toggle on every signal instead of reacting different to on/off signals makes mechanical logic gates very flexible. On the other hand this discipline depends on much mechanical power. And because of the lack of some kind of rotation sensor, you will generally need a pump, a pressure plate and any fluid to convert power into on/off signals.

Borg logic

Template:L controlling the path of your dwarves to direct them over pressure plates. They will be driven by constant hauling jobs or military designations. Pressure plates are used in similar setups to those in the fluid logic method. It is theorized that Borg logic would be quicker and easier to set up than fluid logic, although it would require a very large population dedicated to nothing but borging. The tendency of dwarves to eat, sleep, drink, makes this discipline quite unreliable. There are no known examples of borg logic, and it is purely theoretical at this time. Maybe the discovery of Template:L ramps will push its development.

Animal logic

Template:L is like borg logic but uses animals or captured hostiles to trigger pressure plates. Animals have a natural 'follow the leader' tendency and never starve. Hostiles will always target your dwarves and will also need no food or sleep.

Examples

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.
At the moment there are no known examples of animal or borg logic.

Useful

Concepts

Such a doddle

See Also

Related user pages

User:BaronW - A Full calculator

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: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:LordOOTFD#Animal_Logic - Animal logic with fast complex gates, building upon Bidok's kitten powered systems.

User:Hussell#Assorted_Devices - Fluid logic

User:Gammon - Fluid logic. Very detailed CMOS gates.