Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Preventing drowning in thawed rivers  (Read 1907 times)

sadron

  • Bay Watcher
  • Manic Asphyxiation
    • View Profile
Preventing drowning in thawed rivers
« on: August 28, 2012, 04:49:26 pm »

So I just lost a dwarf some time after the river thawed that he was fishing on top of. I only just found out when I came upon his gear at the bottom of the river. Can any of you guys tell me how to perhaps forbid them from walking on the ice and instead going around like on the bridge I constructed?
Logged

darkflagrance

  • Bay Watcher
  • Carry on, carry on
    • View Profile
Re: Preventing drowning in thawed rivers
« Reply #1 on: August 28, 2012, 04:54:14 pm »

Build a wall on the river bank.
Logged
...as if nothing really matters...
   
The Legend of Tholtig Cryptbrain: 8000 dead elves and a cyclops

Tired of going decades without goblin sieges? Try The Fortress Defense Mod

sadron

  • Bay Watcher
  • Manic Asphyxiation
    • View Profile
Re: Preventing drowning in thawed rivers
« Reply #2 on: August 28, 2012, 04:58:42 pm »

Build a wall on the river bank.
Really the only way? :/ Will they still be able to fish?
Logged

crazysheep

  • Bay Watcher
  • [PREFSTRING:fluffy wool]
    • View Profile
Re: Preventing drowning in thawed rivers
« Reply #3 on: August 28, 2012, 05:03:34 pm »

If you wall off the river bank then no, but you can build a raised platform and try defining a fishing zone to let them fish.
Logged
"Don't be in such a hurry to grow up, for there's nothing a kid can't do."

doublestrafe

  • Bay Watcher
  • [PONY_DEPENDENT]
    • View Profile
Re: Preventing drowning in thawed rivers
« Reply #4 on: August 28, 2012, 05:13:43 pm »

The first thing I do on every map is mark the surface of every body of water Restricted traffic, including lots of extra space at the ends of rivers AND the bottoms of said river-ends, so they'll go across the damn bridge (marked High) instead of crossing ice or fording deltas. Between that, designating appropriate fishing zones, and making sure in 'o'rders that they only fish in fishing zones, you will still probably lose the occasional stupid dwarf. Such is Dwarf Fortress.

I really want a dfhack plugin to mark the surfaces for me. It takes forever.
Logged

swordsmith04

  • Bay Watcher
  • Communist Gnome
    • View Profile
Re: Preventing drowning in thawed rivers
« Reply #5 on: August 28, 2012, 05:21:00 pm »

You can use the traffic designations to make them prefer the bridge. Restrict the river, and edit restricted tiles to have a cost higher than 25 - some arbitrarily high number. Wiki link

Edit: ninja'd. Have a wiki link anyway...

Loud Whispers

  • Bay Watcher
  • They said we have to aim higher, so we dug deeper.
    • View Profile
    • I APPLAUD YOU SIRRAH
Re: Preventing drowning in thawed rivers
« Reply #6 on: August 28, 2012, 05:21:56 pm »

I just remembered why I like brooks more. Traffic designations on rivers take forever D:

WJLIII3

  • Bay Watcher
    • View Profile
Re: Preventing drowning in thawed rivers
« Reply #7 on: August 28, 2012, 06:16:10 pm »

You can use the traffic designations to make them prefer the bridge. Restrict the river, and edit restricted tiles to have a cost higher than 25 - some arbitrarily high number. Wiki link

Edit: ninja'd. Have a wiki link anyway...

Arbitrarily high isn't good, pathfinding will still calculate all those routes
Logged

swordsmith04

  • Bay Watcher
  • Communist Gnome
    • View Profile
Re: Preventing drowning in thawed rivers
« Reply #8 on: August 29, 2012, 09:17:33 am »

From what I understand of the way pathfinding works, the game won't calculate routes through restricted tiles when there is a 'shorter' route. Even if it's technically 7 tiles to cross a river, and the bridge is 30 tiles out of the way, if the restricted tiles are set to cost more than 130, pathfinding should ignore the restricted tiles. The dwarves tend to go the shortest route; if the river is 5 tiles wide and each of those tiles is set to cost, say, 200, then the trip around the bridge, at 130, is shorter than the first step onto the river at 200. The bridge route would have to have a pathfinding cost of 200 or more before the dwarves started considering the river. The 'arbitrarily high number' would be a lot higher than 130, so the dwarves wouldn't even consider stepping out onto the river. If you've got a link proving my understanding of pathfinding wrong, please post it.

PetWolverine

  • Bay Watcher
    • View Profile
Re: Preventing drowning in thawed rivers
« Reply #9 on: August 29, 2012, 09:50:06 am »

swordsmith04 is correct. More information about pathfinding can be found on that other wiki: http://en.wikipedia.org/wiki/A*_search_algorithm. It would be nice if there were traffic designations for "impassible", but no matter how long the path over the bridge, there is a cost high enough that if you set your "restricted" cost to that, they will take the bridge rather than the river.

Unfortunately this limits your options for traffic designations for the rest of your fort, since, e.g., setting a cost of 65000 for stepping into your underground forest will make pathfinding very costly when you actually want to chop trees. The only other options involve walls, but you can leave the river usable for fishing and drinking if you put the wall down the middle:

Code: [Select]
.=W=.
.=W=.
WWWWW
.BBB.
.BBB.
.BBB.
WWWWW
.=W=.
.=W=.

Ground: .
River:  =
Wall:   W
Bridge: B

The walls lining the bridge ensure that the other walls don't fall if the bridge is retracted/raised. Going around corners could be tricky, but remember it's more important to block the path across the river than to leave every water tile usable.

This could be built either during the winter (making sure to finish or suspend construction before the thaw) or by covering the river edges with floors first, then removing the floor.
Logged