Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Military pathing problem  (Read 868 times)

Chief10

  • Bay Watcher
  • since 31
    • View Profile
Military pathing problem
« on: July 21, 2015, 07:21:03 am »

I keep having this problem where my military dwarves will inexplicably end up dead in the river outside my city walls. I made a post about it here:

http://www.bay12forums.com/smf/index.php?topic=149927.msg6242115#msg6242115

and it was never really resolved. I had assumed that there were fliers that would scare them off the walls, or that they were training and they would dodge of the wall.

But just today I watched 2 speardwarves just walk in a straight line, right off the edge of a not yet completed wall. I had just set the squad to "move" in my courtyard. These 2 dwarves who were on my walls went the opposite direction of the staircase and just walked straight to their deaths. There is literally no reason they would do this. There was no military equipment outside my walls, and if they somehow survived the fall into the river, there was no path from there back inside my fort (it was sealed from the outside at the time).
So what gives? Is pathing really this broken? Any way to prevent this?
Logged

Loci

  • Bay Watcher
    • View Profile
Re: Military pathing problem
« Reply #1 on: July 21, 2015, 01:52:58 pm »

In the previous thread you ignored the request for a screenshot of the problem. With a game as complex as Dwarf Fortress, "shotgun" debugging isn't a very effective way to resolve issues. If you want help, a screenshot and/or saved game will greatly increase the chance that someone can figure out what's going on.
Logged

Chief10

  • Bay Watcher
  • since 31
    • View Profile
Re: Military pathing problem
« Reply #2 on: July 21, 2015, 02:43:13 pm »

Ah ok, I missed that in the last thread.

http://imgur.com/BnvJODh

The blue line shows where the river is (5 z levels down). The red error points to the spot where they walk off the wall. The green star is where I ordered them to move to (4 z levels down).
Logged

LordUbik

  • Bay Watcher
    • View Profile
Re: Military pathing problem
« Reply #3 on: July 22, 2015, 12:20:39 pm »

They probably tought that climbing down the wall was a more efficient path to their destination.  Climbing has screwed up pretty badly pathfinding.
Logged

Loci

  • Bay Watcher
    • View Profile
Re: Military pathing problem
« Reply #4 on: July 23, 2015, 03:27:27 pm »

Also, dwarves who path into another dwarf in a narrow hallway will repath halfway across the map to avoid having to share a tile. This rerouting uses "jump/climb" pathing, so dwarves have been known to try to climb out of deep pits or jump across trees. To avoid this "feature", make sure all your pathways are at least 2 tiles wide. 
Logged

Numeroid

  • Bay Watcher
  • Back after a long hiatus.
    • View Profile
Re: Military pathing problem
« Reply #5 on: July 24, 2015, 04:12:12 pm »

Can't you forbid certain areas? Do military orders override such forbidding?
Logged

Sanctume

  • Bay Watcher
    • View Profile
Re: Military pathing problem
« Reply #6 on: July 24, 2015, 04:44:30 pm »

Can't you forbid certain areas? Do military orders override such forbidding?

You can forbid areas using active burrows, but active military ignore burrows on move or attack.

You can also add value to paths using restricted, low, normal, or high traffic designations.

Hesperid

  • Bay Watcher
    • View Profile
Re: Military pathing problem
« Reply #7 on: July 24, 2015, 08:34:59 pm »

I've done some research on pathfinding with the new climbing system because of a large number of military deaths I've started getting from elevated firing positions (among others). This is what I've found.

Normally your citizens and military will never climb or jump and will in fact report a job as incompleteable rather than use a climbable path to it.

I'm sure this is intended behavior. The reason for this is that there's an initial pathfinding process that only accept classical routes (i.e. walkable routes that do not go past locked or forbidden doors). If this pathfinding succeeds then the creature gets its goal set and a path is stored for it to follow. If it doesn't then the job gets cancelled.

The creature getting a set goal engages a second kind of pathfinding

So you know how creatures getting blocked from going a route they want to go can get that question mark on their heads and then they select a different route to their destination? Or when they're in a crowded hallway they start performing a shuffle past each other? They're doing alternate pathfinding. This part of the game's programming basically makes the assumption that if the creature got a set goal, the goal is in a sensible (generally walkable) location. Sometimes this isn't true. The strangeness is that this alternate pathfinding *does* make use a creature's ability to climb and jump and will path them over walls and in tree branches and stuff.

Combat overrides job pathfinding

Military units sometimes receive a goal that guides them to the nearest enemy unit. This often happens to missile units that run out of ammunition. What then happens is that the unit, instead of standing still because it can't path to the enemy unit, gets alternate pathfinding to the enemy unit which generally means climbing and jumping out of their cover to them. Unfortunately there are sometimes falls involved leaving your soldiers in the middle of an enemy squad, outside your walls, and stunned from the fall (and therefore defenseless). This typically kills the military unit. The same thing also causes babies without mothers to carry them to goal outside your fortress walls which typically means they climb over your walls and up chimneys to get snatched.

The same applies to enemy units. I always play surface fortresses because of the challenge (that's why I'm experiencing all these fall deaths, my archers are in arrow towers etc.). And enemies usually stay nice and docile outside even a 1 z height wall. But if the leader of the squad just happens to get a 'goal' inside your fortress then they will climb up and down branches over your walls and all their squadmates will also alternate pathfind to get to their leader, bringing the whole squad over your walls.
Logged