Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Weighting pathing by direction?  (Read 879 times)

Zomg

  • Bay Watcher
    • View Profile
Weighting pathing by direction?
« on: April 07, 2007, 02:57:00 pm »

I know Toady is including traffic designations in the next build, but is there any way to implement directional traffic designations? So, a square might low weighted for a dwarf headed east but high weighted for west. That way you could set up inbound and outbound corridors. Maybe you could use one-way doors to do the same thing?
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Weighting pathing by direction?
« Reply #1 on: April 07, 2007, 03:36:00 pm »

Yeah, it's another 3 map bits just to say if it's weighted or not, assuming you do it square by square (using a different method is CPU intensive), so I didn't want to get into it before other things.  Having strict one-way yes/no doors is a different sort of problem, because it complicates the "can I get here or not?" question.  It would require more storage space in that case again, and a bit more processor time.  An interesting problem there is that it would cause your enemies to respect the strict designation, or a whole huge chunk of storage and processor time would need to be devoted to storing extra path-find information for the enemies.  Alternatively, the yes-no question could be eliminated entirely, but then no large paths could be formed.  Failing to find a path on DF maps is very very expensive, so the game needs to know it's possible before it tries.  Or you could try some kind of not-perfect method of path finding, and have the dwarves wander around lost forever I guess.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Zomg

  • Bay Watcher
    • View Profile
Re: Weighting pathing by direction?
« Reply #2 on: April 07, 2007, 05:34:00 pm »

Hmm, how about a behavior for the dwarves themselves then? Always try to step south when heading east and you meet some entity that will cause a detour, step north when heading east. Will that create spontaneous coherent flows in traffic? I guess determining a "general" direction of travel is probably fairly intensive, too.

I shouldn't try to get into the weeds as a layman. It just annoys me to see dwarves "bump" ten times going down a 6-wide corridor. :P

Logged

Svirfneblim

  • Bay Watcher
    • View Profile
Re: Weighting pathing by direction?
« Reply #3 on: April 07, 2007, 06:29:00 pm »

Better to just add one-way doors and one-way designations on the floor.
Like this:
##########
......>...
......>...
##########

# - wall
. - floor
> - dwarves can pass when coming from the west, but are blocked when coming from the east.

Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Weighting pathing by direction?
« Reply #4 on: April 08, 2007, 11:59:00 am »

I think it should be a soft yes/no.  If the dwarf encounters too many doors going to wrong way, have him say "f*ck it" and go the wrong way.  The only thing stopping him (from a realism poitn of view) is culture and a sign saying "no entry."

They don't have cars yet, so there wouldn't be any accidents. ;P

Logged

Jaqie Fox

  • Bay Watcher
  • Genuine Girl Techie!
    • View Profile
Re: Weighting pathing by direction?
« Reply #5 on: April 08, 2007, 12:29:00 pm »

you people don't seem to understand. it's a technical issue, not a practical issue.

If this was implemented as suggested it could cut framerates in half and quadruple RAM usage, in theory.

Logged

4bh0r53n

  • Bay Watcher
    • View Profile
    • http://www.phpbber.com/phpbb/index.php?c=1&mforum=abhorsengames
Re: Weighting pathing by direction?
« Reply #6 on: April 08, 2007, 01:03:00 pm »

Like the new sig Jaqie:

quote:
Posting and you. || I like sitting and watching the buildworld go by. || "My new year's resolution is 1600x1200."
Logged
.B.H.O.R.S.E.N.: Abhorrent, Bloodthirsty, Hitchhiker-Obliterating Ravager from the Sunless Enchanted Necropolis

I dont explode Cats, its way to hard to coax them into the microwave...

Jaqie Fox

  • Bay Watcher
  • Genuine Girl Techie!
    • View Profile
Re: Weighting pathing by direction?
« Reply #7 on: April 08, 2007, 01:07:00 pm »

Thanks.  :) they occured to me while doing a buildworld on a temporary FreeBSD install.
Logged