- 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.
User:Gammon
Fluid logic[edit]
Disclaimer: This is my personal work on the topic, and felt inclined to share it after reading about the same topic on DF Wiki. Use this information for your own works on the matter.
Fluid logic is a form of computing which uses a fluid (generally water) controlled by various means, to trigger pressure plates and hopefully accomplish some desirable result.
Gates[edit]
Water sources are placed above the first piece to maximize water pressure. In the case of XOR & XAND the source will be placed above the shaft in front of the pieces. Drainage must be available to all pieces. The colors are useful for determining which input has what output connected to it; feel free to use notes here as well.
The first image under each gate is the bottom level of that gate. Note that under the end piece of each double length bridge is a channel; The end piece of each bridge is closest to the plate.
Note that between AND & NAND and every other similar pair it is the pressure plate water settings which determines its output. This is the only way in which they differ.
AND[edit]
≈
|
≈
|
≈
|
║
|
.
|
║
|
║
|
╬
|
║
|
║
|
.
|
║
|
║
|
╬
|
║
|
╚
|
═
|
╝
|
╔
|
═
|
╗
|
║
|
X
|
║
|
║
|
.
|
║
|
║
|
X
|
║
|
║
|
.
|
║
|
║
|
^
|
║
|
╚
|
═
|
╝
|
OR[edit]
╔
|
═
|
╗
|
║
|
╥
|
║
|
║
|
╨
|
║
|
║
|
╥
|
║
|
║
|
╨
|
║
|
║
|
^
|
║
|
╚
|
═
|
╝
|
NOT, INVERTER[edit]
╔
|
═
|
╗
|
║
|
╥
|
║
|
║
|
╨
|
║
|
║
|
^
|
║
|
╚
|
═
|
╝
|
NAND[edit]
≈
|
≈
|
≈
|
║
|
.
|
║
|
║
|
╬
|
║
|
║
|
.
|
║
|
║
|
╬
|
║
|
╚
|
═
|
╝
|
╔
|
═
|
╗
|
║
|
X
|
║
|
║
|
.
|
║
|
║
|
X
|
║
|
║
|
.
|
║
|
║
|
^
|
║
|
╚
|
═
|
╝
|
NOR[edit]
╔
|
═
|
╗
|
║
|
╥
|
║
|
║
|
╨
|
║
|
║
|
╥
|
║
|
║
|
╨
|
║
|
║
|
^
|
║
|
╚
|
═
|
╝
|
XOR[edit]
≈
|
≈
|
≈
|
║
|
.
|
║
|
║
|
╬
|
║
|
║
|
.
|
║
|
║
|
╬
|
║
|
╚
|
═
|
╝
|
╔
|
═
|
╗
|
║
|
+
|
║
|
║
|
X
|
║
|
║
|
.
|
║
|
║
|
X
|
║
|
║
|
.
|
║
|
║
|
^
|
║
|
╚
|
═
|
╝
|
╔
|
═
|
╗
|
║
|
.
|
║
|
║
|
╥
|
║
|
║
|
╨
|
║
|
║
|
╥
|
║
|
║
|
╨
|
║
|
║
|
^
|
║
|
╚
|
═
|
╝
|
XAND[edit]
≈
|
≈
|
≈
|
║
|
.
|
║
|
║
|
╬
|
║
|
║
|
.
|
║
|
║
|
╬
|
║
|
╚
|
═
|
╝
|
╔
|
═
|
╗
|
║
|
+
|
║
|
║
|
X
|
║
|
║
|
.
|
║
|
║
|
X
|
║
|
║
|
.
|
║
|
║
|
^
|
║
|
╚
|
═
|
╝
|
╔
|
═
|
╗
|
║
|
.
|
║
|
║
|
╥
|
║
|
║
|
╨
|
║
|
║
|
╥
|
║
|
║
|
╨
|
║
|
║
|
^
|
║
|
╚
|
═
|
╝
|
Computing[edit]
Latch[edit]
In Dwarf Fortress, a latch is a circuit which has two stable states and thereby can store one bit of information.
A circuit incorporating latches has state; its output may depend not only on its current input, but also on its previous inputs.
S/R Latch[edit]
Here are four inputs, Red, Blue, Green and Gold, and two outputs, Pink and Teal. Outside signals are connected to Red and Green. Internally, Teal connects to Blue, and Pink connects to Gold. Only one of the outputs is typically used; if Pink is that output, then input Green will SET the BIT, and input Red will RESET it.
Note: Use a Signal Trap when attempting to capture creature plate signals. Hold RESET while system boots.
Signal Trap[edit]
-1 0 1 X . X I.R I.S <P O.Q
Notes
- INPUT S to SET, INPUT R to RESET
- Uses a door and hatch. Useful for capturing creature plate OUTPUT.
Clock Signal[edit]
0 [ IC CH.BR. ] <P OC PR.PL.
Note: ACCURACY UNTESTED.
Methods Of Implementation[edit]
The computational "house" is a collection of gates and purpose-made components for the computation of inputs and harvesting of results.
A source of water is pumped into a reservoir with the computational devices arranged below it to accept the water. Below these devices is a system for carrying away the used water.
The system must be able to carry the water at an adequate rate. Pumps are one way to assure this: they take the water to a river or map edge. Untested is the method of "atom-smashing" the water; it would greatly minimize the work needed, and indeed this already occurs inside the devices.
Of concern is what is known as "sloshing": where water can cause effect upon a pressure plate more then once per operation. This can cause chaos in the computer and completely ruin it. Pressure must be kept as high as possible; and drainage faster then the rate which pressure introduces water into the computer.
All gates using bridges and floodgates are particularly slow at changing states. Each takes 100 steps to switch states, and Pressure plates require 100 steps to turn OFF.
Reservoir[edit]
A pump can be seen supplying water to the reservoir from a brook. The door above determines whether the reservoir may fill. Underneath the water are a series of hatches over the computer components, determining whether the computer is on or off. To the left is a protected access shaft. The pump at the topmost is the highest in a series of pumps, reaching below to remove waste water.
Computer Components[edit]
Here can be seen an S/R Latch: where two NOR gates have their outputs crossed to the others second input. This allows 1 bit to be stored.
An access shaft, I, and a door, X, allow workers to reach the site.
EDIT LATER
Drainage[edit]
Here a pump, %, can be seen removing water from a pit below the S/R Latch. There is ample conduit to bring the water to the brook and pump into it. A waterwheel, gear assembly, and two axles bring power to the pumps.
EDIT LATER