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:Creature 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:
{{av}}
 
 
 
Creature logic functions by taking advantage of creature's natural path-finding goals to trigger pressure plates.  Creature logic is complete-- you can build memory, repeaters, or any sort of logical circuit.
 
Creature logic functions by taking advantage of creature's natural path-finding goals to trigger pressure plates.  Creature logic is complete-- you can build memory, repeaters, or any sort of logical circuit.
  
Line 7: Line 5:
 
* Creature logic requires no fluid or wind.  In dry, windless environments, creature logic is the only kind of logic you can use.
 
* Creature logic requires no fluid or wind.  In dry, windless environments, creature logic is the only kind of logic you can use.
 
* Similarly, creature logic requires no infrastructure-- you can build your circuits anywhere, without worrying about bring water or power from one end of your map to the other.
 
* Similarly, creature logic requires no infrastructure-- you can build your circuits anywhere, without worrying about bring water or power from one end of your map to the other.
 +
* Creature logic is relatively fast.  Although it can never reach the speed of mechanical logic, it can operate more quickly than fluid logic.
 
* All creature logic circuits can be designed with only stone and a pick-- although you're free to use wood or metal if you prefer!
 
* All creature logic circuits can be designed with only stone and a pick-- although you're free to use wood or metal if you prefer!
 
* Creature logic doesn't need anything but creatures to send or receive signals.  There's no need to translate signals as with with mechanical logic.
 
* Creature logic doesn't need anything but creatures to send or receive signals.  There's no need to translate signals as with with mechanical logic.
* Creature logic can be very intuitive.  Watching creatures physically travel through your logic pathways simplifies debugging.
+
* Creature logic can be very intuitive-- it can even work in decimal systems without conversion.
 
* It's fun to watch the creatures run around!
 
* It's fun to watch the creatures run around!
  
 
Con:
 
Con:
* Reliable creature logic requires a lot of hatches, doors, and mechanisms.
+
* Reliable creature logic requires a lot of space, a lot of hatches and doors, and a lot of mechanisms.  There are tricky things to do that can reduce this, but they're best avoided in favor of good design principles.
 
* Creature logic requires creatures-- sometimes, a great number of creatures.  Sometimes, those creatures die or have babies.  Sometimes, they interrupt your dwarves.  Sometimes, your dwarves fill them full of crossbow bolts.
 
* Creature logic requires creatures-- sometimes, a great number of creatures.  Sometimes, those creatures die or have babies.  Sometimes, they interrupt your dwarves.  Sometimes, your dwarves fill them full of crossbow bolts.
 
* Creature logic is vulnerable (surprise) to the presence of unexpected creatures in the logic circuits.  Because creature logic circuits require a path either to the map edge or to the meeting hall (in most cases), this is a real possibility.
 
* Creature logic is vulnerable (surprise) to the presence of unexpected creatures in the logic circuits.  Because creature logic circuits require a path either to the map edge or to the meeting hall (in most cases), this is a real possibility.
* Creature logic requires large amounts of space.
+
* Creature logic can require large amounts of space.  A creature logic NOR is vastly larger than a mechanical logic NOR.
* It is (probably) not possible to design perfect delays with creatures in an unmodded game.  Any creature logic timing devices will only ever work probabilistically.
+
* It is (probably) not possible to design perfect delays with creatures in an unmodded game.  Any timing devices will always be vulnerable to error, although some techniques can lower this potential to a minimum.
  
 
==Free range or one path==
 
==Free range or one path==
Line 32: Line 31:
  
 
====Key====
 
====Key====
In all of the following diagrams, the creature is assumed to start at {{Raw Tile|s|#0FF|#000}} (if given).  {{Raw Tile|p|#F00|#000}} means that the square contains a path to the creature's pathing goal.  Doors {{Raw Tile|┼|#FF0|#000}} and hatches {{Raw Tile|¢|#FF0|#000}} are displayed in the same color as the pressure plate {{Raw Tile|^|#FF0|#000}} that links to them.  If no pressure plate exists for a color, furniture of that color is opened or closed from outside of the circuit pictured; if a hatch and a door are the same color, that means they receive signals from the same source.  Output pressure plates are displayed in magenta {{Raw Tile|^|#F0F|#000}}, as is any furniture in the circuit that is linked with the output plate.  In the rare case that part of a circuit is linked with multiple elements, it will be displayed with foreground and background colors and explained in text-- for instance, {{Raw Tile|^|#F0F|#0FF}} is linked both to cyan furniture and output.
+
In all of the following diagrams, the creature is assumed to start at {{Raw Tile|s|#0FF|#000}} (if given).  {{Raw Tile|p|#F00|#000}} means that the square contains a path to the creature's pathing goal.  Doors {{Raw Tile|┼|#FF0|#000}} and hatches {{Raw Tile|¢|#FF0|#000}} are displayed in the same color as the pressure plate {{Raw Tile|^|#FF0|#000}} that links to them.  If no pressure plate exists for a color, furniture of that color is opened or closed from outside of the circuit pictured; if a hatch and a door are the same color, that means they receive signals from the same source.  In the rare case that furniture is linked to both by a pressure plate in the circuit and an input signal, it will be displayed in white {{Raw Tile|¢|#FFF|#000}} and explained in text.  Output pressure plates are displayed in magenta {{Raw Tile|^|#F0F|#000}}, as is any furniture in the circuit that is linked with the output plate.
  
 
===Identity with NOT gate===
 
===Identity with NOT gate===
{{diagram|spaces=yes|\
+
{| style="border-spacing: 0"
╔══╗
+
|-
═╝[#0F0]┼[#F0F]^╚═
+
|{{000}}
[#0FF]s+OO+[#F00]p
+
|{{RTC|╔}}
═╗[#0F0+╔═
+
|{{RTC|═}}
╚══╝ }}
+
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{000}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{RT0|┼|#0F0}}
 +
|{{RT0|^|#F0F}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|-
 +
|{{RT0|s|#0FF}}
 +
|{{RTC|+}}
 +
|{{RTC|O}}
 +
|{{RTC|O}}
 +
|{{RTC|+}}
 +
|{{RT0|p|#F00}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RTC|+}}
 +
|{{RTC|╔}}
 +
|{{RTC|═}}
 +
|-
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|}
  
 
This function takes a single operand.  If the operand is true, the creature travels through the upper path (identity); otherwise, the creature takes the lower path (NOT).  The pressure plate signals when the operand is true.  This gate is the basis of all to follow.
 
This function takes a single operand.  If the operand is true, the creature travels through the upper path (identity); otherwise, the creature takes the lower path (NOT).  The pressure plate signals when the operand is true.  This gate is the basis of all to follow.
Line 47: Line 77:
  
 
===AND gate with NAND gate===
 
===AND gate with NAND gate===
{{diagram|spaces=yes|\
+
{| style="border-spacing: 0"
╔═══╗
+
|-
═╝[#0F0][#FF0]┼[#F0F]^╚═
+
|{{000}}
[#0FF]s+O═O+[#F00]p
+
|{{RTC|╔}}
═╗+[#0F0+╔═
+
|{{RTC|═}}
╚╗[#FF0]¢╔╝
+
|{{RTC|═}}
  ╚═╝  }}
+
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{000}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{RT0|┼|#0F0}}
 +
|{{RT0||#FF0}}
 +
|{{RT0|^|#F0F}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|-
 +
|{{RT0|s|#0FF}}
 +
|{{RTC|+}}
 +
|{{RTC|O}}
 +
|{{RTC|═}}
 +
|{{RTC|O}}
 +
|{{RTC|+}}
 +
|{{RT0|p|#F00}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{RTC|+}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RTC|+}}
 +
|{{RTC|╔}}
 +
|{{RTC|═}}
 +
|-
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|╗}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RTC|╔}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|-
 +
|{{000}}
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|{{000}}
 +
|}
  
 
The doors at the top are both open if both operands are true (AND); the hatches at the bottom permit path if either operand is false (NAND).  The pressure plate will signal when both operands are true.
 
The doors at the top are both open if both operands are true (AND); the hatches at the bottom permit path if either operand is false (NAND).  The pressure plate will signal when both operands are true.
  
 
===NOR gate with OR gate===
 
===NOR gate with OR gate===
{{diagram|spaces=yes|\
+
{| style="border-spacing: 0"
╔═══╗
+
|-
═╝[#0F0]¢[#FF0]¢[#F0F]^╚═
+
|{{000}}
[#0FF]s+O═O+[#F00]p
+
|{{RTC|╔}}
═╗+[#0F0]┼+╔═
+
|{{RTC|═}}
╚╗[#FF0]┼╔╝
+
|{{RTC|═}}
  ╚═╝  }}
+
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{000}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RT0|^|#F0F}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|-
 +
|{{RT0|s|#0FF}}
 +
|{{RTC|+}}
 +
|{{RTC|O}}
 +
|{{RTC|═}}
 +
|{{RTC|O}}
 +
|{{RTC|+}}
 +
|{{RT0|p|#F00}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{RTC|+}}
 +
|{{RT0|┼|#0F0}}
 +
|{{RTC|+}}
 +
|{{RTC|╔}}
 +
|{{RTC|═}}
 +
|-
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|╗}}
 +
|{{RT0|┼|#FF0}}
 +
|{{RTC|╔}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|-
 +
|{{000}}
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|{{000}}
 +
|}
  
 
The hatches at the top permit path only if neither operand is true (NOR); the doors at the bottom permit path if either operand is true (OR).  The pressure plate will signal when neither operand is true.
 
The hatches at the top permit path only if neither operand is true (NOR); the doors at the bottom permit path if either operand is true (OR).  The pressure plate will signal when neither operand is true.
  
===XOR gate with expanded XNOR gate===
+
===XOR gate with XNOR gate===
{{diagram|spaces=yes|\
+
{| style="border-spacing: 0"
  ╔═╦═╗ 
+
|-
╔╝[#0F0]┼O[#0F0]¢╚╗
+
|{{000}}
═╝+[#FF0]┼+[#FF0]¢[#F0F]^╚═
+
|{{000}}
[#0FF]s+O═══O+[#F00]p
+
|{{RTC|╔}}
═╗+[#0F0][#FF0]┼++╔═
+
|{{RTC|═}}
║+OO+╔╝
+
|{{RTC|╦}}
╚╗[#0F0]¢[#FF0]¢╔╝ 
+
|{{RTC|═}}
  ╚══╝  }}
+
|{{RTC|╗}}
 +
|{{000}}
 +
|{{000}}
 +
|-
 +
|{{000}}
 +
|{{RTC|╔}}
 +
|{{RTC|╝}}
 +
|{{RT0|┼|#0F0}}
 +
|{{RTC|O}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RTC|╚}}
 +
|{{RTC|╗}}
 +
|{{000}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{RTC|+}}
 +
|{{RT0|┼|#FF0}}
 +
|{{RTC|+}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RT0|^|#F0F}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|-
 +
|{{RT0|s|#0FF}}
 +
|{{RTC|+}}
 +
|{{RTC|O}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|O}}
 +
|{{RTC|+}}
 +
|{{RT0|p|#F00}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{RTC|+}}
 +
|{{RT0|┼|#0F0}}
 +
|{{RT0||#FF0}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|╔}}
 +
|{{RTC|═}}
 +
|-
 +
|{{000}}
 +
|{{RTC|}}
 +
|{{RTC|+}}
 +
|{{RTC|O}}
 +
|{{RTC|O}}
 +
|{{RTC|+}}
 +
|{{RTC|╔}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|-
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|╗}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RTC|╔}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|{{000}}
 +
|-
 +
|{{000}}
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|}
  
 +
As XOR is the intersection of OR and NAND, it is simply an OR followed by a NAND.  The XNOR, as the union of AND and NOR, requires two arms.  Each operand is linked to one door and one hatch in the XOR path, and to one door and one hatch in the XNOR path.  The pressure plate will signal when either operand is true but not both are true.  When modifying the XOR to take more than two operands, be careful to leave space between the doors and hatches as shown; this space is unnecessary for evaluation of two operands.
  
As XOR is the intersection of OR and NAND, it is simply an OR followed by a NAND.  The XNOR, as the union of AND and NOR, requires two arms.  Each operand is linked to one door and one hatch in the XOR path, and to one door and one hatch in the XNOR path.  The pressure plate will signal when either operand is true but not both are true.  When modifying the XOR to take more than two operands, be careful to leave space between the doors and hatches as shown; this space is unnecessary for evaluation of two operands.  Similarly, the expanded XNOR is appropriate when dealing with more than two operands, but a condensed version for taking only two operands exists (shown in the next circuit).
 
  
 
+
====Expanded XOR: Ordinal compare====
====Expanded XOR with XNOR: Ordinal compare====
+
This expanded XOR/XNOR can serve as an ordinal comparison-- XNOR implies equality, while the two arms of XOR, from north to south, imply that the first operand is greater than or less than the second operand. 2 arms are required for each each gate.
This expanded XOR/XNOR can serve as an ordinal comparison-- XNOR implies equality, while the two arms of XOR, from north to south, imply that the first operand is greater than or less than the second operand.
+
{| style="border-spacing: 0"
{{diagram|spaces=yes|\
+
|-
  ╔══╗ 
+
|{{000}}
╔╝[#0F0]┼[#FF0]¢╚╗
+
|{{000}}
║+OO[#F0F]^║
+
|{{RTC|╔}}
═╝+[#0F0]¢[#FF0]┼+╚═
+
|{{RTC|═}}
[#0FF]s+O══O+[#F00]p
+
|{{RTC|═}}
═╗+[#0F0]¢[#0F0]┼+╔═
+
|{{RTC|╗}}
╚╗[#FF0]┼[#FF0]¢╔╝
+
|{{000}}
  ╚══╝  }}
+
|{{000}}
 +
|{{000}}
 +
|-
 +
|{{000}}
 +
|{{RTC|╔}}
 +
|{{RTC|╝}}
 +
|{{RT0|┼|#0F0}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RTC|╚}}
 +
|{{RTC|╗}}
 +
|{{000}}
 +
|{{000}}
 +
|-
 +
|{{000}}
 +
|{{RTC|}}
 +
|{{RTC|+}}
 +
|{{RTC|O}}
 +
|{{RTC|O}}
 +
|{{RT0|^|#F0F}}
 +
|{{RTC|╚}}
 +
|{{RTC|╗}}
 +
|{{000}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{RTC|+}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RT0|┼|#FF0}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|-
 +
|{{RT0|s|#0FF}}
 +
|{{RTC|+}}
 +
|{{RTC|O}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|O}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RT0|p|#F00}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{RTC|+}}
 +
|{{RT0|┼|#0F0}}
 +
|{{RT0|┼|#FF0}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|╔}}
 +
|{{RTC|═}}
 +
|-
 +
|{{000}}
 +
|{{RTC|║}}
 +
|{{RTC|+}}
 +
|{{RTC|O}}
 +
|{{RTC|O}}
 +
|{{RTC|+}}
 +
|{{RTC|╔}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|-
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|╗}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RTC|╔}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|{{000}}
 +
|-
 +
|{{000}}
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|}
  
 
The pressure plate will signal when the first operand is greater than the second operand.  It can be adjusted to signal for less than, equal to, or any combination.
 
The pressure plate will signal when the first operand is greater than the second operand.  It can be adjusted to signal for less than, equal to, or any combination.
Line 99: Line 370:
 
===Multiple use===
 
===Multiple use===
 
The gates above are single use gates; the creatures will escape after pathing through each gate.  Circuits which return the creature to the beginning of the path are possible via altering the path in-route.
 
The gates above are single use gates; the creatures will escape after pathing through each gate.  Circuits which return the creature to the beginning of the path are possible via altering the path in-route.
{{diagram|spaces=yes|\
+
{| style="border-spacing: 0"
  [#F00]p║
+
|-
══╝[#0F0]¢║
+
|{{000}}
[#0FF]s[#0F0]¢[#0F0]^O╣
+
|{{000}}
══╗[#0F0]┼║
+
|{{RTC|}}
  [#F00]p║}}
+
|{{RT0|p|#F00}}
 +
|{{RTC|║}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RTC|║}}
 +
|-
 +
|{{RT0|s|#0FF}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RT0|^|#0F0}}
 +
|{{RTC|O}}
 +
|{{RTC|╣}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{RT0|┼|#0F0}}
 +
|{{RTC|║}}
 +
|-
 +
|{{000}}
 +
|{{000}}
 +
|{{RTC|}}
 +
|{{RT0|p|#F00}}
 +
|{{RTC|║}}
 +
|}
  
This is one such device for re-routing creatures mid-path.  Upon stepping on the pressure plate, the creature opens two hatches, thus blocking retrograde motion as well as access to its pathing goal, and opens a door, giving access to a new pathing goal.  This new pathing goal can lead back to the original position of the creature.  This principle is demonstrated in the designs to follow.  Because the creature is constrained on the pressure plate, the door can be opened by outside mechanisms rather being linked to the pressure plate, permitting controlled movement of a creature through one or more arms of a circuit.
+
This is one such device for re-routing creatures mid-path.  Upon stepping on the pressure plate, the creature opens two hatches, thus blocking retrograde motion as well as access to its pathing goal, and opens a door, giving access to a new pathing goal.  This new pathing goal can lead back to the original position of the creature.  Because the creature is constrained on the pressure plate, the door can be opened by outside mechanisms rather being linked to the pressure plate, permitting controlled movement of a creature through one or more arms of a circuit.
  
 
==Creature memory==
 
==Creature memory==
{{diagram|spaces=yes|\
+
{| style="border-spacing: 0"
  ╔═╗ 
+
|-
═══╝[#0F0]┼╚══
+
|{{000}}
[#F00]p[#FF0]¢[#FF0]^[#FF0]¢[#00F]¢[#F0F][#00F]^[#00F]¢[#F00]p
+
|{{000}}
══╗[#0FF]┼╔═══
+
|{{000}}
  ╚═╝  }}
+
|{{RTC|╔}}
 +
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{000}}
 +
|{{000}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{RT0|┼|#0F0}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|-
 +
|{{RT0|p|#F00}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RT0|^|#FF0}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RT0|¢|#00F}}
 +
|{{RT0|^|#00F}}
 +
|{{RT0|¢|#00F}}
 +
|{{RT0|p|#F00}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{RT0|┼|#0FF}}
 +
|{{RTC|╔}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|-
 +
|{{000}}
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|}
  
This is a low latency version (not the simplest version, not the most full-featured) of creature-based memory.  Each pressure plate is linked to each adjacent hatch.  Memory is set by sending an open (followed closely by a close) to either door.
+
This is a low latency version (not the simplest version) of creature-based memory.  Each pressure plate is linked to each adjacent hatch.  Memory is set by sending an open (followed closely by a close) to either door.
  
 
Note that in this diagram, both ends need to lead to the pathing goal.  The creature can enter by either side, but will be constrained to either pressure plate during normal operation.
 
Note that in this diagram, both ends need to lead to the pathing goal.  The creature can enter by either side, but will be constrained to either pressure plate during normal operation.
Line 123: Line 461:
 
Probabilistic movement rates combined with attribute rust make perfect clock generation impossible-- or at least, no one has done it yet.  Without rust, however, its possible to design a device that will measure the speed of a given creature to any arbitrary level of confidence (less than total).  Repeaters based on the rate with which creatures fall through open space hold promise for the design of perfect creature-driven delay.
 
Probabilistic movement rates combined with attribute rust make perfect clock generation impossible-- or at least, no one has done it yet.  Without rust, however, its possible to design a device that will measure the speed of a given creature to any arbitrary level of confidence (less than total).  Repeaters based on the rate with which creatures fall through open space hold promise for the design of perfect creature-driven delay.
  
The memory design above, slightly modified, can make a decent (not perfectly regular) repeater.
+
The memory design above, slightly modified, can make a very regular (not perfectly regular) repeater.
{{diagram|spaces=yes|\
+
{| style="border-spacing: 0"
  ╔═╗ 
+
|-
═══╝[#FF0]¢╚══
+
|{{000}}
[#F00]p[#FF0]¢[#FF0]^[#FF0]¢[#00F]¢[#F0F][#00F]^[#00F]¢[#F00]p
+
|{{000}}
══╗[#00F]¢╔═══
+
|{{000}}
  ╚═╝  }}
+
|{{RTC|╔}}
 
+
|{{RTC|═}}
Here, each pressure plate is linked to the two orthogonally adjacent hatches.  The southern hatch is linked to the eastern pressure plate, while the northern hatch is linked to western pressure plate.  This repeater tends to fire about every 250 ticks, with open and close signals offset by about 125 ticks, when built as shown.  Although it's not a perfect delay, over sufficient repetitions, after attribute rust has run its course, the repeater will behave as a regular repeater-- that is, as the time for which it has ran approaches infinity, the repeater approaches full reliability.  In other words: it's very effective at rapidly triggering any device with a refractory period of 100, and it's perfectly acceptable for running a calendar.  Similar, non-repeating systems can be used to institute delay.
+
|{{RTC|╗}}
 +
|{{000}}
 +
|{{000}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|-
 +
|{{RT0|p|#F00}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RT0|^|#FF0}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RT0|¢|#00F}}
 +
|{{RT0|^|#00F}}
 +
|{{RT0|¢|#00F}}
 +
|{{RT0|p|#F00}}
 +
|-
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╗}}
 +
|{{RT0|¢|#00F}}
 +
|{{RTC|╔}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|-
 +
|{{000}}
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|}
  
Linking both pressure plates to output doubles its rate, turning it into very effective spike repeaterThe period can be increased by introducing floor space into the center of the design.
+
Here, each pressure plate is linked to the two orthogonally adjacent hatches.  The southern hatch is linked to the eastern pressure plate, while the northern hatch is linked to western pressure plate.  This repeater tends to fire about every 105 ticks, but never faster than every 100 ticks.  Although it's not a perfect delay, over sufficient repetitions, after attribute rust has run its course, the repeater will behave as a regular repeater-- that is, as the time for which it has ran approaches infinity, the repeater approaches full reliability.  In other words: it's very effective at rapidly triggering any device with a refractory period of 100, and it's perfectly acceptable for running a calendarSimilar, non-repeating systems can be used to institute delay.
  
 
==Signal management==
 
==Signal management==
Line 139: Line 516:
  
 
===Signal multiplication===
 
===Signal multiplication===
{{diagram|spaces=yes|\
+
{| style="border-spacing: 0"
[#F00]p║  [#F00]p║
+
|-
[#0F0]¢╚═══╝[#FF0]¢║
+
|{{RTC|}}
╠O[#0F0]^[#0FF]┼[#F0F]^[#FF0]¢[#FF0]^O╣
+
|{{RT0|p|#F00}}
[#0F0]¢O═══O[#0FF]¢║
+
|{{RTC|║}}
╚╗++[#F0F]^++╔╝
+
|{{000}}
╚═════╝ }}
+
|{{000}}
 +
|{{000}}
 +
|{{RTC|}}
 +
|{{RT0|p|#F00}}
 +
|{{RTC|║}}
 +
|-
 +
|{{RTC|}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RTC|║}}
 +
|-
 +
|{{RTC|╠}}
 +
|{{RTC|O}}
 +
|{{RT0|^|#0F0}}
 +
|{{RT0|┼|#0FF}}
 +
|{{RT0|^|#F0F}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RT0|^|#FF0}}
 +
|{{RTC|O}}
 +
|{{RTC|╣}}
 +
|-
 +
|{{RTC|}}
 +
|{{RT0|¢|#0F0}}
 +
|{{RTC|O}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|O}}
 +
|{{RT0|¢|#0FF}}
 +
|{{RTC|║}}
 +
|-
 +
|{{RTC|╚}}
 +
|{{RTC|╗}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RT0|^|#F0F}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|╔}}
 +
|{{RTC|╝}}
 +
|-
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|}
  
North of the circuit is the pathing goal.  The eastern and western pressure plates are linked to adjacent hatches.  Input is linked to the hatch southeast of the eastern pressure plate and to the door.  The central and southern pressure plates are linked to output.  This circuit generates both an open and a close every time it is sent an open or a close signal from input -- that is, it generates two properly-ordered signals for every properly-ordered signal it is sent, allowing for ''edge triggered'' logic.  Either output pressure plate can be removed to send an open and a close only upon receiving one kind of signal or the other kind of signal.  Output can linked to the same device or to two different devices.
+
North of the circuit is the pathing goal.  The eastern and western pressure plates are linked to adjacent hatches.  Input is linked to the hatch southeast of the eastern pressure plate and to the door.  The central and southern pressure plates are linked to output.  This circuit generates both an open and a close every time it is sent an open or a close signal from input-- that is, it generates two properly-ordered signals for every properly-ordered signal it is sent.  Either output pressure plate can be removed to send an open and a close only upon receiving one kind of signal or the other kind of signal.  Output can linked to the same device or to two different devices.
  
 
===Signal division===
 
===Signal division===
{{diagram|spaces=yes|\
+
{| style="border-spacing: 0"
[#F00]p║          [#F00]p║
+
|-
[#F0F]¢╚══════════╝[#FF0]¢║
+
|{{RTC|}}
╠O[#F0F]^[#0FF]┼++++++++[#FF0]¢[#FF0]^O╣
+
|{{RT0|p|#F00}}
[#F0F]¢O══════════O[#0FF][#FF0]¢║
+
|{{RTC|║}}
╚╗++++++++++++╔╝
+
|{{000}}
╚════════════╝ }}
+
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|{{000}}
 +
|{{RTC|}}
 +
|{{RT0|p|#F00}}
 +
|{{RTC|║}}
 +
|-
 +
|{{RTC|}}
 +
|{{RT0|¢|#F0F}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RTC|║}}
 +
|-
 +
|{{RTC|╠}}
 +
|{{RTC|O}}
 +
|{{RT0|^|#F0F}}
 +
|{{RT0|┼|#0FF}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RT0|¢|#FF0}}
 +
|{{RT0|^|#FF0}}
 +
|{{RTC|O}}
 +
|{{RTC|╣}}
 +
|-
 +
|{{RTC|}}
 +
|{{RT0|¢|#F0F}}
 +
|{{RTC|O}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|O}}
 +
|{{RT0|¢|#FFF}}
 +
|{{RTC|║}}
 +
|-
 +
|{{RTC|╚}}
 +
|{{RTC|╗}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|+}}
 +
|{{RTC|╔}}
 +
|{{RTC|╝}}
 +
|-
 +
|{{000}}
 +
|{{RTC|╚}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|═}}
 +
|{{RTC|╝}}
 +
|{{000}}
 +
|}
  
 
The eastern and western pressure plates are linked to all adjacent hatches.  Input is linked to the door and to the hatch southeast of the eastern pressure plate (which is also linked to the eastern pressure plate).  The western pressure plate sends an output signal.  This circuit generates an open signal the first time it is sent an open-close signal, and a close signal the second time it is sent an open-close.  That is, the circuit generates one properly-ordered signal for every two properly-ordered signals it is sent.  The order of these signals depends on creature placement-- with lever-based pre-toggling, the circuit could just as easily be understood to send a close signal and then an open signal.  The circuit needs to be sufficiently long so that the creature does not reach the eastern pressure plate before the close part of the input signal is sent.
 
The eastern and western pressure plates are linked to all adjacent hatches.  Input is linked to the door and to the hatch southeast of the eastern pressure plate (which is also linked to the eastern pressure plate).  The western pressure plate sends an output signal.  This circuit generates an open signal the first time it is sent an open-close signal, and a close signal the second time it is sent an open-close.  That is, the circuit generates one properly-ordered signal for every two properly-ordered signals it is sent.  The order of these signals depends on creature placement-- with lever-based pre-toggling, the circuit could just as easily be understood to send a close signal and then an open signal.  The circuit needs to be sufficiently long so that the creature does not reach the eastern pressure plate before the close part of the input signal is sent.
Line 170: Line 699:
  
 
====Floodgate design====
 
====Floodgate design====
Floodgates can be used instead of any of the doors pictured; with signal inversion, they can also be used instead of hatches.  Floodgates respond much more slowly than doors, but if obstructed, they close as soon as the obstruction is removed.  This can be important, for instance, if your creatures give birth inside of your logic circuit.
+
Floodgates can be used instead of any of the doors pictured; with signal inversion, they can also be used instead of hatches.  Floodgates respond much more slowly than doors, but if obstructed, they return to their proper state as soon as the obstruction is removed.  This can be important, for instance, if your creatures give birth inside of your logic circuit.
  
 
====Bridge design====
 
====Bridge design====
Line 191: Line 720:
  
 
==Animal logic==
 
==Animal logic==
[[Animal logic]] relies on a special case of free range creature logic that is specific to animals that are unable to open doors, by pathing them through tightly closed doors.  Animal logic can be very space efficient and easy to build in comparison to most kinds of creature logic.
+
{{L|Animal logic}} relies on a special case of free range creature logic that is specific to animals that are unable to open doors, by pathing them through tightly closed doors.  Animal logic can be very space efficient and easy to build in comparison to most kinds of creature logic.
  
 
{{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)