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 v0.31:Fluid logic

Jump to navigation Jump to search

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

You are editing a page for an older version of Dwarf Fortress ("Main" is the current version, not "v0.31"). Please make sure you intend to do this. If you are here by mistake, see the current page instead.

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:
{{quality|Exceptional|19:04, 16 April 2011 (UTC)}}{{av}}
+
{{av}}
Fluid logic is a form of [[computing]] which uses a fluid (generally [[water]]) controlled by various means, to trigger [[pressure plate]]s and hopefully accomplish some desirable result.
+
Fluid logic is a form of {{L|computing}} which uses a fluid (generally {{L|water}}) controlled by various means, to trigger {{L|pressure plate}}s and hopefully accomplish some desirable result.
  
 
==Infinite Flow Gates==
 
==Infinite Flow Gates==
Line 9: Line 9:
  
 
<div style="position:relative; float:none;">
 
<div style="position:relative; float:none;">
'''AND'''
+
'''(N)AND'''
 
{| cellpadding="0" cellspacing="0" style="border-spacing:0; border-style:solid; border-width:thin; border-color:#000000;"
 
{| cellpadding="0" cellspacing="0" style="border-spacing:0; border-style:solid; border-width:thin; border-color:#000000;"
 
|
 
|
Line 35: Line 35:
 
</div>
 
</div>
 
An AND gate is simply created by putting two floodgates ''in a row'', each one connected to one of the input triggers: {{Raw Tile|X|#A00|#444}}{{Raw Tile|X|#0A0|#444}}. When both floodgates recieve an on signal, they will open and let the water from the left side pass. The pressure plate behind the floodgates has to be constructed to react on 4-7 water.
 
An AND gate is simply created by putting two floodgates ''in a row'', each one connected to one of the input triggers: {{Raw Tile|X|#A00|#444}}{{Raw Tile|X|#0A0|#444}}. When both floodgates recieve an on signal, they will open and let the water from the left side pass. The pressure plate behind the floodgates has to be constructed to react on 4-7 water.
* If you use two 1x1 raising bridges, you'll get a NOR opeation instead.
+
* If you use two 1x1 raising bridges, you'll get a NAND opeation instead.
 
* The output can also be inverted by using a 0-3 pressure plate.
 
* The output can also be inverted by using a 0-3 pressure plate.
 
* You can add more floodgates to process more than two signals in the conjunction.
 
* You can add more floodgates to process more than two signals in the conjunction.
Line 43: Line 43:
  
 
<div style="position:relative; float:none;">
 
<div style="position:relative; float:none;">
'''OR'''
+
'''(N)OR'''
 
{| cellpadding="0" cellspacing="0" style="border-spacing:0; border-style:solid; border-width:thin; border-color:#000000;"
 
{| cellpadding="0" cellspacing="0" style="border-spacing:0; border-style:solid; border-width:thin; border-color:#000000;"
 
|
 
|
Line 76: Line 76:
 
</div>
 
</div>
 
An OR gate is simply created by putting two floodgates ''parallel'', each one connected to one of the input triggers: {{Raw Tile|X|#A00|#444}}{{Raw Tile|X|#0A0|#444}}. When one of the floodgates recieves an on signal, it will open and let the water from the left side pass. The pressure plate behind the floodgates has to be constructed to react on 4-7 water.
 
An OR gate is simply created by putting two floodgates ''parallel'', each one connected to one of the input triggers: {{Raw Tile|X|#A00|#444}}{{Raw Tile|X|#0A0|#444}}. When one of the floodgates recieves an on signal, it will open and let the water from the left side pass. The pressure plate behind the floodgates has to be constructed to react on 4-7 water.
* If you use two 1x1 raising bridges, you'll get a NAND opeation instead.
+
* If you use two 1x1 raising bridges, you'll get a NOR opeation instead.
 
* The output can also be inverted by using a 0-3 pressure plate.
 
* The output can also be inverted by using a 0-3 pressure plate.
 
* You can add more floodgates to process more than two signals in the conjunction.
 
* You can add more floodgates to process more than two signals in the conjunction.
Line 82: Line 82:
  
 
<div style="position:relative; float:none;">
 
<div style="position:relative; float:none;">
'''XOR'''
+
'''(N)XOR/EQUAL'''
 
{| cellpadding="0" cellspacing="0" style="border-spacing:0; border-style:solid; border-width:thin; border-color:#000000;"
 
{| cellpadding="0" cellspacing="0" style="border-spacing:0; border-style:solid; border-width:thin; border-color:#000000;"
 
|
 
|
Line 106: Line 106:
 
|-
 
|-
 
|{{RTL|#00A|≈|#DDD}}
 
|{{RTL|#00A|≈|#DDD}}
 +
|{{RTL|#0A0|X|#444}}
 
|{{RTL|#A00|╬|#444}}
 
|{{RTL|#A00|╬|#444}}
|{{RTL|#0A0|X|#444}}
 
 
|{{RTL|#DDD}}
 
|{{RTL|#DDD}}
 
|{{RTL|#222}}
 
|{{RTL|#222}}
Line 120: Line 120:
 
</div>
 
</div>
 
A XOR gate is created by putting 1x1 raising bridges and floodgates together. The red Bridge and floodgate {{Raw Tile|X|#A00|#444}}{{Raw Tile|╬|#A00|#444}} are linked to the same input and the green bridge and floodgate {{Raw Tile|X|#0A0|#444}}{{Raw Tile|╬|#0A0|#444}} are both linked to the other input. When one of the inputs sends an on signal, the bridge will raise/close and the appropriate door will be opened. Only when the floodgate and the bridge at one passage are open, what happenes when exactly one input singal is on, the water will flow to the right. The pressure plate behind the bridges has to be constructed to react on 4-7 water.
 
A XOR gate is created by putting 1x1 raising bridges and floodgates together. The red Bridge and floodgate {{Raw Tile|X|#A00|#444}}{{Raw Tile|╬|#A00|#444}} are linked to the same input and the green bridge and floodgate {{Raw Tile|X|#0A0|#444}}{{Raw Tile|╬|#0A0|#444}} are both linked to the other input. When one of the inputs sends an on signal, the bridge will raise/close and the appropriate door will be opened. Only when the floodgate and the bridge at one passage are open, what happenes when exactly one input singal is on, the water will flow to the right. The pressure plate behind the bridges has to be constructed to react on 4-7 water.
* If you exchange bridge and floodgate for one of the two inputs, you'll get a XNOR opeation instead.
+
* If you exchange bridge and floodgate for one of the two inputs, you'll get a NXOR/EQUAL opeation instead.
 
* The output can also be inverted by using a 0-3 pressure plate.
 
* The output can also be inverted by using a 0-3 pressure plate.
 
* You can use a 0-3 and a 4-7 pressure plate at the same time to get the result and it's inversion at the same time
 
* You can use a 0-3 and a 4-7 pressure plate at the same time to get the result and it's inversion at the same time
Line 130: Line 130:
  
 
==Fluid Preserving Gates==
 
==Fluid Preserving Gates==
At the moment there doesn't exist a full concept of fluid preserving Fluid Logic Gates. Each concept working with floodgates or equivalent components in the gates will have to deal with the destruction of the fluid. A way to handle this can be the usage of [[Hatch cover|hatches]]. Also evaporation is a known problem.
+
At the moment there doesn't exist a full concept of fluid preserving Fluid Logic Gates. Each concept working with floodgates or equivalent components in the gates will have to deal with the destruction of the fluid. A way to handle this can be the usage of {{L|Hatch cover|hatches}}. Also evaporation is a known problem.
 
<!--
 
<!--
 
==Mechanical-Fluid Gates==
 
==Mechanical-Fluid Gates==
These gates aren`t [[Fluid logic]]. The ''logic'' lies within the arrangement of the (mechanical) gears. You can find it here: {{subst:subl|Mechanical_logic}}. The Water is just used to convert the power into a trigger signal. (A general concept you need for {{subst:subl|Mechanical_logic}})
+
These gates aren`t [[Fluid Logic]]. The ''logic'' lies within the arrangement of the (mechanical) gears. You can find it here: {{subst:subl|Mechanical_logic}}. The Water is just used to convert the power into a trigger signal. (A general concept you need for {{subst:subl|Mechanical_logic}})
  
 
[[File:Logic2.gif|thumb]]
 
[[File:Logic2.gif|thumb]]
Line 335: Line 335:
 
The main factors that affect the speed of these gates are the delays of floodgates and bridges, and the switch-off delay of pressure plates. These cannot be eliminated.
 
The main factors that affect the speed of these gates are the delays of floodgates and bridges, and the switch-off delay of pressure plates. These cannot be eliminated.
  
Another factor is the flowing speed of the water. It can be improved. First, the water should flow in from a reservoir a few z-levels higher then the gates themselves (the more the better). This way, water will flow in much faster. Next, replace the pressure plates with up stairs, and make a 2x1 room one z-level above. On one tile is a down stair, and on the other is the pressure plate. Now the water will also flow out faster, or at least the pressure plate will switch off sooner.
+
Another factor is the flowing speed of the water. It can be improved. First, the water should flow in from a reservoir a few z-levels higher then the gates themselves (the more the better). This way, water will flow in much faster. Next, replace the pressure plates with up stairs, and make a 2x1 room one z-level above. On on tile is a down stair, and on the other is the pressure plate. Now the water will also flow out faster, or at least the pressure plate will switch off sooner.
  
 
This increases the water consumption a bit, but it still remains relatively low.
 
This increases the water consumption a bit, but it still remains relatively low.
 
==Edge Detector==
 
In some situations, it is beneficial to have logic that triggers during a state ''transition'' rather than based on steady states - for example, turning a lever "on" could trigger one brief event while turning the lever "off" would trigger a different event (or possibly the same event).
 
 
{| style="border-spacing: 0"
 
|colspan="7"| Z+0
 
|-
 
|{{H2O}}
 
|{{RTF|╠}}
 
|{{RTF|═}}
 
|{{RTF|═}}
 
|{{RTF|═}}
 
|{{RTF|╗}}
 
|{{000}}
 
|-
 
|{{H2O}}
 
|{{RT|X|#FFF|#800}}
 
|{{000}}
 
|{{RT|╬|#800}}
 
|{{000}}
 
|{{RTF|║}}
 
|{{000}}
 
|-
 
|{{H2O}}
 
|{{RTF|╚}}
 
|{{RTF|═}}
 
|{{RTF|╦}}
 
|{{RTF|═}}
 
|{{RTF|╣}}
 
|{{000}}
 
|-
 
|{{H2O}}
 
|{{RT|╬|#800}}
 
|{{H2O}}
 
|{{RT|X|#FFF|#800}}
 
|{{000}}
 
|{{RTF|║}}
 
|{{000}}
 
|-
 
|{{H2O}}
 
|{{RTF|╔}}
 
|{{RTF|═}}
 
|{{RTF|╩}}
 
|{{RTF|═}}
 
|{{RTF|╝}}
 
|{{000}}
 
|-
 
|colspan="7"| Z=-1
 
|-
 
|{{000}}
 
|{{000}}
 
|{{000}}
 
|{{RTF|╔}}
 
|{{RTF|═}}
 
|{{RTF|═}}
 
|{{RTF|╗}}
 
|-
 
|{{000}}
 
|{{000}}
 
|{{000}}
 
|{{RTF|║}}
 
|{{RT|^|5:1}}
 
|{{RTF|#}}
 
|{{RTF|║}}
 
|-
 
|{{000}}
 
|{{000}}
 
|{{000}}
 
|{{RTF|╠}}
 
|{{RTF|═}}
 
|{{RTF|═}}
 
|{{RTF|╣}}
 
|-
 
|{{000}}
 
|{{000}}
 
|{{000}}
 
|{{RTF|║}}
 
|{{RT|^|5:1}}
 
|{{RTF|#}}
 
|{{RTF|║}}
 
|-
 
|{{000}}
 
|{{000}}
 
|{{000}}
 
|{{RTF|╚}}
 
|{{RTF|═}}
 
|{{RTF|═}}
 
|{{RTF|╝}}
 
|}
 
 
Both pressure plates should trigger on depth 2-6. Link the bottom pressure plate to machines you wish to activate on ''positive'' transitions (e.g. stepping onto a pressure plate, or pulling a lever) and the upper pressure plate to machines you wish to activate on ''negative'' transitions (e.g. stepping off of the pressure plate, or pulling the lever again), then link the trigger itself (a lever or pressure plate) to both floodgates and both raising bridges.
 
 
Each time the input trigger is toggled, the appropriate pressure plate will activate, remain active until the water finishes flowing, then deactivate after about 100 steps.
 
  
 
{{Category|Constructions}}
 
{{Category|Constructions}}
 
{{Category|Computing}}
 
{{Category|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)