- 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.
Difference between revisions of "v0.34:Minecart logic"
(Advertising my own stuff.) |
(Removed many examples, added diagrams and key; WIP) |
||
Line 5: | Line 5: | ||
The addition of [[minecart]]s to Dwarf Fortress has opened up new and exciting logic and computing options for the ambitious fortress manager. Minecart-based logic gates and memory cells are easy to build (arguably easier than [[fluid logic]] systems), they are easy to reconfigure, and react quickly. | The addition of [[minecart]]s to Dwarf Fortress has opened up new and exciting logic and computing options for the ambitious fortress manager. Minecart-based logic gates and memory cells are easy to build (arguably easier than [[fluid logic]] systems), they are easy to reconfigure, and react quickly. | ||
− | == | + | ==Techniques and Circuits== |
− | |||
+ | There exist a great number of different techniques by which a minecart can receive input, compute, and deliver output. This article does not aim for a comprehensive list of techniques and circuits; the interested reader is encouraged to investigate further. The following examples were chosen to demonstrate both a variety of techniques and a few commonly used gates. | ||
− | === | + | ====Key==== |
+ | Adequately diagramming minecart logic devices can be difficult; each tile on each z-level might need to display up to four slices (track, ramp, furniture, minecart) that can lay on top of each other. Ramps are displayed on the furniture layer for the sake of simplicity, and some slices may be omitted when unnecessary. Components of each lower slice are displayed on the higher slice when unchanged by new components to give the reader a sense of placement. Wall {{Raw Tile|O|#FFF|#000}} is typically displayed only where it is essential to the operation of the circuit. Unengraved floor {{Raw Tile|;|#FFF|#000}} is sometimes needed for other components, but of course can be smoothed as desired. Track direction is laid out with {{Raw Tile|║|#FFF|#000}}{{Raw Tile|═|#FFF|#000}}{{Raw Tile|╗|#FFF|#000}}{{Raw Tile|╝|#FFF|#000}}{{Raw Tile|╚|#FFF|#000}}{{Raw Tile|╔|#FFF|#000}} and ends in a tile with {{Raw Tile|╨|#FFF|#000}}{{Raw Tile|╥|#FFF|#000}}{{Raw Tile|╡|#FFF|#000}}{{Raw Tile|╞|#FFF|#000}}. Minecarts {{Raw Tile|■|#FFF|#000}}are accelerated by rollers to the east {{Raw Tile|╟|#FFF|#000}} west {{Raw Tile|╢|#FFF|#000}} north {{Raw Tile|╧|#FFF|#000}} or south {{Raw Tile|╤|#FFF|#000}} and decelerated by track stops {{Raw Tile|≡|#FFF|#000}}. Rollers are controlled via gear assemblies, either engaged {{Raw Tile|☼|#FFF|#000}} or disengaged {{Raw Tile|☼|#777|#000}}, typically connected to sufficient power {{Raw Tile|P|#0F0|#000}}. Pressure plates {{Raw Tile|^|#FFF|#000}} provide output and, in some cases, modulate the circuit itself; in such cases, they are typically colored to make it clear to which components they are linked. Up {{Raw Tile|▲|#FFF|#000}} and down {{Raw Tile|▼|#FFF|#000}} ramps may be necessary to travel z-levels or alter minecart velocity. Doors {{Raw Tile|┼|#FFF|#000}} and hatches {{Raw Tile|¢|#FFF|#000}} are commonly used to control the path of minecarts. | ||
− | [[ | + | ===Power to signal=== |
+ | {{diagram|spaces=yes|\ | ||
+ | O O | ||
+ | ╥; ╤☼ | ||
+ | ║ [#F0F]^[#0F0]P | ||
+ | ╨; ╧☼ | ||
+ | O O | ||
+ | track furniture}} | ||
− | |||
− | + | In this simplest of all designs, the output plate sends an '''on''' signal when the gear assemblies {{Raw Tile|☼|#FFF|#000}} are powered {{Raw Tile|P|#0F0|#000}}. When power is lost, the minecart settles onto either the northern or southern roller spaces, and the output plate sends an '''off''' signal. | |
+ | |||
+ | This device is very general purpose. Left as an exercise for the reader, alternate construction can result in a [[repeater]] or edge detection. | ||
− | + | ===Newton's Cradle Memory=== | |
+ | {{diagram|spaces=yes|\ | ||
+ | O O O | ||
+ | ╥; ╤[#0C0]☼[#0F0]P ╤[#0C0]☼[#0F0]P | ||
+ | ║ ║ [#0F0]■ | ||
+ | ║ [#F0F]^ [#F0F]^ | ||
+ | ╨; ╧[#0CC]☼[#0F0]P [#0FF]■[#0CC]☼[#0F0]P | ||
+ | O O O | ||
+ | track furniture minecart}} | ||
− | |||
− | + | TinyPirate's Newton's Cradle [[Memory (Computing)|memory]] cell is notable both for it's tiny footprint and for demonstrating an important principle of minecarts. When the southern gear assembly {{Raw Tile|☼|#0CC|#000}} is briefly engaged, the southern roller {{Raw Tile|╧|#FFF|#000}} becomes powered, launching the southern minecart {{Raw Tile|■|#0FF|#000}} onto the output plate {{Raw Tile|^|#F0F|#000}}. But rather than continuing past the output plate, the southern minecart collides with the northern minecart {{Raw Tile|■|#0F0|#000}}, sending it onto the northern (unpowered) roller. When the northern gear assembly is briefly engaged, the situation reverses: the northern minecart knocks the southern minecart off of the output plate. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | [[ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | When | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Potential as an independent logic discipline == | == Potential as an independent logic discipline == |
Revision as of 20:53, 21 February 2014
Part of a series on |
Computing |
---|
Logic: Animal • Creature • Fluid • Mechanical • Minecart |
Components: Adder • Memory • Repeater |
This article is about an older version of DF. |
The addition of minecarts to Dwarf Fortress has opened up new and exciting logic and computing options for the ambitious fortress manager. Minecart-based logic gates and memory cells are easy to build (arguably easier than fluid logic systems), they are easy to reconfigure, and react quickly.
Techniques and Circuits
There exist a great number of different techniques by which a minecart can receive input, compute, and deliver output. This article does not aim for a comprehensive list of techniques and circuits; the interested reader is encouraged to investigate further. The following examples were chosen to demonstrate both a variety of techniques and a few commonly used gates.
Key
Adequately diagramming minecart logic devices can be difficult; each tile on each z-level might need to display up to four slices (track, ramp, furniture, minecart) that can lay on top of each other. Ramps are displayed on the furniture layer for the sake of simplicity, and some slices may be omitted when unnecessary. Components of each lower slice are displayed on the higher slice when unchanged by new components to give the reader a sense of placement. Wall O is typically displayed only where it is essential to the operation of the circuit. Unengraved floor ; is sometimes needed for other components, but of course can be smoothed as desired. Track direction is laid out with ║═╗╝╚╔ and ends in a tile with ╨╥╡╞. Minecarts ■are accelerated by rollers to the east ╟ west ╢ north ╧ or south ╤ and decelerated by track stops ≡. Rollers are controlled via gear assemblies, either engaged ☼ or disengaged ☼, typically connected to sufficient power P. Pressure plates ^ provide output and, in some cases, modulate the circuit itself; in such cases, they are typically colored to make it clear to which components they are linked. Up ▲ and down ▼ ramps may be necessary to travel z-levels or alter minecart velocity. Doors ┼ and hatches ¢ are commonly used to control the path of minecarts.
Power to signal
O | O | |||||||||||||
╥ | ; | ╤ | ☼ | |||||||||||
║ | ^ | P | ||||||||||||
╨ | ; | ╧ | ☼ | |||||||||||
O | O | |||||||||||||
t | r | a | c | k | f | u | r | n | i | t | u | r | e |
In this simplest of all designs, the output plate sends an on signal when the gear assemblies ☼ are powered P. When power is lost, the minecart settles onto either the northern or southern roller spaces, and the output plate sends an off signal.
This device is very general purpose. Left as an exercise for the reader, alternate construction can result in a repeater or edge detection.
Newton's Cradle Memory
O | O | O | |||||||||||||||||||||
╥ | ; | ╤ | ☼ | P | ╤ | ☼ | P | ||||||||||||||||
║ | ║ | ■ | |||||||||||||||||||||
║ | ^ | ^ | |||||||||||||||||||||
╨ | ; | ╧ | ☼ | P | ■ | ☼ | P | ||||||||||||||||
O | O | O | |||||||||||||||||||||
t | r | a | c | k | f | u | r | n | i | t | u | r | e | m | i | n | e | c | a | r | t |
TinyPirate's Newton's Cradle memory cell is notable both for it's tiny footprint and for demonstrating an important principle of minecarts. When the southern gear assembly ☼ is briefly engaged, the southern roller ╧ becomes powered, launching the southern minecart ■ onto the output plate ^. But rather than continuing past the output plate, the southern minecart collides with the northern minecart ■, sending it onto the northern (unpowered) roller. When the northern gear assembly is briefly engaged, the situation reverses: the northern minecart knocks the southern minecart off of the output plate.
Potential as an independent logic discipline
Minecarts can also be set in motion by ramps and switched between different paths by buildings, opening the path for a powerless logic discipline. The basic binary logic gates can be built in this fashion and combined to perform other operations like counting or basic algebra. The circuits tend to look quite complicated, especially if they stretch over multiple levels.
This kind of minecart logic is primarily an alternative to creature logic. Since minecarts move relatively quickly and completely deterministically, simple minecart logic gates can be relatively small and quick. Since a minecart only reacts to the conditions of its current tile and the tile it tries to move into, creature logic will have an advantage when looking at multiple and long logic paths, where a creature instantly detects and chooses the open path, while the minecart has to check every tile and building separately.
For signal generation, memory cells, repeaters and adders, this kind of minecart logic offers a variety of options.
See Also
- BloodBeard's Minecart Dwarfputing Ideas thread.
- TinyPirate's Minecart Logic 101 instructional video.
- Powerless logic based on hatch-switched minecarts. Logic gates built under this design doctrine.