- 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 an EXTREMELY 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.
-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 on input is true -NOT takes one input and returns true if that input is false
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.
Machine Logic
Machine logic uses the also new system of gears, axles, windmills, and waterwheels to solve problems. Power sources (windmills and waterwheels) transfer power to machine parts (axles and gears). If there is not enough pwoer in a system to allow all the parts to move, it will shut down entirely. Individual gears can also be shut down by levers to interrupt or otherwise alter the transfer of power throughout the machine. All sorts of logic gates can be created based on those rules alone. Currently four have been created in a proof-of-concept sort of way in a relatively quick and cheap manner:
In the above picture, the four basic logic operations are shown. Gears connected to outside power are circled in red. Gears that can be deactivated by lever are color-coded to the lever that deactivates them. For the purposes of binary logic, a lever is TRUE if it is pointing LEFT. Levers pointing RIGHT are FALSE.
In AND, two adjacent gears are connected to levers. Power is only transferred to the one-tile output axle if both levers are set to true.
In OR, two power sources are connected to an output gear and axle. If either lever is set to true, the axle will be connected to power and also be true.
In XOR, 40 units of power are transferred to a central gear. To power the output axle, it must be connected to it by switching one of the levers to true. However, if both levers are set to true, then the machine requires 42 units of power to run, and thus shuts down due to lack of power.
in NOT, there is a powered gear connected directly to the output axle. If the lever is set to true, the powered gear connects to 3 other unpowered gears, which causes the machine to shut down due to lack of power.
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. <-- Could someone with more free time than me give this a shot? Just some proof-of-concept gates and a picture should be enough. -->