Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: One Way halls/paths/traffic routes  (Read 1230 times)

umbrelladroid

  • Bay Watcher
    • View Profile
One Way halls/paths/traffic routes
« on: March 08, 2017, 03:53:36 am »

Hi guys, well this one is really just a novelty i guess but... Like everyone here, I have a love of DF but more so I have a reall thing about restricting certain dwarfs from going certain places, but not others ( even when those non restricted places are close proximity to restricted ones)..

My suggestion would be to implement the ability to create one way paths.. this would be useful in alot of ways,
one such way would be so that you can have a nice decent flow of stockpiles, workshops ect.

I know that trampling would still happen as some dwarfs are faster than others but it would still be very useful... not to mention it would make it a whole lot easier on the eyes as it would offer a bit more clarity to what you are doing with regards to hauling, rather than just seeing a complete mass of dwarfs running any which way to get to where they are going.
Logged

snow dwarf

  • Bay Watcher
  • Is always cold
    • View Profile
Re: One Way halls/paths/traffic routes
« Reply #1 on: March 08, 2017, 08:25:47 am »

This is actually a damn good idea.
Logged
Here at Bay12 we excel at Theoretical Biology. Need to know the value of Merbone? Check. Need to know the density of a thrown Fluffy Wambler? Check. Need to know how a walking Mushroom can theoretically talk? Check.

FantasticDorf

  • Bay Watcher
    • View Profile
Re: One Way halls/paths/traffic routes
« Reply #2 on: March 08, 2017, 12:13:02 pm »

Just to make it a bit more uniform because right now they could move anywhere, why not have roads (pathed because dirt roads expire) direct them to where they need to be with a small additional speed boost. The road will be the faster route (which is summarily closer in pathing logic) and they'll take it to the distance they need to (walk up a road a bit speedily then step off) it should be ideally narrow and two roads with 1 way access in a two wide corridor will hurry dwarves along.

As to say the worldgen rules are that people travel on the left in one direction and on the right hand side on the left with caravans in the center lane.
Logged

Demicus

  • Bay Watcher
  • The formless enigma
    • View Profile
Re: One Way halls/paths/traffic routes
« Reply #3 on: March 08, 2017, 12:19:12 pm »

I remember seeing something similar to this suggested (I think it might have been one-way doors) but it was said that such happening was highly unlikely as the pathfinding logic the game uses wouldn't be able to handle it well, if at all.
Logged
All shall embrace the unquenchable flame
Dwarf Fortress: The weak shall be culled, so the strong can have nicer socks.

Zammer990

  • Bay Watcher
    • View Profile
Re: One Way halls/paths/traffic routes
« Reply #4 on: March 08, 2017, 12:57:56 pm »

I remember seeing something similar to this suggested (I think it might have been one-way doors) but it was said that such happening was highly unlikely as the pathfinding logic the game uses wouldn't be able to handle it well, if at all.
The game uses some kind of A* algorithm, which is perfectly capable of handling one-way paths

That said, inb4 we get a bug where you can make your fort invasion proof by designating your entry way as one-way
Logged
If your animals aren't expendable, you could always station a dwarf or two out there?

breadman

  • Bay Watcher
    • View Profile
Re: One Way halls/paths/traffic routes
« Reply #5 on: March 08, 2017, 01:26:30 pm »

Actual one-way paths won't work due to a connectivity optimization on pathfinding: It won't even start the A* algorithm unless the two points are known to be connected.  (This is also why the game can seem to pause for a bit when two large areas get connected or disconnected.)

However, one-way traffic designations could work well, at a memory cost of at least one more bit per tile.  (Every tile in the map, or at least in blocks where any tile has a traffic designation.)

That bit gets you four more options for traffic designations: N/S/E/W.  To use N as an example, a dwarf heading north into the tile sees a cost equivalent to a High traffic designation, while a dwarf heading south into the tile uses a Restricted cost.  (Ideally, NW or NE into the tile would be Normal, E or W would be Low, and SW or SE would be Restricted.)  This leads dwarves to use the path in the correct direction where possible, but still lets them go the wrong way when no alternative presents itself.

A second extra bit can get you up, down, and diagonal designations, but those are probably less useful, and would slow down the pathfinding algorithm even more.

Whether the slowdown in each pathfinding operation is offset by the reduced need for pathfinding around conflicts remains to be seen.  (Personally, I'd like to see that conflict-resolution pathfinding improved, too, but that's an entirely separate issue.)
Logged
Quote from: Kevin Wayne, in r.g.r.n
Is a "diety" the being pictured by one of those extremely skinny aboriginal statues?

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: One Way halls/paths/traffic routes
« Reply #6 on: March 08, 2017, 09:07:56 pm »

@breadman
None of that's going to fit in a bit (a single true/false.) Maybe you mean a byte?
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

rampaging-poet

  • Bay Watcher
    • View Profile
Re: One Way halls/paths/traffic routes
« Reply #7 on: March 09, 2017, 03:23:36 pm »

@Bumber breadman's proposal of one bit for "is directional" would work just fine because he's repurposing the existing two traffic designation bits.  Currently each tile stores two bits of traffic information - just enough to store high, normal, low, or restricted.  breadman's suggested new bit would override the normal meaning of the two existing bits and use them to store the intended direction of the path.  Dwarves going in various directions across it would "see" different traffic restriction levels depending on the N, E, S, W value encoded where the traffic restriction level normally goes.
Logged
Lame excuse? 'Having a drink instead' is the dwarfiest reason to not get something done, short of accidentally flooding your home with magma. Or intentionally flooding your home with magma.

umbrelladroid

  • Bay Watcher
    • View Profile
Re: One Way halls/paths/traffic routes
« Reply #8 on: March 09, 2017, 04:38:11 pm »

I remember seeing something similar to this suggested (I think it might have been one-way doors) but it was said that such happening was highly unlikely as the pathfinding logic the game uses wouldn't be able to handle it well, if at all.
The game uses some kind of A* algorithm, which is perfectly capable of handling one-way paths

That said, inb4 we get a bug where you can make your fort invasion proof by designating your entry way as one-way

I wouldnt say thats entirely true. I mean invaders can be programmed ( within the code ) to not be affected by one way paths...
Logged

umbrelladroid

  • Bay Watcher
    • View Profile
Re: One Way halls/paths/traffic routes
« Reply #9 on: March 09, 2017, 04:40:17 pm »

Well thanks for your support opinions guys.. Its just that if you all play the game youll know about the restricted ( red ) and normal ( green ) path zones you can place....... I figured it would just be a simple thing to add in the option of direction ( as in one way direction, the same way you can assign a bridge to go ) the only differecne is that the dwarfs are the ones who obey the direction constraint when you place the zones....

Logged