Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3

Author Topic: One way hallways in .34?  (Read 4634 times)

zuglar

  • Bay Watcher
    • View Profile
One way hallways in .34?
« on: August 14, 2012, 07:26:25 pm »

Hi all,

I've been thinking a lot about this and am stuck... but it would be really nice if it could work. A pair of one-way halls could carry arbitrary traffic without jamming up, where even three-wide halls have issues under a burst of hauling.

I saw the bug/exploit for .40d on the wiki, but I think that's since been fixed. Is there anything more recent?
Logged

Hanslanda

  • Bay Watcher
  • Baal's More Evil American Twin
    • View Profile
Re: One way hallways in .34?
« Reply #1 on: August 14, 2012, 07:29:52 pm »

How would you make a hallway one way? The only issue I could imagine is that dorfs are very special, and would go the 'wrong way' down the one way hallways, slowing traffic considerably. Especially when there are dorfs going the wrong way both ways.
Logged
Well, we could put two and two together and write a book: "The Shit that Hans and Max Did: You Won't Believe This Shit."
He's fucking with us.

weenog

  • Bay Watcher
    • View Profile
Re: One way hallways in .34?
« Reply #2 on: August 14, 2012, 07:32:54 pm »

Dorfs have different move speeds depending on what they're carrying (and also on Agility too, IIRC).  Even if all traffic was flowing in the same direction you'd still have overlap and crawling dwarves.
Logged
Listen up: making a thing a ‼thing‼ doesn't make it more awesome or extreme.  It simply indicates the thing is on fire.  Get it right or look like a silly poser.

It's useful to keep a ‼torch‼ handy.

GoombaGeek

  • Bay Watcher
  • Horrors! Crundles in the caverns!
    • View Profile
Re: One way hallways in .34?
« Reply #3 on: August 14, 2012, 07:36:21 pm »

No, I get why you'd want it.

Because in a two-tile hallway, you get pileups of dwarves going every which way.

But two one-way hallways would work out much better because every dwarf in the hall is going the same way, only pausing to trample Urist McDoesnthaveawheelbarrowandhastohaulheavyrocksallday (it's a traditional dwarven clan name).

I don't know how either, though... but what about a hatch/bridge/something that only opens/is passable when a pressure plate right in front of it is pressed? Like...

Code: [Select]
.▓☺
.▓^
╬▓╬
^▓.
☺▓.

where ╬ is a 1x1 retracting bridge over a pit (not too deep, mind, just to block pathing). Next to the plates would be a convoluted way forward with high cost to path over, but also the only way in. When the bridge opens up they immediately walk across it and it closes behind them.

Or something :P
Logged
My wooden badge was delicious.

Sutremaine

  • Bay Watcher
  • [ETHIC:ATROCITY: PERSONAL_MATTER]
    • View Profile
Re: One way hallways in .34?
« Reply #4 on: August 14, 2012, 07:56:34 pm »

I've had moderate success with using three-wide corridors with a strip of high-traffic tiles down the centre. Dwarves prefer the middle and congregate there, but there's almost always space for them to dodge around a slower dwarf or one going in the opposite direction.

I'm not sure of the best way to expand that. NHHN should be enough for a few dozen dwarves, though it's better for burst jobs than general back-and-forth traffic.
Logged
I am trying to make chickens lay bees as eggs. So far it only produces a single "Tame Small Creature" when a hen lays bees.
Honestly at the time, I didn't see what could go wrong with crowding 80 military Dwarves into a small room with a necromancer for the purpose of making bacon.

Kaos

  • Bay Watcher
    • View Profile
Re: One way hallways in .34?
« Reply #5 on: August 14, 2012, 09:25:31 pm »

I don't know how either, though... but what about a hatch/bridge/something that only opens/is passable when a pressure plate right in front of it is pressed? Like...

where ╬ is a 1x1 retracting bridge over a pit (not too deep, mind, just to block pathing). Next to the plates would be a convoluted way forward with high cost to path over, but also the only way in. When the bridge opens up they immediately walk across it and it closes behind them.
A few problems with this:
1) a bridge opens about 100 tics after the plate is pressed, so the dwarf presses the plate and doesn't immediately walk across...
2) retracting bridges on a pressure plate and dwarves.... bad combination... most likely some dwarf is going to stand on the one tile the bridge is, and right at the moment it raises or lowers and get atom-smashed.
3) this could work using hatches/doors linked to plates, those do open immediately after triggering the plate
4) job cancelation due to paths changing, specially when dwarves are hauling something, they step on the plate the path changes the drop the item right there on the plate and move on to another task
5) path recalculation when a dwarf say is hauling something to a stockpile they already have a path if they step on a plate and the path they are following closes, they stop (cancel the job) and spend a while recalculating the new path, this can lead to the plate trigger to change back and more path confusion and job cancels ensue.


I was trying something similar to filter enemies from citizens and allow free passage, but didn't quite work because of the above...


If you want to give it a try a one way corridor can be done by setting up a hatch and a plate linked next to each other, when the dwarf steps on the plate the hatch opens and he can't take the entry-only corridor to exit, do the opposite on the exit-only corridor and they can't enter through the exit-only corridor...
« Last Edit: August 14, 2012, 09:29:19 pm by Kaos »
Logged

GoombaGeek

  • Bay Watcher
  • Horrors! Crundles in the caverns!
    • View Profile
Re: One way hallways in .34?
« Reply #6 on: August 14, 2012, 09:40:35 pm »

2) retracting bridges on a pressure plate and dwarves.... bad combination... most likely some dwarf is going to stand on the one tile the bridge is, and right at the moment it raises or lowers and get atom-smashed.
???

You're right, though, it's not a very good solution.
Logged
My wooden badge was delicious.

zuglar

  • Bay Watcher
    • View Profile
Re: One way hallways in .34?
« Reply #7 on: August 15, 2012, 08:22:59 am »

I've had moderate success with using three-wide corridors with a strip of high-traffic tiles down the centre. Dwarves prefer the middle and congregate there, but there's almost always space for them to dodge around a slower dwarf or one going in the opposite direction.

That's actually a pretty decent idea. Still not laminar flow, but definitely better than the pile-ups I've got right now.

I think approaches that open/close doors/bridges/hatches/whatever are fundamentally flawed and doomed to failure: you want Urist McGoingRightWay to see the valid path before he starts (so opening a door for him is too late). Similarly, it's not much help if Urist McGoingWrongWay starts in the wrong direction and gets a job cancellation later.
Logged

Iosyn

  • Bay Watcher
  • KAKAKA
    • View Profile
Re: One way hallways in .34?
« Reply #8 on: August 15, 2012, 02:14:00 pm »

Generally I find 3-wide hallways too large for my aesthetic taste, but it's pretty much the optimum size, since you can run a minecart track down the middle.

As for one way routes, you can just make 1-tile corridors off the main route and burrow your haulers to them while setting traffic restrictions. Keeps the dirty unskilled commoners cheesemakers off the main thoroughfare.

Bonus points, don't smooth the service tunnels. Only Nobles weaponsmiths, armorsmiths, brewers and crafters are allowed to tread their unsocked feet across such hallowed architecture.
Logged

Hyndis

  • Bay Watcher
    • View Profile
Re: One way hallways in .34?
« Reply #9 on: August 15, 2012, 02:48:34 pm »

I prefer main corridors to be anywhere from 3-5 tiles wide. Even minor corridors are 2 tiles wide.

1 tile wide corridors are only used for the rarely, if ever access corridors, such as the machinery that runs on its own.
Logged

Iosyn

  • Bay Watcher
  • KAKAKA
    • View Profile
Re: One way hallways in .34?
« Reply #10 on: August 15, 2012, 03:04:18 pm »

Yeah, I hardly ever use 1-tile wide corridors myself now. I generally use them for trap corridors and emergency exits from my well cisterns, but it might be acceptable for a minecart track, though.

Two is my general-use size, 3 for main thoroughfares-- but I tend to lower my popcap.
Nothing 120 dwarves can do that 60 can't.
Logged

Hyndis

  • Bay Watcher
    • View Profile
Re: One way hallways in .34?
« Reply #11 on: August 15, 2012, 03:19:17 pm »

I need 60 dwarves just to fill out my military properly.

I prefer having a population of 300ish. Anything below 200 and it just feels like I can't get any work done.
Logged

drayath

  • Bay Watcher
    • View Profile
Re: One way hallways in .34?
« Reply #12 on: August 15, 2012, 05:46:06 pm »

Just had a though on this while reading the tread. Utterly untested and based on the implimentation details of the path finding algorithm

Code: [Select]
############################
...HLHHHHHHHHHHHHHHHHHHHH...
...H####################H...
...HHHHHHHHHHHHHHHHHHHHLH...
############################

. = Floor
# = Wall
L = Low traffic zone
H = High traffic zone

Route cost is the same in both directions but depending on how the path finding explores different paths i could see it prefering one route for one direction and the other route for the other direction.

Someone else may need to do the science, I dont have a computer with DF on with me.
Logged
Drayath's Gem Splitting Workshop - Split large gems and gem trinkets into numbers of small gems.
Drayath's Seed Brewery - Convert bags of spare seeds into useful booze.

Fnear

  • Bay Watcher
    • View Profile
Re: One way hallways in .34?
« Reply #13 on: August 15, 2012, 06:14:10 pm »

Just had a though on this while reading the tread. Utterly untested and based on the implimentation details of the path finding algorithm

Code: [Select]
############################
...HLHHHHHHHHHHHHHHHHHHHH...
...H####################H...
...HHHHHHHHHHHHHHHHHHHHLH...
############################

. = Floor
# = Wall
L = Low traffic zone
H = High traffic zone

Route cost is the same in both directions but depending on how the path finding explores different paths i could see it prefering one route for one direction and the other route for the other direction.

Someone else may need to do the science, I dont have a computer with DF on with me.

My guess, based on my understanding of the algorithm, is that it would explore the high traffic area all the way to the far low traffic spot, then path cost would be high enough to explore the near low traffic spot.  The winner in the end would be the path closest to the starting point - dwarves starting north of the hall would take the north path.

If you had a hall between two high traffic areas that connected to the south end of the west area and the north end of the east area (with high traffic on the sides and low traffic down the middle) dwarves might naturally divide up since crossing the center path would always be costlier than going all the way to the end.  But even then, the question is - do you cross before you enter the hallway, or after you exit?  Path cost between both of those is likely also the same.  You'd probably have to micromanage the sources and destinations for hauling jobs to be sure.
Logged

krenshala

  • Bay Watcher
    • View Profile
Re: One way hallways in .34?
« Reply #14 on: August 15, 2012, 10:06:32 pm »

I also use three-wide hallways with H zoned paths down the center to good effect.

An alternate method to make use of the pathfinding algorithm would be to do the H zones alone the sides (or an L zone path down the center) but have that central zone stop a tile or two short of the end/corner.  What this should do, based on my understanding of the A* pathing algorithm, is that dwarves move to the wall they will turn into or past when they get to their "exit".  Depending on your layout this can lead to all northbound dwarves on the west wall and all southbound on the east wall, or something similar. It doesn't do anything to help the "but i'm just going next door, against traffic" dwarf's choice of path, however.  He'll still walk out, turn left (against traffic in this example) walk down the hall to his destination, dodging or forcing other to dodge him, then turning left again into his destination.

This type of situation is why I've stuck with the central H zoned path, as dwarves will preferentially travel the middle tile, and only move to the sides to dodge someone slower (direction is not an issue, as a faster dwarf going the other direction would have dodged first) or to turn toward their final destination.
Logged
Quote from: Haspen
Quote from: phoenixuk
Zepave Dawnhogs the Butterfly of Vales the Marsh Titan ... was taken out by a single novice axedwarf and his pet war kitten. Long Live Domas Etasastesh Adilloram, slayer of the snow butterfly!
Doesn't quite have the ring of heroics to it...
Mother: "...and after the evil snow butterfly was defeated, Domas and his kitten lived happily ever after!"
Kids: "Yaaaay!"
Pages: [1] 2 3