fheroes2 icon indicating copy to clipboard operation
fheroes2 copied to clipboard

Battle screen, AI can't reach a troop which stands near canyon

Open Branikolog opened this issue 2 years ago • 3 comments

Preliminary checks

Platform

Windows

Describe the bug

image image

Save file

Path.zip

Additional info

No response

Branikolog avatar Sep 19 '22 14:09 Branikolog

Hi @Branikolog , can you provide a video or screenshots what exactly doesn't work? For me it looks fine.

ihhub avatar Sep 20 '22 01:09 ihhub

Hi, @ihhub ! The problem on the second screenshot is quite evident, but here's another one. I hope it's more clear. :) image

Branikolog avatar Sep 20 '22 11:09 Branikolog

"Turn 1000"

Are you sure they weren't planning to make a move on turn 1001?

zenseii avatar Sep 20 '22 12:09 zenseii

Hi @Branikolog. Could this be related to how the Dragon is a flyer? Would it happen if your creature does not take up 2 hexes?

zenseii avatar Sep 21 '22 11:09 zenseii

The problem is in pathfinding. More specifically in std::pair<int, uint32_t> Battle::Arena::CalculateMoveToUnit( const Unit & target ) const method which has incorrect cached information about cells.

ihhub avatar Sep 24 '22 10:09 ihhub

The conditions to reproduce this issue: a monster should be not reachable for AI monster at current turn and this monster must be standing in between 2 unreachable cells: image

ihhub avatar Sep 24 '22 10:09 ihhub