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 "40d:One-way"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(New page - proof reading and editing requested.. Credit to VD!)
 
 
(29 intermediate revisions by 11 users not shown)
Line 1: Line 1:
 +
{{quality|Fine|01:17, 18 August 2012 (UTC)}}{{av}}
 
<!--Thanks and credit to VengefulDonut for this, at least for making it better known!
 
<!--Thanks and credit to VengefulDonut for this, at least for making it better known!
 
             http://mkv25.net/dfma/movie-1422-one-waypassageexample
 
             http://mkv25.net/dfma/movie-1422-one-waypassageexample
 
-->
 
-->
  
Currently{{version|0.28.181.40d}}, due to what seems to be a minor bug rather than a feature, it's not only possible but quite easy to create '''one-way''' [[ramp]]s - and with those, one-way halls, [[stair]]s, and any other restricted [[path]] you can create from one controlled access point to another.
+
Due to a minor bug rather than a feature, it's not only possible but quite easy to create '''one-way gates''' with [[ramp]]s - and with those, one-way halls, [[stair]]s, and any other restricted [[path]] you can create from one controlled access point to another. Note that this bug has subsequently been fixed so this idea is not feasible in more recent versions.
  
The system has only a few requirements:
+
The set-up has only a few requirements:
*1) A closed route, with a one-way ramp set-up at the beginning and also at the end of the path, with no "normal" entrances or exits.
+
*1) A closed route, with no "normal" entrances or exits.
*2) (At least) 2 [[z-level]]s over 3 tiles in a line, enough for an up-ramp and a down-ramp.
+
*2) ''(At least)'' 2 [[z-level]]s over 3 tiles in a line, enough for an up-ramp, a supporting wall-top, and a down-ramp on the other side, forming a one-way gate.
*3) Two such gates, one at each end of the one-way path to ensure the restricted one-way traffic flow.
+
*3) Two such gates, one at each end of the enclosed route to ensure the restricted one-way traffic flow.
 
* (For newer players, make ''sure'' you understand how '''[[ramp]]s''' work in DF - they're ''not'' purely intuitive!)
 
* (For newer players, make ''sure'' you understand how '''[[ramp]]s''' work in DF - they're ''not'' purely intuitive!)
  
 
Lack of the first would allow any dwarf to wander in and go where they want from the "leak".  Having only 1 gate at one end would, again, allow a counter-directional leak at the far end.  
 
Lack of the first would allow any dwarf to wander in and go where they want from the "leak".  Having only 1 gate at one end would, again, allow a counter-directional leak at the far end.  
:'' (If the route has nothing to cause dwarves to seek a [[job]] or [[path]] there, such as a long empty hallway from one area to another, that last may not be a problem since they cannot exit the far end and so have no (good) reason to ever enter. You could still send military in if you had reason to, but tantruming dwarfs or other creatures could as well.  Your own tame animals could also wander as they please in such a setup, unless restricted by pet-locked [[door]]s or [[hatch]]es.)''
+
:'' (If the route has nothing to cause dwarves to seek a [[job]] or [[path]] there, such as a long empty hallway from one area to another, that last may not be a problem since they cannot exit the far end and so have no (good) reason to ever enter. You could still send military in if you had reason to, but tantruming dwarves or other creatures could as well.  Your own tame animals could also wander as they please in such a setup, unless restricted by pet-locked [[door]]s or [[hatch]]es.)''
  
  
Basically, the trick is that when you build a ramp under a constructed floor ''(not a natural floor!)'', and then remove that floor, the game fails to recognize that as a ''down''-ramp but still sees it as an ''up''-ramp, and so only the "up" half of its path is recognized.  Since neither the game nor your dwarfs can see or find a down-path, they only have one way off the upper level - ''one way.''
+
Basically, the trick is that when you build a ramp under a constructed floor ''(not a natural floor!)'', and then remove that floor, the game fails to recognize that as a ''down''-ramp but still sees it as an ''up''-ramp, and so only the "up" half of its path is recognized.  Since neither the game nor your dwarves can see or find a down-path, they only have one way off the upper level - ''one way.''
  
  
Line 23: Line 24:
  
 
This description will be completely constructed - the first two steps could be a natural up slope to a natural floor and wall below it, but the next two ''must'' be constructed.  Once you understand how it works, variations on design are certainly possible.   
 
This description will be completely constructed - the first two steps could be a natural up slope to a natural floor and wall below it, but the next two ''must'' be constructed.  Once you understand how it works, variations on design are certainly possible.   
 +
  
 
*1) Build a wall ({{k|b}}, {{k|C}}, {{k|w}}).  This can be 1 tile or many more than 1, but the gain in z-levels is necessary.
 
*1) Build a wall ({{k|b}}, {{k|C}}, {{k|w}}).  This can be 1 tile or many more than 1, but the gain in z-levels is necessary.
  
   side view:  ___■___<br />
+
   side view:  ___█___<br />
     top view:     '''O'''   (single wall)<br />
+
     top view: ...'''O'''... (single wall)<br />
         z+1:    +   (single wall-top)
+
         z+1:    +   (single wall-top)
  
  
*2) Build a ramp next to the wall ({{k|b}}, {{k|C}}, {{k|r}}).  This will be your "down ramp" to determine direction of traffic flow.
+
*2) Build a ramp next to the wall ({{k|b}}, {{k|C}}, {{k|r}}).  Choose the side that will be your "down-only" ramp as far as direction of traffic flow. (Note that this is a normal ramp in every respect, and can be used to access the top of the ramp as usual.)
  
   side view:  __/■___<br />
+
        <--'' traffic flow'' <--<br />
     top view:     ▲'''O'''   (up slope & single wall)<br />
+
   side view:  __/█___<br />
         z+1:     ▼+   (down slope & single wall-top)  
+
     top view: ..▲'''O'''... (up slope & single wall)<br />
 +
         z+1:   ▼+   (down slope & single wall-top)  
  
  
*3) Construct a floor ({{k|b}}, {{k|C}}, {{k|f}}) extending out over space above where your "not-a-down ramp" will be constructed.  (This will be your "up-ramp" to determine direction of traffic flow.)
+
*3) Construct a floor ({{k|b}}, {{k|C}}, {{k|f}}) extending out over space ''directly above'' where your "up-only ramp" will be constructed in the next step.   
 +
 
 +
        <-- ''traffic flow'' <--<br />
 
                   _
 
                   _
   side view:  __/■___<br />
+
   side view:  __/█___<br />
     top view:     ▲'''O'''   (up slope & single wall)<br />
+
     top view: ..▲'''O'''... (up slope & single wall)<br />
         z+1:     ▼++ (down slope, single wall-top and constructed floor)  
+
         z+1:   ▼++   (down slope, single wall-top and constructed floor)  
 +
 
  
 +
*4) Construct your "up-only ramp" under that floor (identical to step 2). (This ramp is actually the one part of the gate that defines the direction of traffic flow.)
  
*4) Construct your "up ramp" under the floor, (as step 2).
+
        <-- ''traffic flow'' <--<br />
 
                   _
 
                   _
   side view:  __/\__<br />
+
   side view:  __/\__<br />
     top view:     ▲'''O'''▲ (up slope, single wall, 2nd up slope)<br />
+
     top view: ..▲'''O'''▲.. (up slope, single wall, 2nd up slope)<br />
         z+1:     ▼++ (down slope, single wall-top and constructed floor)  
+
         z+1:   ▼++   (down slope, single wall-top and constructed floor)  
 +
 
  
 +
*5) Deconstruct the floor ({{k|d}}, {{k|n}}). (Your dwarves will use the first ramp to access the top of the wall and the floor normally.)
  
*5) Deconstruct the floor ({{k|d}}, {{k|n}}).
+
        <-- ''traffic flow'' <--<br />
 
 
                   ..
 
                   ..
   side view:  __/\__<br />
+
   side view:  __/\__<br />
     top view:     ▲'''O'''▲ (up slope, single wall, 2nd up slope)<br />
+
     top view: ..▲'''O'''▲.. (up slope, single wall, 2nd up slope)<br />
         z+1:     ▼+   (down slope, single wall-top...and ''no'' down slope!)  
+
         z+1:   ▼+   (down slope, single wall-top...and ''no'' down slope!)  
  
 
''Success!''
 
''Success!''
  
It's recommended you play with this just a bit first, to understand both the concept and how it works in practice.  By adding this "one-way entrance" before a set of stairs or normal ramps, you can create one-way traffic flows for any situation - perhaps even [[wagon|caravan wagons]]. {{verify}}
+
A dwarf on the top of one wall can only see one way down - which should be away from the gate at the other end of the path.  A dwarf on top of that matching gate can only see one way down - toward the path leading to the first gate.  From one gate to the other, and never the other way.
 +
 
 +
A second pair of gates could allow another one-way route (next to, above, below, or elsewhere) back to the starting point.
 +
 
 +
 
 +
It's recommended you play with this just a bit first in a sandbox mode, to understand both the concept and how it works in practice.  By adding this "one-way entrance" before a set of stairs or normal ramps, you can create one-way traffic flows for any situation - excluding [[wagon|caravan wagons]]. The initial down-ramps do not have to be connected (or even present!) - it's the "not-a-down-ramp" that's the key, so using stairs in place of the fully-functional ramp would be fine.  So long as there is at least one in-gate and one out-gate, more complex configurations can be created, forming Y's, T's or X's, whatever traffic flow you need. 
 +
 
  
 
====Video Example====
 
====Video Example====
Line 67: Line 81:
 
[http://mkv25.net/dfma/movie-1422-one-waypassageexample One-way passage example]
 
[http://mkv25.net/dfma/movie-1422-one-waypassageexample One-way passage example]
  
It is purely a demo: from an embark situation, he builds his walls and ramps (designating them at the same time) - if he did not build the 2nd, dwarves might wander in from the other side.  He then* designates his constructed floors, and then his 2nd ramps.   
+
It is purely a demo: from an embark situation, he builds his walls and ramps (designating them at the same time) - if he did not build the 2nd, dwarves might wander in from the other side.  He then designates his constructed floors, and then his 2nd ramps.
 +
 
 +
Once the ramps are built, he designates deconstruction of the two floors and channels out the sides, creating a restricted path between the two gatesOnce the floors are deconstructed, we can loo{{k|k}} at the space above where we know the 2nd ramps are: they read as "Empty Space" from this upper level, but dropping down to ground level, there they are: "Bauxite Block Upward Slope"!  Each wall now has two up, but only one "down" ramp, and a closed path between them.
 +
 
 +
In order to illustrate that the path is indeed one-way and that the dwarves have no choice but to travel through it, a "Restricted" [[traffic]] zone is placed at one end. He then designates a [[Zone#Garbage_Dump|garbage dump]] ( {{k|i}}, ''designate area'', {{k|g}} ), remembers to turn on "Dwarves Gather Refuse From Outside" ( {{k|o}}, {{k|r}}, {{k|o}} ), and marks all items for dumping ( {{k|d}}, {{k|b}}, {{k|d}}, ''designate area'' ).
  
:<sup>''(* This author is unclear why the "Restricted" [[traffic]] zone was placed - in tests, it did not seem necessary.)''</sup>
+
And ''(after a tense moment as the [[dwarf|dwarves]] think about it)''... the show begins.*
  
Once the ramps are built, he designates deconstruction of the two floors and channels out the sides, creating a restricted path between the two gates.  Once the floors are deconstructed, we can loo{{k|k}} at the space above where we know the 2nd ramps are: they read as "Empty Space" from this upper level, but dropping down to ground level, there they are: "Bauxite Block Upward Slope"!  Each wall now has two up, but only one "down" ramp, and a closed path between them.
+
:<sup>''(* Complete with a couple headfakes by true dwarves who take the long way around, just because.)''</sup>
  
He then designates a [[Zone#Garbage_Dump|garbage dump]] ( {{k|i}}, ''designate area'', {{k|g}} ), remembers to turn on "Dwarves Gather Refuse From Outside" ( {{k|o}}, {{k|r}}, {{k|o}} ), and marks all items for dumping ( {{k|d}}, {{k|b}}, {{k|d}}, ''designate area'' ).
+
===Possible drawbacks===
  
And ''(after a tense moment as the [[dwarf|dorfs]] think about it)''... the show begins.*
+
It is worth mentioning that in order to optimize pathfinding in DF, the map is partitioned into connected sections. Dwarves with a destination in a different section than the one they are in will not even attempt to path there. Dwarves trying to reach an area in the same section they are in will assume that a path exists. It's not clear how this will treat one-way passage breaks.
  
:<sup>''(* Complete with a couple headfakes by true dorfs who take the long way around, just because.)''</sup>
+
The video demonstrates that one-way passage breaks are considered connected (at least some of the time). This means if you are not careful building these, it could be dangerous for your processing speed. Dwarves repeatedly trying to path to an unreachable area could be a huge setback!
  
  

Latest revision as of 14:49, 8 June 2014

This article is about an older version of DF.

Due to a minor bug rather than a feature, it's not only possible but quite easy to create one-way gates with ramps - and with those, one-way halls, stairs, and any other restricted path you can create from one controlled access point to another. Note that this bug has subsequently been fixed so this idea is not feasible in more recent versions.

The set-up has only a few requirements:

  • 1) A closed route, with no "normal" entrances or exits.
  • 2) (At least) 2 z-levels over 3 tiles in a line, enough for an up-ramp, a supporting wall-top, and a down-ramp on the other side, forming a one-way gate.
  • 3) Two such gates, one at each end of the enclosed route to ensure the restricted one-way traffic flow.
  • (For newer players, make sure you understand how ramps work in DF - they're not purely intuitive!)

Lack of the first would allow any dwarf to wander in and go where they want from the "leak". Having only 1 gate at one end would, again, allow a counter-directional leak at the far end.

(If the route has nothing to cause dwarves to seek a job or path there, such as a long empty hallway from one area to another, that last may not be a problem since they cannot exit the far end and so have no (good) reason to ever enter. You could still send military in if you had reason to, but tantruming dwarves or other creatures could as well. Your own tame animals could also wander as they please in such a setup, unless restricted by pet-locked doors or hatches.)


Basically, the trick is that when you build a ramp under a constructed floor (not a natural floor!), and then remove that floor, the game fails to recognize that as a down-ramp but still sees it as an up-ramp, and so only the "up" half of its path is recognized. Since neither the game nor your dwarves can see or find a down-path, they only have one way off the upper level - one way.



Step by step[edit]

This description will be completely constructed - the first two steps could be a natural up slope to a natural floor and wall below it, but the next two must be constructed. Once you understand how it works, variations on design are certainly possible.


  • 1) Build a wall (b, C, w). This can be 1 tile or many more than 1, but the gain in z-levels is necessary.
  side view:  ___█___
top view: ...O... (single wall)
z+1: + (single wall-top)


  • 2) Build a ramp next to the wall (b, C, r). Choose the side that will be your "down-only" ramp as far as direction of traffic flow. (Note that this is a normal ramp in every respect, and can be used to access the top of the ramp as usual.)
        <-- traffic flow <--
side view: __/█___
top view: ..▲O... (up slope & single wall)
z+1: ▼+ (down slope & single wall-top)


  • 3) Construct a floor (b, C, f) extending out over space directly above where your "up-only ramp" will be constructed in the next step.
        <-- traffic flow <--
_ side view: __/█___
top view: ..▲O... (up slope & single wall)
z+1: ▼++ (down slope, single wall-top and constructed floor)


  • 4) Construct your "up-only ramp" under that floor (identical to step 2). (This ramp is actually the one part of the gate that defines the direction of traffic flow.)
        <-- traffic flow <--
_ side view: __/█\__
top view: ..▲O▲.. (up slope, single wall, 2nd up slope)
z+1: ▼++ (down slope, single wall-top and constructed floor)


  • 5) Deconstruct the floor (d, n). (Your dwarves will use the first ramp to access the top of the wall and the floor normally.)
        <-- traffic flow <--
.. side view: __/█\__
top view: ..▲O▲.. (up slope, single wall, 2nd up slope)
z+1: ▼+ (down slope, single wall-top...and no down slope!)

Success!

A dwarf on the top of one wall can only see one way down - which should be away from the gate at the other end of the path. A dwarf on top of that matching gate can only see one way down - toward the path leading to the first gate. From one gate to the other, and never the other way.

A second pair of gates could allow another one-way route (next to, above, below, or elsewhere) back to the starting point.


It's recommended you play with this just a bit first in a sandbox mode, to understand both the concept and how it works in practice. By adding this "one-way entrance" before a set of stairs or normal ramps, you can create one-way traffic flows for any situation - excluding caravan wagons. The initial down-ramps do not have to be connected (or even present!) - it's the "not-a-down-ramp" that's the key, so using stairs in place of the fully-functional ramp would be fine. So long as there is at least one in-gate and one out-gate, more complex configurations can be created, forming Y's, T's or X's, whatever traffic flow you need.


Video Example[edit]

A veteran player has posted a video demonstration here: One-way passage example

It is purely a demo: from an embark situation, he builds his walls and ramps (designating them at the same time) - if he did not build the 2nd, dwarves might wander in from the other side. He then designates his constructed floors, and then his 2nd ramps.

Once the ramps are built, he designates deconstruction of the two floors and channels out the sides, creating a restricted path between the two gates. Once the floors are deconstructed, we can look at the space above where we know the 2nd ramps are: they read as "Empty Space" from this upper level, but dropping down to ground level, there they are: "Bauxite Block Upward Slope"! Each wall now has two up, but only one "down" ramp, and a closed path between them.

In order to illustrate that the path is indeed one-way and that the dwarves have no choice but to travel through it, a "Restricted" traffic zone is placed at one end. He then designates a garbage dump ( i, designate area, g ), remembers to turn on "Dwarves Gather Refuse From Outside" ( o, r, o ), and marks all items for dumping ( d, b, d, designate area ).

And (after a tense moment as the dwarves think about it)... the show begins.*

(* Complete with a couple headfakes by true dwarves who take the long way around, just because.)

Possible drawbacks[edit]

It is worth mentioning that in order to optimize pathfinding in DF, the map is partitioned into connected sections. Dwarves with a destination in a different section than the one they are in will not even attempt to path there. Dwarves trying to reach an area in the same section they are in will assume that a path exists. It's not clear how this will treat one-way passage breaks.

The video demonstrates that one-way passage breaks are considered connected (at least some of the time). This means if you are not careful building these, it could be dangerous for your processing speed. Dwarves repeatedly trying to path to an unreachable area could be a huge setback!



See also: