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 40d Talk: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 "40d"). 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 52: Line 52:
  
 
:Your Problem is: pressure plates and levers have a "on" and a "off" state. "On" opens door, floodgates and hatches, "off" closes them. It is not possible to open one thing and close another directly with the same lever or pressure plate. Look at [[lever]] for more information. You´ll have to use some kind of signal-inverter or use a bridge to block flow. Bridges can be used as inverted doors ([[fluid logic]]). --[[User:Kami|Kami]] 15:00, 31 October 2009 (UTC)
 
:Your Problem is: pressure plates and levers have a "on" and a "off" state. "On" opens door, floodgates and hatches, "off" closes them. It is not possible to open one thing and close another directly with the same lever or pressure plate. Look at [[lever]] for more information. You´ll have to use some kind of signal-inverter or use a bridge to block flow. Bridges can be used as inverted doors ([[fluid logic]]). --[[User:Kami|Kami]] 15:00, 31 October 2009 (UTC)
 
::That's really stupid.  But creatures stepping on a pressure plate just work like a toggle?  What the hell?  Why can't fluids work more like that.  --[[User:Squirrelloid|Squirrelloid]] 17:02, 31 October 2009 (UTC)
 
 
Ok, I think I have a design that might work.  Its not exactly binary, but its going to be a whole lot easier to build rather than figuring out the mess of logic.
 
 
So the example repeater on the Repeater page says it works ~1/300 'steps'.  Assume there are 1200 'steps' in a day.
 
 
P|_+_|_+^_
 
 
Where P is pressurized water, | is a floodgate, + is a drawbridge, ^ is a 3/7-7/7 pressure plate, and _ is a hatch.  The doors and bridges are linked to the pressure plate in the repeater, which alternately toggles them, so it counts up to 4.  The ^ at the end opens all the hatches when 'on' (voiding the system), and also triggers a day counter, built on similar principles but 28 long.  The day counter similarly triggers a month counter that is 12 long.  The difference being each step of the day/month counter needs a ^ to trigger a display somewhere (unless you use the counter itself as the display, which is admittedly inelegant).
 
 
... The ^ from the repeater is going to toggle on and off once per iteration isn't it, so it'll do two parts instead of one per 300 'steps'?  crap.  I suppose you need to make it twice as long then, huh? Ie:
 
 
P|_+_|_+_|_+_|_+^_
 
 
(As much fun as building a full binary system would be, I want something that can be constructed relatively quickly, which in this case means 'with a limited number of logic structures')
 
 
--[[User:Squirrelloid|Squirrelloid]] 08:44, 1 November 2009 (UTC)
 
 
:Ok, it doesn't work, i can't keep water at 7/7 through the whole thing (annoying).
 
:a day is also not an integer multiple of that particular repeater.  Its somewhere between 3 and 4 iterations.  Ugg, getting this to work properly is going to drive me nuts.  I'm not really sure I want to try to code in binary... --[[User:Squirrelloid|Squirrelloid]] 12:04, 1 November 2009 (UTC)
 
 
:Hmm.. with a little more complication i don't need to have them in sequence.  But drainage becomes a bigger engineering problem...  Ok, lets solve the repeater:day ratio problem first, then i'll try to figure out how to 'wire' this mess. --[[User:Squirrelloid|Squirrelloid]] 12:39, 1 November 2009 (UTC)
 
::I have seen a video of a goblin running forth an back towards triggered doors. http://mkv25.net/dfma/movie-1299-goblininfiniteloop I think this would be a perfect and scalable repeater... I think if you know how fast a goblin can run and how long it would take to find the new way, you´ll be able to have him "repeat" exactly x times a day. --[[User:Kami|Kami]] 19:39, 2 November 2009 (UTC)
 
 
:::So, there's this theory that a day has 1200 'ticks'.  Bridges and floodgates have a 100 tick delay (assuming they're built *before* the pressure plate, o/w 101 ticks...).  Theory seems to suggest pressurized water pushes 7/7 water into an open space each tick.  So the minimal repeater with pressurized water: P+^| has a 202 tick cycle (assuming +,| are built before ^).  Theory - we need to extend the front end of this 38 squares to get a 240 tick repeater (1200/240 = 5).
 
 
:::by front end i mean something like P+____..._____+^|, where _ are open space with hatch covers, because this needs to completely drain each cycle, and also not interfere with the spacing of the actual repeater, just the time it takes to refill/retrigger.
 
 
:::I need to actually build this and run some timing tests...  The other problem is i'm assuming infinitely pressurized water - need to check feasibility if i'm draining 38 squares of water each cycle of the repeater... (admittedly, i can use its waste water to pressurize whatever adder i have keeping track of how often its repeated...)
 
 
:::--[[User:Squirrelloid|Squirrelloid]] 20:17, 2 November 2009 (UTC)
 
 
== Image improvement ==
 
[[User:HebaruSan|HebaruSan]], you added an 'Image Rules Notice'. Can you explain what you'd like to have improved? Using the default tileset would rather reduce than improve clarity.
 
: The only thing that's rule-related is to convert from GIF to PNG, which is minor. I'd still find these a bit confusing after that, though; a few suggestions:
 
:* Change |thumb to |right or |left so they appear at full size, since they're an important part of the content and not an aside.
 
:* Omit the gridlines.
 
:* Use a black background.
 
:* Use the foreground color for color-coding the functional pieces. So the gear assembly itself would be green or purple, not the tile under it.
 
:* Use a thicker/bolder font.
 
:* ''Maybe'' draw some partially transparent arrows over the tiles to illustrate the flow of the logic. I.e., from this tile, to that tile, to that tile, ...
 
:* ''Maybe'' split them out into one graphic per diagram. This may not matter much once they're full-size, though.
 
: I found [[User:Hussell/SetResetLatch]] to be pretty readable, using mostly the standard tileset. I'll try to find some time today to mock one of these up with RT, to see how it looks.
 
: --[[User:HebaruSan|HebaruSan]] 14:03, 9 November 2009 (UTC)
 
 
::With the sole exception of screwpumps, i think the default tileset would make things a lot clearer.  Also, why say 'input' and 'output' when what you mean is 'water' and 'pressure plate'?  A less formal abstract treatment and a more DF-termed treatment might make it more accessible. --[[User:Squirrelloid|Squirrelloid]] 14:36, 9 November 2009 (UTC)
 
:::I allready tried to use default tileset, not for water logic but for mechanical logic, and failed so far. Especially pumps and plates for different levels are a problem, but also linkage issues and I/O can be difficult do display. But I have to admit that [[User:Hussell/SetResetLatch|Hussell's SetResetLatch]] looks quite good.<br />@[[User:Squirrelloid|Squirrelloid]]: I don't think the problem of this page are the images. There should be more Text to explain how they are working.--[[User:Kami|Kami]] 15:11, 9 November 2009 (UTC)
 
:::: [[File:Fluid darkbg.png|right]] For comparison, here's what it might look like with black backgrounds, varying foregrounds, no gridlines, and thicker glyphs:
 
:::: --[[User:HebaruSan|HebaruSan]] 17:29, 9 November 2009 (UTC) <br clear="all"/>
 
 
== CMOS logic ==
 
 
The logic gate described as CMOS logic is actually classic transistor logic, which relies on the flow of current (water). The point of CMOS logic is that there is only flow at state changes. It would look like this in Dwrf Fortress (not tested yet):
 
<pre>
 
║S║ - water source
 
╠X╣ - floodgate
 
║p║ - pressure plate
 
╠B╣ - drawbridge
 
║D║ - drain
 
</pre>
 
The floodgate and the bridge are connected to the same input, and the pressure plate will be the output (either positive or negative). It has an advantage of low water usage (the same as real CMOS circuits), so it can be connected to a permanent water source (or even a pond that is filled occasionally), and can be drained by letting the water into a large cavern where it will evaporate.
 
 
[[Special:Contributions/89.132.124.161|89.132.124.161]] 13:11, 17 November 2009 (UTC)
 
* I'm on to testing this logic and will write to the main page when ready. [[User:Petersohn|Petersohn]] 07:50, 18 November 2009 (UTC)
 
** Done. [[User:Petersohn|Petersohn]] 12:46, 30 November 2009 (UTC)
 
*I have added my personal work on this subject to my user page. The gates I use are similar, but I feel they may yet contribute. [[User:Gammon|Gammon]] 00:45, 1 December 2009 (UTC)
 

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!

Please sign comments with ~~~~

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)