Rare pathing bug

rychan

CS geek
Joined
Feb 29, 2004
Messages
160
Location
Pittsburgh, PA
Hi, I've only had this happen to me a few times, and it's not terribly major. It probably only occurs with railroads.

I was trying to move a settler to another city. He had to go through 3 road squares then hop on a railroad. I used the mouse to direct the move, it correctly told me 2 turns, let go, and for the last move of his first turn he got off of the road on to a mountain. So now it will take him 3 turns, because he'll waste a turn getting on to the railroad.

I bet there is a bug somewhere in the shortest-path calculations. I assume dynamic programming / dijkstra's algorithm is used on a table / graph with the weights equaling the movement costs. I bet that the railroad having 0 weight introduces an error somewhere in there. Obviously this has been worked around in most cases, but there are some rare cases where it is not handled correctly.

I don't have the save game any more so I can't show you the exact instance.

(or my speculation could be wrong. I'd imagine the railroad movement cost is in fact some epsilon > 0. Maybe the bug comes in relation to cost of transitioning between road types, or comes from the way paths are discreetized in to turns)
 
Can you upload a save showing this?
 
Yeah I'll try and look for it when I get a chance. Maybe tomorrow night. No time for Civ now.

(always time to read message boards while at work, though)
 
Top Bottom