Only the last two screenshots are a bug in Bresenham. The rest is a different pathfinding problem. Problem between walking and running.
They cost the same. At least from what I can tell. Same TU usage for all tiles, only the path is different.
This whole discussion was started because there was difference in cost, most glaring difference was fix and rest that differ become canonical version. This mean some specific moves cost different than before. And this in theory could cause that game choose different paths, and this is assumption I start this discussion.
Sorry, what? You can easily see the best path on the screenshots, can't you?
And you show diff to old that its now irrelevant because cost could change it. If you show two paths from NEW version that prove game chose unoptimal path then this discussion will follow differently.
Yesterday I downloaded your save (what point was to set ironman in it??) and check what parths are generated, and in some cases game choose unopitmal ones. This look more like problem with A*.
I attached example of this bug, this on its own is enough to prove that somting is wrong with pathfanding, only difference was where I click not what version of game I was using or what move type I used. This was prof I was asking.
This mean you are correct that something is wrong with it.
btw thank you for detailed testing it.
I did look at those changes, but I think they were minor, and they also don't explain why walking and running produce two different paths. Logically the two paths should always be the same...
It should produce different paths, different cost mean different paths, of corse as `run < walk` they should be very close to each other but rounding could make some paths better and other worse by +/-1 especially if there are tie in some variants.
My best guess is that... when you moved the running cost multiplication from Pathfinding::previewPath() to Pathfinding::getTUCost(), it somehow caused the bug. But I can't confirm this or tell why.
move of this code should not change any thing, it probably expose bug that already exist in it (aside of case where I did some very stupid error that cause all of this), and your detailed checking find it after it was exposed.