Ports and pathfinding

If you find a bug please report it here

Ports and pathfinding

Postby Experix » Sat Jan 12, 2013 6:24 pm

The algorithm somehow avoids ports, it shows my water-walking hero the path around it, although the direct path throgh the port is two points cheaper.
Experix
 
Posts: 129
Joined: Wed Jul 04, 2012 8:39 am

Re: Ports and pathfinding

Postby KGB » Wed Jan 16, 2013 10:40 pm

I just noticed something similar with Sea Serpents.

If I select a Sea Serpent and click directly on a river port (river square with docks on both sides) the cost is reported to be 1 to move to that square as opposed to 2 when moving on a regular river square.

If I select a Sea Serpent and click on a river square that would mean passing through a river port and there is an alternate way around (swamp surrounding the river) then the path generator will select moving through the swamp (cost 2) rather than through the port (cost 1). What I mean is this:

ssssssss
XrrrPrrrrY

X = my Serpent. Y = destination r = river, P = river port, s = swamp.

The path generated is rrrsrrrrY. This indicates the path generator thinks the river port cost is not 1.

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am

Re: Ports and pathfinding

Postby SnotlinG » Thu Jan 17, 2013 12:37 pm

1. Yes the algorithm is trying to avoid ports, as units are generally affected by them and are better off not moving through them unless they have to (as to change to/from ship).
Maybe I need to imrpove the algortihm a little bit, but is kind of complex with the ports unfortunately.


2. Yes, same thing here, Ports are avoided, so thats why you can get that result. Its not optimal and maybe I can improve/finetune it a bit. (especially for seacreatures).
However, looking at your example it is strange that seacreatures should only pay 1 for moving on ports, so it has been increased to cost 2 for seacreatures (as well as move on bridge or fjord tile).
SnotlinG
 
Posts: 2148
Joined: Sat Feb 13, 2010 12:42 am

Re: Ports and pathfinding

Postby KGB » Thu Jan 17, 2013 5:14 pm

SnotlinG,

No need to do anything about #1 now that you've done #2 (which makes sense).

KGB
KGB
 
Posts: 3030
Joined: Tue Feb 16, 2010 12:06 am


Return to Bug reports

Who is online

Users browsing this forum: No registered users and 40 guests

cron
Not able to open ./cache/data_global.php