Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Experiment results for pathing out of water  (Read 5651 times)

Nkosi_SW

  • Bay Watcher
    • View Profile
Experiment results for pathing out of water
« on: September 22, 2012, 03:31:23 am »

In a previous thread I presented a problem I had with my dwarves pathing out of water, and I ended up doing an experiment to shine some light on the limits of dwarven pathing out of water.  I'm posting the results here for comment and criticism, and if there are no serious flaws indentified in the experiment, I'll incorporate the findings in to the wiki page on Swimming in a few days.

Problem
Dwarves would not follow a long, snaking path through water to reach dry land, though they would use a similar shorter path.

Experiment
Create a system to allow paths of variable length to be created to find if there is a consistent maximum path length through water.

I built a simple structure on the bones of my old, non-functional lap pool that would allow doors to be set to be passable or forbidden to create a path differing in length by increments of 1.

Testing area Z1:
Spoiler (click to show/hide)

Testing Area Z0:
Spoiler (click to show/hide)

Initially the system used danger room dodging to get a group of military dwarves (test subjects 1, 2 and 3) to repeatedly fall in to the water.  For later testing, a structure was build on to the north side of the danger room area to allow testing of civilian dwarves by dropping them through a hatch when they came to construct or deconstruct a wall.

All exit doors were closed, and once a dwarf was in the water, a test would begin.  For each run, a door one square closer to the dwarf would be opened, and I'd wait for ten seconds.  If the dwarf used the exit, that test was complete, the doors would be forbidden again and the next test would start.

Results
Spoiler (click to show/hide)
  • Subjects 1,2 and 3 were legendary super soldiers, all Skilled Swimmers
  • Subject 4 was a legendary slightly-less-super soldier, Novice Swimmer
  • Subject 5 was an architect with no real military skills and no swimming skills
  • Distance is the North-South, Diagonal and East-West movements a dwarf had to make to exit the water, not counting the final movement on to dry land.
  • Total distance is the sum of N-S, E-W and Diagonal movements, using a multiplier of 1.4 for the diagonal movements.
  • A "Y" in the "Exited" column indicates they left the water on this run.
  • A "Y" in the "Tried Others" column indicates other, longer distances were tried first before this exit was made.  On some tests a door was still open from previously. Those exiting results do not have a "Y" in "Tried Others" and are not as meaningful.
  • The total distances the dwarves covered when exiting the pool are highlighted in yellow.

Conclusions
A dwarf will cover a distance of 20.2 or less to exit water, but will not cover a distance of 20.8 or more.

Possible Shortcomings of Test
  • Human error - I was counting squares by moving the cursor.  This may or may not account for the result of 23.2 in Test 3
  • The test facility was not ideal, because I couldn't be arsed building a specialised facility from scratch.
    • Alternate exits being on different sides seems a bit dodgy to me, in case something about the path after they exited the water influences the result, though it seemed not to in the end.  At least in tests 1 to 13 the dwarves were dodging in to the water, so they would start from different squares.  In those tests, exit paths of the same length were sometimes to the east or sometimes to the west.
    • The exit path doing a u-turn.  Though none of the exit paths were ever beyond the initial straight South to North section, so hopefully that was not a factor.
  • All the exit paths were all in the same direction.  It would be nice to check if orientation to the rest of the fortress had any effect.
  • Tested only in standard circumstances.  What are the effects of having enemies around, the dwarf being injured etc?
  • Fairly small sample of dwarves as test subjects, with relatively narrow range of swimming skills.
  • More tests are always betterer.

Proposed Action
Add a passage to the swimming page on the wiki saying something along the lines of "Dwarves will generally leave the water if they can find a path out of around 20 length or less.  If they can't find an exit within that distance, they'll just sit in place and wait (or drown)."

If anyone would like to confirm or invalidate these results, that would be great.
« Last Edit: September 22, 2012, 03:35:39 am by Nkosi_SW »
Logged

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Experiment results for pathing out of water
« Reply #1 on: September 22, 2012, 04:09:01 am »

...
Proposed Action
Add a passage to the swimming page on the wiki saying something along the lines of "Dwarves will generally leave the water if they can find a path out of around 20 length or less.  If they can't find an exit within that distance, they'll just sit in place and wait (or drown)."

If anyone would like to confirm or invalidate these results, that would be great.

I tested this in the arena pool with a long line of dwarves (all on the same team) extending from the ramp at the water's edge outwards. The dwarves that were 20 tiles or less from dry land tried to move there (while floundering in the water) while the ones further away didn't move at all. Very few made it to shore since they were only dabbling swimmers.

Zivilin

  • Bay Watcher
  • Dwarven Science Division
    • View Profile
Re: Experiment results for pathing out of water
« Reply #2 on: September 22, 2012, 03:38:28 pm »

If I understand it correctly, for a completely diagonal pool the pathing limit for dwarves in water would be 20/1.4 = 14 tiles?

In any case, good work! I'm going to force-teach my current fortress swimming using your training pool design.
Logged
No signature

Nkosi_SW

  • Bay Watcher
    • View Profile
Re: Experiment results for pathing out of water
« Reply #3 on: September 22, 2012, 04:13:46 pm »

I tested this in the arena pool with a long line of dwarves (all on the same team) extending from the ramp at the water's edge outwards. The dwarves that were 20 tiles or less from dry land tried to move there (while floundering in the water) while the ones further away didn't move at all. Very few made it to shore since they were only dabbling swimmers.

That's great.  Thanks heaps for the confirmation.

If I understand it correctly, for a completely diagonal pool the pathing limit for dwarves in water would be 20/1.4 = 14 tiles?

In any case, good work! I'm going to force-teach my current fortress swimming using your training pool design.

Yeah, that's correct.  14 tiles for a completely diagonal path.  That's the diagonal pathing cost in general in DF: square root of 2 which is around 1.4.

I'm finding this danger room swimming training method works well.  The old method of washing a meeting area over a ledge into a pool is fairly dangerous now that falling damage has increased.  This way you can maintain a more consistent water depth under the falling area, which so far has resulted in no injuries for my dwarves.
Logged

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Experiment results for pathing out of water
« Reply #4 on: September 23, 2012, 01:29:17 am »

Has anybody tested to see if water level has any effect on this? I see in your picture that it looked like you has a variance of 5/7 and 6/7 tiles, but has anybody tried it with straight 5/7, 6/7, or 4/7 tiles? It would be interesting to know if the pathfinder can track farther over "less dangerous" tiles then "more dangerous" ones.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Nkosi_SW

  • Bay Watcher
    • View Profile
Re: Experiment results for pathing out of water
« Reply #5 on: September 23, 2012, 02:00:44 am »

In my previous lap pool design, the water depth appeared to make no difference when I tried all 7 depth, mixture of 6 and 7, mixture of 4 and 5, and all 4.  But that was without testing various path lengths by increments of one.

From what Urist Da Vinci said about very few of his dwarves making it to shore, I presumed they were in 7 depth water, and that got the same result.

My guess would be that it doesn't make any difference, but I can't say for sure.  We can add variable water depth as another shortcoming of this test.  I agree it would be interesting to know definitively if it makes a difference.
Logged

Nkosi_SW

  • Bay Watcher
    • View Profile
Re: Experiment results for pathing out of water
« Reply #6 on: September 24, 2012, 05:47:44 pm »

Thanks to everyone for their input, especially Urist Da Vinci for his testing.

I've updated the Swimmer page on the wiki with the results.
Logged