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.

Difference between revisions of "v0.34:Minecart logic"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
Line 5: Line 5:
  
  
=== Three-tracked double-carted binary memory cell ===
+
=== Weight Adjusted Memory Cell ===
  
 
[[File:3tdcbm.png]]
 
[[File:3tdcbm.png]]
Line 11: Line 11:
 
The image is split into three versions to show where the minecarts go, what's beneath the minecarts and what's beneath the rollers and pressure plates.
 
The image is split into three versions to show where the minecarts go, what's beneath the minecarts and what's beneath the rollers and pressure plates.
  
How this works: There are 2 carts, a copper one at the top and an iron one in the center. A copper cart weighs 357 Urists and an iron cart 314 Urists. The pressure plate in the center is set to activate at 350 Urists, so the iron cart doesn't trigger it. Activating the gear/roller (the light green one), making the copper cart push the iron cart to the other end before rolling onto the pressure plate will trigger it and send an on signal. Vice versa (the iron cart will push the copper cart just fine even though it's a little bit lighter) to send an off signal. This design is the most space-efficient of the memory cells but lacks the activation speed of the next design due to the first cart having to push the second cart before being moved onto the pressure plate itself.
+
The weight adjusted memory cell utilizes a pressure plates' load adjusting feature to only trigger at certain weights. In this example the pressure plate is set to trigger at a weight of 350. The iron minecart occupying the plate weighs less then that so it doesn't trigger while the copper cart (being the heavier of the two at 357) would trigger it. Sending power to the northern roller (which pushes south) will push the copper cart into the iron cart, sending it to the southern roller (which pushes north but is currently inactive) before being pushed itself onto the pressure plate, triggering it. The reverse is done to turn the memory cell off.
 +
 
 +
This design is the most space-efficient of the memory cells but lacks the activation speed of the next design due to the first cart having to push the second cart before being allowed to trigger the pressure plate.
  
 
A modular example of this design:
 
A modular example of this design:
Line 17: Line 19:
 
[[File:Modular3tdcbm.png]]
 
[[File:Modular3tdcbm.png]]
  
It's a bit bulky looking but compared to the water based cell which needs 5 z-levels minimum to be of any worth, it's nearly 3x smaller and functions just the same.
+
Compared to the water based it's nearly 3x smaller and functions just the same without the hassle of getting water to where you need it.
  
 
=== Newton's Cradle Binary Memory Cell ===
 
=== Newton's Cradle Binary Memory Cell ===

Revision as of 23:10, 7 September 2012

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.

Binary Memory Cells

Binary Memory Cells store binary data as a 1 or 0 (on or off). For minecarts this means a minecart occupies a pressure plate to create a 1 and by some means removed to make a 0.


Weight Adjusted Memory Cell

3tdcbm.png

The image is split into three versions to show where the minecarts go, what's beneath the minecarts and what's beneath the rollers and pressure plates.

The weight adjusted memory cell utilizes a pressure plates' load adjusting feature to only trigger at certain weights. In this example the pressure plate is set to trigger at a weight of 350. The iron minecart occupying the plate weighs less then that so it doesn't trigger while the copper cart (being the heavier of the two at 357) would trigger it. Sending power to the northern roller (which pushes south) will push the copper cart into the iron cart, sending it to the southern roller (which pushes north but is currently inactive) before being pushed itself onto the pressure plate, triggering it. The reverse is done to turn the memory cell off.

This design is the most space-efficient of the memory cells but lacks the activation speed of the next design due to the first cart having to push the second cart before being allowed to trigger the pressure plate.

A modular example of this design:

Modular3tdcbm.png

Compared to the water based it's nearly 3x smaller and functions just the same without the hassle of getting water to where you need it.

Newton's Cradle Binary Memory Cell

Tpmch.png

This design is slightly larger, having four tracks instead of three, but has the advantage of activating the pressure plate almost immediately upon power being sent. To activate, power is sent to the light green gear, pushing the top cart into the second cart. Like a Newton Cradle, the first cart transfers its momentum to the second cart, knocking it to the other end while the first cart rests on the pressure plate to send an on signal. The gear is then turned off. To turn it off power is sent to the dark green and the reverse happens. The modular design of the first memory cell can be applied to this as well, and you can actually fit in more gears for a more complex logic gate because of the increased length.

Power to Signal Converters

A power to signal converter sends an on signal when power is applied and an off signal when power is cut.

2x2 power-to-signal converter

2x2pts.png

When power is sent to the gear, the roller sends the cart around in a loop, passing over the pressure plate repeatedly to maintain on on signal. When power is cut the cart returns to the starting position and disengages the pressure plate. The roller in this example pushes the cart from E->W. Pay close attention to the track layout to make sure it works properly. The 2 walls at the top are all that's needed to keep it from derailing.

A modular design.

Modular2x2pts.png

Single-carted power-to-signal converter

Scpts.png

The rollers are directed at the center like always, so when power is applied to any of the gears the minecart continuously passes over the pressure plate to maintain an on signal, reverting to an off signal when the power is cut.

A modular design.

Modularscpts.png

It's possible to butt each main component closer to each other and put the extra gears on other z-levels but they're so small it's impossible to join the gears together in a more efficient design. It might look like there are too many unneeded gears but if you're going to be making something that needs this much stuff you'll need 2 or 3 extra gears to form logic gates.

Double-carted power-to-signal converter

Dcpts.png

BloodBeard, who invented this compact design, has this to say about it: "I was able to take the load adjusting pressure plate concept of my memory cell and put it into a power-to-signal converter. It functions much like the memory cell, but with different linkages (and an axle). Now I'm not so sure if this can be called a power-to-signal converter since you don't simply send power to a gear and the thing maintains an 'on' signal, but it's really all about how you use it.

Both gears are off by default and the power is connected to the dark green gear. Be it by lever or pressure plate, both gears are switched on, sending power to both rollers (directed to the center). The copper cart pushes the iron one to the other side, but before the southern roller has time to push it back north the copper cart is rolled onto the pressure plate which turns off the dark green gear (and the southern roller). The light green gear is still engaged but no power is being sent to it because the dark green is off. This was the sort of "eureka!" moment when I saw that rollers immediately stop when power is cut (unlike screwpumps) to allow this. (sorry if this is common knowledge, I'm a bit late to the game in getting into the 2012 versions)

Both gears are switched again when you want to turn it off, activating the dark green gear and disengaging the light green, sending both carts back to their starting points, deactivating the pressure plate which turns the dark green off again (but keeps the roller on long enough to push the iron cart thanks to the pressure plates 'off' delay). Everything is back to how it was at the start.

With the other examples, only 1 gear is needed to be switched to turn them on and off. If you treat both of these gears as you would a single gear then I guess you could also call it a power-to-signal converter, and is the only one that has no moving water or minecarts when it's in the on position. Useful if you have a whole bunch of them and want to minimize lag.

Now i'm not sure, but the implications of that last component might be huge for dwarfputing. That with a single lever or single pressure plate you can trigger an on and off signal on another component without any continuous moving parts wasn't possible with the mechanical-fluid logic examples I listed at the top of this post. It might be possible to use it as a binary memory cell as well, except I don't think there would be a 'standard' design and the gearing/linkages would need to be customized to the task it performs. I might have to make something, or at least plan it to see."

See Also