- 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.
40d:Computing
Computing in dwarf fortress is the practice of setting up your fortress in such a way that allows logical operations like AND, OR, NOT, and etc to exist and be used. Computing in Dwarf Fortress is a very young concept with lots of room for improvement and development. Innovation and invention is encouraged.
Basics
Binary logic takes one or two inputs and creates an output based on them. The devices that perform these operations are commonly called logic gates.
NOT takes one input and returns true if that input is false
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
A B AND OR XOR NAND NOR 0 0 0 0 0 1 1 0 1 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 1 0 0 0
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 ports.
Additionally, two-dimensional logic design requires a 'jumper' gate that crosses two signals without affecting their contents. This may only be an issue in DF if you are considering magma-based circuits.
Fluid Logic
Fluid logic utilizes the tendency of fluids in dwarf fortress to, umm, flow. It takes advantage of the ability of pressure plates in the new version to be triggered by water (or magma) resting on top of them. This allows systems of pumps, floodgates, doors, bridges, and anything else operated by pressure plate to be incorporated into a machine.
To get you started, a pressure plate set to trigger on water level 0-3 and linked to a floodgate will CLOSE the floodgate when the tile has deep water. If the pressure plate is set for water level 4-7, then the floodgate will OPEN when the tile has deep water.
Fluid logic allows for computing in up to base 8.
A simple, practical application of fluid logic is a Lever inverter.
Machine Logic
See mechanical logic
Borg Logic
Borg logic is the experimental version of fluid logic. It consists of creating a way for your dwarves to travel constantly in a predictable way through your fortress through 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 consequences of dwarves quitting to eat, sleep, drink, etc are unknown. There are no known examples of borg logic, and it is purely theoretical at this time.
Note: Borg Logic may be a bit more difficult, or impossible, in early versions due to a bug in 33c (and possibly earlier versions): The 'citizens trigger' setting on pressure plates does not actually cause the pressure plate to trigger when citizens step on it. This has been fixed, though.
Animal Logic
Animals have a natural 'follow the leader' tendency and never starve. Pitting an animal into a maze with movable exits can force the animal to shuttle around and compute.
Hostiles are also suitable for this purpose, and may be easier to control since they will target dwarves. [1]
One-way pathing
Currentlyv0.28.181.40d, due to what seems to be a minor bug rather than a feature, it's not only possible but quite easy to create one-way gates with ramps, leading to any restricted path you can create from one controlled access point to another, or more than one (of either). The usefulness of this in computing is up to your ingenuity.
See Also
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.
Rooms | |
---|---|
Furniture |
Animal trap • Anvil • Armor stand • Bed • Bin • Bucket • Cabinet • Cage • Coffin • Container • Restraint • Seat • Statue • Table • Weapon rack |
Access | |
Constructions | |
Machine & Trap parts |
Axle • Gear assembly • Millstone • Screw pump • Water wheel • Windmill • Lever • Pressure plate • Trap • Support |
Other Buildings | |
Related Articles |