Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: how do i make an area unpassable  (Read 1965 times)

meowmix

  • Bay Watcher
    • View Profile
how do i make an area unpassable
« on: April 20, 2011, 11:38:29 pm »

i remember in the older versions i could paint a zone in an area that basically forbids passage for my dwarves. is this still possible to do?


and i dont mean burrows, i just want to basically forbid passage down several tunnels leading outside in my fort without the use of doors.
« Last Edit: April 20, 2011, 11:42:21 pm by meowmix »
Logged

Elim

  • Bay Watcher
    • View Profile
Re: how do i make an area unpassable
« Reply #1 on: April 21, 2011, 12:01:01 am »

Hmm, i think only Burrows do that.
Here is a Article on the Wiki, i think you mean that.
Traffic Designation
But it does not "restrict" a Area.
Hope that was helpful.
Logged

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: how do i make an area unpassable
« Reply #2 on: April 21, 2011, 12:02:02 am »

There's the traffic control designation (which is probably what you're thinking of, as to my knowledge there's never been a zone (not counting walls and such) that can completely restrict dwarves from moving through places), it can make a tile count as a whole bunch of tiles for pathfinding purposes and can be used to effectively force dwarves to take one tunnel instead of another, or make them go around a region instead of through it.

However, if that's the only path between where they are and where they want to go, they'll still take it. If you don't want them to go outside, never giving them a reason to go outside will work.
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

meowmix

  • Bay Watcher
    • View Profile
Re: how do i make an area unpassable
« Reply #3 on: April 21, 2011, 12:26:20 am »

what does the traffic cost mean? the wiki doesnt really explain it very well
Logged

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: how do i make an area unpassable
« Reply #4 on: April 21, 2011, 12:29:14 am »

Dwarves take the shortest path between where they are and where they're going. For this purpose, each tile counts as 2 spaces. The "restricted" traffic designation makes tiles count as 25 spaces. So if you have two tunnels of the same length, one normal and one designated as restricted, a dwarf will think the restricted one is 12.5 times longer than the normal one and take the normal one.
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

TurnpikeLad

  • Bay Watcher
  • maybe this time
    • View Profile
Re: how do i make an area unpassable
« Reply #5 on: April 21, 2011, 12:31:12 am »

So when a dwarf wants to go to a certain tile, they'll count up the length of a bunch of different possible paths to the tile then take the shortest path.  The traffic designations make a path crossing whichever areas you designate count as a much longer path than it really is, for the purpose of choosing which path to go down.  But if your dwarf ends up choosing that path anyway, they'll get there just as fast as normal, of course.
Logged
Adon * Amil * Orethan

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: how do i make an area unpassable
« Reply #6 on: April 21, 2011, 02:51:16 am »

Also the "H" (high traffic) zone makes the tile path cost to be one, so you could use it to make "highways", err... I meant roads where most dwarves will go instead of cutting corners. It's useless in most cases, but it allows you to make eye-pleasing fortresses where dwarves walk on roads instead of roaming through various appendages and workshops.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: how do i make an area unpassable
« Reply #7 on: April 21, 2011, 08:04:00 am »

i remember in the older versions i could paint a zone in an area that basically forbids passage for my dwarves. is this still possible to do?

What version was that?  I don't remember that feature being in any version of DF.

The only way to forbid movement through an area at the moment is to physically make that area impossible to reach.  Burrows don't block movement, they just make items and buildings outside the burrow forbidden, but dwarves will still walk outside the burrow to get from one part of the burrow to another.  Traffic zones don't control where dwarves go, they just help the pathfinding code figure out which path to take to get somewhere.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

Niseg

  • Bay Watcher
    • View Profile
Re: how do i make an area unpassable
« Reply #8 on: April 21, 2011, 08:19:54 am »

what does the traffic cost mean? the wiki doesnt really explain it very well

I can actually show you what it means since my simulator started supporting it
This is the maze is a variation of double comb (a maze that misleads A* consistently) with clear path to target. : big picture of 6 mazes I captured:
Spoiler (click to show/hide)

unfortunately I don't generate links with traffic information yet...

Maze A is basic with normal traffic everywhere . The path you get is in maze B (drawn in Cyan). 15 node search path length 10 is pretty optimal. If you do Maze D with 1 restricted traffic zone you'll get the same Path as B  but it went through 46 nodes to find it because you confused it with a restricted traffic zone.

Maze C has 2 spots of restricted traffic which effectively tells it - go around. You can get the same result by taking maze D and adding high traffic area along the path around - you'll see that in maze E. Maze F shows you the result of pathing through maze E. You'll notice that the visited nodes (indication of complexity) is lower than maze C due to the high traffic.

If you paint the short path and deadend red maze red (R traffic) you'll get a pretty good result of 46 node visit to go around. This would  make the pathfinding algorithm  "understand"  that there is now way to go through deadends. . A* has tunnel vision and it generally won't give up until it goes through every node in the map - they can cause the game to slow down if it implements pure A*.

PS if you want to play with traffic use the  " Find path A* traffic" button , you should click the traffic checkbox at bottom i also sugest changing the tool to line->rect  empty->filled by clicking on them.
« Last Edit: April 26, 2011, 01:45:38 am by Niseg »
Logged
Projects:Path finding simulator(thread) -A*,weighted A*(traffic zones), user set waypoints (path caching), automatic waypoint room navigation,no-cache room navigation.

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: how do i make an area unpassable
« Reply #9 on: April 21, 2011, 09:00:03 am »

What's the difference between using the heuristic as-is (which assumes path cost 1, which is high traffic zone) and using one that assumes normal traffic zone (current heuristic times 2)?
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

Niseg

  • Bay Watcher
    • View Profile
Re: how do i make an area unpassable
« Reply #10 on: April 21, 2011, 09:23:06 am »

What's the difference between using the heuristic as-is (which assumes path cost 1, which is high traffic zone) and using one that assumes normal traffic zone (current heuristic times 2)?

My simulation uses H=1,N=2,L=10,R=25 I think those are defaults for DF , right? I'll add an option to change the weights soon ;D.

Simulating DF was not the real purpose of this program It was more for showing alternatives for pure A*  (real path finding suggestions rather than theoretical ones). I added weighted searches after I modified the A* code to handle edges rather than neighbors. Adding traffic was fairly easy but it won't stop A* from snooping around even if you lead it all the way with high traffic zones.  Traffic zone just makes this tool more useful than just a demo platform.
Logged
Projects:Path finding simulator(thread) -A*,weighted A*(traffic zones), user set waypoints (path caching), automatic waypoint room navigation,no-cache room navigation.

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: how do i make an area unpassable
« Reply #11 on: April 21, 2011, 11:36:05 am »

I meant changing the heuristic, not the cost. See the picture I did before:
(using a heuristic of 1 per tile but a cost of 2 per tile makes it search like this):

(in each tile is two numbers, the left number is cost and the right is heuristic)
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

Niseg

  • Bay Watcher
    • View Profile
Re: how do i make an area unpassable
« Reply #12 on: April 21, 2011, 12:24:45 pm »

The heuristic is a pure vector magnitude ,sqrt(x2+y2) so it's about 1 per step or less. If you have any suggestions you should add them to my thread ;), I changed the step costs from a sqrt(2) for diagonal and 1 for verticals and horizontal to  1 for all on the unweighted A*. I can double the return value of the heuristic which would make the stepping cost 2 for each which might give better results on weighted A*.

I'm sure there are more optimizations like inserting nodes in order etc but efficiency is not a big factor. I'm more interested in implementing in complexity reduction. My waypoint-room system (just started it so it's not done)reduce a high complexity A* 32X32 to a 4X4 A* between the rooms and then 2 a* on 8X8 grids . In one of my examples it reduce node visits from 800~ to 25 .  The extra advantage (after I check for it) is that when there is no path the penalty is 42 instead of 322

Anyways I think my traffic zone examples show how traffic work even if my implementation is not yet optimal.

edits: fixed a dead link, I also added option to double heuristic output - seems to work well with traffic (not sure how it is in game)
« Last Edit: April 26, 2011, 01:51:17 am by Niseg »
Logged
Projects:Path finding simulator(thread) -A*,weighted A*(traffic zones), user set waypoints (path caching), automatic waypoint room navigation,no-cache room navigation.