Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [40c] Deadlocked wagons.  (Read 735 times)

Tayrin

  • Bay Watcher
    • View Profile
[40c] Deadlocked wagons.
« on: September 06, 2008, 02:21:48 pm »

I imagine that this would probably be classified as an oversight rather than a bug; and I expect it probably wouldn't have a simple fix, save for allowing wagons to travel directly through each other, which would be unrealistic.

I had just traded with the human caravan. When the human wagons had almost left my site, the dwarven caravan arrived. Since I had deliberately fashioned the region into having only one three-tile path of access from the edge of the map available at the time, both sets of wagons were on the same path travelling in opposite directions, and thusly clashed head-on into each other.

The wagons remained deadlocked like this for some time, and the arriving wagons never reached the depot to unload their goods. Eventually I widened the path to let the obstructed wagons pass each other, but it appeared at that point that the arriving wagons were already deciding to leave the site, as they never advanced any further and all wagons had soon left.

If the leaving human wagons had been able to travel back towards the depot for around thirty tiles or so, they could have moved onto an alternate path and allowed the arriving dwarven wagons to pass. However, I imagine it would probably be a pain to code this sort of pathfinding foresight reliably.

In the meantime, I expect pretty much all situations like this could be averted by altering all my three-tile wagon access paths into four-tile paths, so that wagons have space to pass each other. Thus, it probably won't really be a problem again; I just thought I'd better report the occurrence since I couldn't find any mention of it elsewhere.
Logged

Proteus

  • Bay Watcher
    • View Profile
Re: [40c] Deadlocked wagons.
« Reply #1 on: September 06, 2008, 02:42:48 pm »


If the leaving human wagons had been able to travel back towards the depot for around thirty tiles or so, they could have moved onto an alternate path and allowed the arriving dwarven wagons to pass. However, I imagine it would probably be a pain to code this sort of pathfinding foresight reliably.


The pathfinding for dwarves seems to inclue such a thing. If 1 tile hallways are too obstructed by other dwarves and there is an alternative route, they will turn around and try to take the alternative route.
But it might be a question of the distance of alternative pathways. Maybe it is implemented in the wagons as well but takes into account only alternative routes that are less than 30 tiles away
Logged

Tayrin

  • Bay Watcher
    • View Profile
Re: [40c] Deadlocked wagons.
« Reply #2 on: September 06, 2008, 02:57:04 pm »


If the leaving human wagons had been able to travel back towards the depot for around thirty tiles or so, they could have moved onto an alternate path and allowed the arriving dwarven wagons to pass. However, I imagine it would probably be a pain to code this sort of pathfinding foresight reliably.


The pathfinding for dwarves seems to inclue such a thing. If 1 tile hallways are too obstructed by other dwarves and there is an alternative route, they will turn around and try to take the alternative route.
But it might be a question of the distance of alternative pathways. Maybe it is implemented in the wagons as well but takes into account only alternative routes that are less than 30 tiles away

I believe you're right, but I'm sorry; I should clarify. When the wagons became deadlocked, there was no alternate exit from the map available to them. If the wagons trying to leave had backtracked the thirty or so necessary tiles, they would then have then had to wait for the arriving wagons to pass them before once again attempting to depart using the same path they were previously obstructed from using.

It would be somewhat akin to a person backtracking in a narrow passage to move into an alcove, in order to allow something else to pass, before stepping out of the alcove and continuing along the passage. The fact that it would be difficult to determine a clear destination for wagons to backtrack to is the reason I suspected it would be a nuisance to code.
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: [40c] Deadlocked wagons.
« Reply #3 on: September 11, 2008, 10:46:39 pm »

Okay, I'll note it down.  Generally, they were supposed to avoid this situation by coming and leaving within a season, but they can have trouble with this.
Logged
The Toad, a Natural Resource:  Preserve yours today!