Happens when you set IsPassable=true on a terrain, and place that terrain on an impassable tile. You will get a buggy tile.
When a unit is pathfinding from some tile beside that buggy tile, it may consider that tile passable, and go into it. However, you can't directly order your unit to go into that impassable tile.
Sometimes the unit will significantly slow down and pass through that tile. Sometimes the unit goes into the tile and gets stuck. AI units also encounter this problem, and it seems that they are more likely to get stuck.
If you destroy the terrain in that buggy tile, it will returned to normal.
As it is never seen happening on infantries, I suspect it is caused by DEFINE_HOOK(0x73FB71, UnitClass_CanEnterCell_PassableTerrain, 0x6). It seems that the hook skipped some necessary checks about the tile's passability.
Here is an example. In the Dance of Blood campaign of MentalOmega336, I set IsPassable=true on every tree type, and there always be some attacking units that get stuck here.
Phobos Version
B43 or any other version with passable terrain function.
Conditions to reproduce
Set IsPassable=true on a terrain, and place that terrain on an impassable tile.
INI code
[SomeTerrainType]
IsPassable=yes
Steps to reproduce
Already detailed in the Description.
Expected behaviour
The unit should only go into the tile when both the tile and terrain type are passable for it.
Actual behaviour
When automatical pathfinding, the unit goes into the tile when the terrain is passable, and ignore the tile's passability.
Additional context
No response
Checklist
[X] The issue happens on the latest official version of Phobos and wasn't fixed yet.
[X] I agree to elaborate the details if requested and provide thorough testing if the bugfix is implemented.
[X] I added a very descriptive title to this issue.
[X] I used the GitHub search and read the issue list to find a similar issue and didn't find it.
[X] I have attached as much information as possible (screenshots, gifs, videos, debug and exception logs, etc).
Description
Happens when you set
IsPassable=true
on a terrain, and place that terrain on an impassable tile. You will get a buggy tile. When a unit is pathfinding from some tile beside that buggy tile, it may consider that tile passable, and go into it. However, you can't directly order your unit to go into that impassable tile. Sometimes the unit will significantly slow down and pass through that tile. Sometimes the unit goes into the tile and gets stuck. AI units also encounter this problem, and it seems that they are more likely to get stuck. If you destroy the terrain in that buggy tile, it will returned to normal. As it is never seen happening on infantries, I suspect it is caused byDEFINE_HOOK(0x73FB71, UnitClass_CanEnterCell_PassableTerrain, 0x6)
. It seems that the hook skipped some necessary checks about the tile's passability. Here is an example. In theDance of Blood
campaign of MentalOmega336, I setIsPassable=true
on every tree type, and there always be some attacking units that get stuck here.Phobos Version
B43 or any other version with passable terrain function.
Conditions to reproduce
Set
IsPassable=true
on a terrain, and place that terrain on an impassable tile.INI code
Steps to reproduce
Already detailed in the
Description
.Expected behaviour
The unit should only go into the tile when both the tile and terrain type are passable for it.
Actual behaviour
When automatical pathfinding, the unit goes into the tile when the terrain is passable, and ignore the tile's passability.
Additional context
No response
Checklist