It takes Civ. 5 longer than Civ. 4 to find the shortest path between two spots?

Gary King

Prince
Joined
Dec 24, 2005
Messages
300
I'm surprised to find that it seems as though Civ. 5 takes longer than Civ. 4 to find the shortest path between two spots. What I mean is, if I select a unit in Civ. 4, then right-click a tile that's really far away, then it can instantly calculate the shortest path between the two and tell me that it's, say, 30 tiles away.

In Civ. 5, however, I immediately noticed that after selecting a unit then right-clicking on a tile—it doesn't matter whether it's near or far—then the game takes a noticeable second or two to generate the shortest path between the two spots. During this moment, the circle on the spot I wish to go to is red to indicate that no path is available. After the moment, the circle turns to white and the shortest path is shown between the two points.

So, the game eventually figures things out, but shouldn't this be instant, as it is in Civ. 4? Is it due to the hexagons that it takes longer to calculate paths? I'm not running on a slouch of a computer, though! I can play most games, including Civ. 5, at 1920 x 1080 with high graphics settings without any hiccups.

Could someone please shine some light on this issue? I stopped playing Civ. 4 a few months ago but decided to jump back into Civ. 5 just recently, and overall it's been a pretty good experience, but minor things such as this seem quite strange to me. Thanks in advance!
 
I've noticed this when crossing over water. I think it takes the game a minute to realize it can embark or something.
 
I've noticed this when crossing over water. I think it takes the game a minute to realize it can embark or something.
I have this problem even when simply crossing from one grassland tile to another grassland tile. I haven't even tried crossing bodies of water yet—I should go check that out!
 
Maybe it has to do with the 'no two units on one tile' issue making the algorithm difficult to compute or something.
 
Maybe it has to do with the 'no two units on one tile' issue making the algorithm difficult to compute or something.

Still; pathfinding like that by the computer should require less effort than doing a lot more graphic-intensive stuff.
 
Yes, there's something really not right with the pathfinding algorithms in Civ5, they don't even work all the time, as I showed in these screenshots.

Maybe it has to do with the 'no two units on one tile' issue making the algorithm difficult to compute or something.

It shouldn't, as far as I can tell, it just treats other units as impassable tiles, same as mountains. The only reason it should do otherwise is to coordinate movement with your own units, which it doesn't do, as you can see by trying to move several units along a single road at different speeds and in different directions.


The only thing that's more complex than civ4 is the ZOC, which should not introduce the kind of delay we're seeing.

The delay is even noticable for single-turn movements, which I can't think of any excuse for.

Still; pathfinding like that by the computer should require less effort than doing a lot more graphic-intensive stuff.

Path-finding is straight-up CPU work, and pretty basic computer science material, graphic-intensive stuff is mostly GPU work, so they don't really overlap in performance requirements.
 
I'm surprised to find that it seems as though Civ. 5 takes longer than Civ. 4 to find the shortest path between two spots. What I mean is, if I select a unit in Civ. 4, then right-click a tile that's really far away, then it can instantly calculate the shortest path between the two and tell me that it's, say, 30 tiles away.
That's kind of weird. Each cell in civ 4 has 8 neighbours whereas each cell in civ 5 has 6 neighbours. Without thinking much on the algo, the search space for civ 5 should be smaller.
 
The computer wasn't always right in Civ 4, I think it's just figuring a lot more possible paths and picking the shortest, even though 99% of the time it'd come up with the same path as computing 1/10th as many paths.

That's one of those optimization issues, where sometimes more precision really isn't necessary, but people often don't care and do it anyways, because hey, computers are really fast now! We don't need to optimize!
 
Top Bottom