Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Travel Lane Designations  (Read 913 times)

Freddybear

  • Bay Watcher
    • View Profile
Travel Lane Designations
« on: October 27, 2007, 11:35:00 am »

Even on a six-tile-wide "highway" in a busy fortress, traffic jams are not infrequent, and one of the major causes seems to be the constant dodging and buffeting against oncoming traffic which results from dwarfs not obeying any sort of lane discipline. How about a designation that would say "this side of the hallway for east-bound traffic" (or north or south or whatever).

It could be implemented in pathfinding code by putting a variable weight on moving from particular tiles depending on the direction of movement. That would preferentially select the desired travel lane but still allow for movement across lanes to get to side streets and building destinations.

Logged

Teldin

  • Bay Watcher
  • Canadian Bacon
    • View Profile
Re: Travel Lane Designations
« Reply #1 on: October 27, 2007, 12:57:00 pm »

This exact thing is coming in on the new version, which should be out sometimes in the next few days.

Edit: Well, sort of. You can designate an area to be high, medium, or low traffic rather than what direction it's coming from.

[ October 27, 2007: Message edited by: Teldin ]

Logged

Freddybear

  • Bay Watcher
    • View Profile
Re: Travel Lane Designations
« Reply #2 on: October 27, 2007, 01:54:00 pm »

Yes, I knew about the traffic level flags.

Another thought was for a "no loitering" flag, especially to keep animals from crowding the front of the fort, but I handled that one by caging all the livestock instead.

Logged

herrbdog

  • Bay Watcher
    • View Profile
Re: Travel Lane Designations
« Reply #3 on: October 27, 2007, 06:48:00 pm »

I was experimenting with, and had some moderate success with, 'traffic deviators'.

My main hall, from front gate to magma, is typically 17 tiles wide (i use 5x5 as a base, not 6x6, it is more aesthetically pleasing to me.)

code:

XXXXXXXXXXXXX
.......S.....
...S....S....
....S........
.....S.......
..S.....S....
...X.....X...
....S.....S..
..S..........
...S.........
.S..S..S.....
..S.....S....
...X.....X...
....S.....S..
.....S..S....
.........S...
......S...S..
.......S.....
XXXXXXXXXXXXX

Well, that sort of pattern anyway, down the lengths of the hall. It helped divide east-west traffic a little.

Logged

Felix the Cat

  • Bay Watcher
    • View Profile
Re: Travel Lane Designations
« Reply #4 on: October 28, 2007, 03:13:00 am »

The dwarves could easily do it themselves with simple emergent behavior: whenever a dwarf runs into another dwarf, he moves one tile to his right.

This naturally segregates traffic going opposite directions without having to muss about with manual settings and movement weights and the like.

Logged

Faces of Mu

  • Bay Watcher
  • I once saw a baby ghost...but it was just a tissue
    • View Profile
Re: Travel Lane Designations
« Reply #5 on: October 28, 2007, 06:59:00 am »

quote:
Originally posted by Felix the Cat:
<STRONG>The dwarves could easily do it themselves with simple emergent behavior: whenever a dwarf runs into another dwarf, he moves one tile to his right.

This naturally segregates traffic going opposite directions without having to muss about with manual settings and movement weights and the like.</STRONG>


I've seen this happen when two dwarves are heading in the same direction. If the faster dwarf is behind the slower dwarf, the fast dwarf will step to the side to try to get around the slower one. Meanwhile, the slower one has gained a one-tile advantage over the faster one (because of the faster one's detour) and the faster dwarf eventually steps back in line according to it's pathfinding. Then, when it catches up to the slower one, it occurs all over again.

Diagonal pathfinding will help eliminate this, but I dunno what it will do to oncomming traffic. You'll probably see both dwarves change lanes must still move forward diagonally when they reach other. If it were RL, they'd stop and do a little side-stepping dance for a few ticks until one took the initiative the other didn't!   :)

Logged

0x517A5D

  • Bay Watcher
  • Hex Editor‬‬
    • View Profile
Re: Travel Lane Designations
« Reply #6 on: October 29, 2007, 01:26:00 am »

Another way to work around this is to put a small "jog" in your main corridor every 80 or so tiles.  Always jog in the same direction.

code:

G####
A####
T#########################
E#########################
##################################################
##################################################
                    ###################################################M
                    ###################################################A
                                             ##########################G
                                             ##########################MA  

This design tends to direct eastbound traffic to the south part of the corridor, and westbound to the north.  It's not by any means perfect, but it helps.

0x517A5D

Logged