the3dfxdude / 7kaa

Seven Kingdoms: Ancient Adversaries - Go to the main source repository at https://sourceforge.net/projects/skfans/ for source code and builds
https://7kfans.com
Other
254 stars 72 forks source link

path finding issues #249

Closed watery closed 1 year ago

watery commented 2 years ago

I can't tell whether this started with the latest release, or was already present before - I had the previous release too. But certainly, recent games had picked up several maps that showed the issue, hence I'm facing it more frequently than before.

I.e.: immagine

The selected caravan is stuck on that coast, while it should obviously go down, around the gulf coast - this is on map id 740 254 790.

Many other times, instead, it is easy to see units that try to cut short toward their destination arriving at a land border that's a few tiles away from the other border, but they can't go further due to the sea. They then find an alternative path, and go back for another route.

watery commented 2 years ago

Just got another caravan that's approaching the same spot, while it should go to a market in the villages up left:

immagine

the3dfxdude commented 2 years ago

Was that seed number taken from a loading a save game? That isn't the actual seed number. That number is not preserved correctly if so. So I don't have this map to work off of. I did watch another game and saw some stuff, but I didn't see a severe issue. I'll need another test case.

When sharing a seed number, it must be a freshly generated map, and also please tell me the land mass size.

watery commented 2 years ago

Was that seed number taken from a loading a save game? That isn't the actual seed number. That number is not preserved correctly if so.

I should have been, I'm sorry I've probably mistyped it.

However I found another candidate: 864306854 - land mass is small

But this time I got a savegame too. When loaded you should have this caravan selected, going to the wrong direction:

7kaa-caravan-path

I didn't have a chance to check whether other units show the same behaviour, though.

7kaa.zip

the3dfxdude commented 2 years ago

Hmm I'm not sure. I looked at it and saw the issue in the save file. But then I was able to order the camel out and then it went back and forth between the markets just fine.

Then I tried just regenerating the game map and ordering units between the farthest points. Worked fine.

Possibilities:

  1. A limit was hit on the total processing path resources and stopped the path short at the furthest point that could be reached. There are limits built into the game, probably for good reason, that I have not explored. It is fairly easy to clear and repath if it ever happens?
  2. The path was temporarily blocked, and the camel repathed to the closest it could reach. Like if you tried to move across islands, but that is impossible, so it just goes in that general direction. Again, reissuing the order to clear out the path is enough.
  3. This could be caused by other issues that used to be in the game as of 2.15.5, but now are fixed. It could be that it isn't a path finding bug, but a unit issue that was invisibly blocking the path somewhere again. It might be fixed in 2.15.6? Anyway, there has been sort of related things fixed.

I'm not seeing a path finding issue. Again, how to trigger this?

the3dfxdude commented 1 year ago

It may be that the exact triggering condition in the path finding system was lost when the game is saved and reloaded. This is evidenced of the issue was cleared up on my end quite easily.

It would probably be better to trigger the issue in a multiplayer game, and save the replay and send over. Then the exact sequence of events that bring things to the point of failure can be reproduced.

the3dfxdude commented 1 year ago

The Map I.D. 913174790 medium land mass seems pretty problematic, but only because there is truly a choke point. That's not really a path-finding problem. But it could be something you can try to see if your problem is reproducible there.

JanRossler commented 1 year ago

Possibilities:

  1. A limit was hit on the total processing path resources and stopped the path short at the furthest point that could be reached. There are limits built into the game, probably for good reason, that I have not explored.

From my experience, that seems the most likely cause. I see this happening every game at some point once enough stuff is going on.

It is fairly easy to clear and repath if it ever happens?

This is generally not at all possible unless you save & reload the game or reduce the usage of processing path resources. Clearing and repathing will simply result in the wrong path again. Once the limit is reached, it breaks pathing of all units on the map persistently.

I will also note that AI pathing seems to suffer from the same problem, it is not unique to human players. For example, here is a screenshot where AI ships get stranded in the middle of the ocean forever, because their path did not get calculated further. While land units typically at least attempt to calculate the next path segment automatically, ships tend to completely stop at the furthest calculated point and not move again unless directly ordered.

pathing_stuck

the3dfxdude commented 1 year ago

Thank you for reporting the issue. I have your test case, and some of my own. I did fix some path finding issues as of late, but I believe the original report still needs more investigating.

Tracking this issue has been moved over to the 7kfans forums, as I am migrating off of github. You are also welcome to visit the sourceforge page.

https://7kfans.com/forums/viewtopic.php?f=13&t=1292