Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Incorrect path calculation for long path after update to 4.27 #6

Open
ivasyliev opened this issue Sep 13, 2021 · 4 comments
Open

Incorrect path calculation for long path after update to 4.27 #6

ivasyliev opened this issue Sep 13, 2021 · 4 comments

Comments

@ivasyliev
Copy link

I was trying to use Engine function FindPathToLocationSynchronously and I found the issue that result with Path points are incorrect after engine update.
At some point engine call the function AGraphAStarNavMesh::FindPath and this function return path points. If path is longer then X cells (5 in example and 7 in my proj. I think it depends from world distance) then this function return such array
[1, 1, 2, 3, .... x]. So start point is there twice.

@ZioYuri78
Copy link
Owner

ZioYuri78 commented Sep 13, 2021

That is interesting,
as you can see in GraphAStarNavMesh.cpp at line 179 i manually add the starting node because FGraphAStar::FindPath doesn't add it, or at least is what is always happened to me but i never tested it with FindPathToLocationSynchronously.
For some reason sometime when you use FindPathToLocationSynchronously the starting node is counted so we have twice of it after my Add call.
I need to go deeper with the debugger to understand why this happen, meanwhile thanks for the heads up!

@ivasyliev
Copy link
Author

yeah, I read though the code a bit and I've seen your logic. But I didn't found anything obvious, that's why I'm reaching you. I don't know why there is dependency from path length and from engine version. But looks like it was ok in 4.26.
thanks for quick response. Let me know if you'll need any support

@ZioYuri78
Copy link
Owner

I did a small workaround, it not really solve the issue because i still have to figure out what happen but at least it avoid duplication in paths longers than 7 tiles and it let us move of only 1 tile.

@ZioYuri78
Copy link
Owner

Workaround introduced a bug so i had to revert, issue still unresolved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants