Page 1 of 1

[1.1.74] pathfinder issue

Posted: Fri Dec 30, 2022 10:55 am
by ILLISIS
Hi

If place a path request with a bounding box of something that I know will fail in the scenario that I am testing with like {{-5, -5}, {5, 5}}. When the path fails, the code changes the path request parameters including bounding box to be smaller, such as {{-0.015, -0.015}, {0.015, 0.015}}, and re-requests the path.

Even when it changes the bounding box or path resolution modifier.. it still fails on those re-attempts with known working parameters

If I set the known working parameters from the initial request... it works first time every time and there after.

Klonan mentioned in Discord to try and use this command.. whilst it changed the behavior of the pathfinder slightly it was not continuously successful and it did not change the behavior mentioned above.

Code: Select all

/c game.map_settings.path_finder.use_path_cache = false


video:
https://www.youtube.com/watch?v=4o6Yw9BVchE

It has had a renovation since that video.. but code:
https://github.com/ILLISIS/Constructron ... finder.lua

Whilst there is a chunk of code above there is only two functions(technically three) that I believe you need to concern yourself with;

Code: Select all

L28: function pathfinder.init_path_request(unit, destination)
L41: function pathfinder.request_path(request_params)
L88: function pathfinder.on_script_path_request_finished(event)
Let me know if you need any further information
Thanks!

Re: [1.1.74] pathfinder issue

Posted: Fri Dec 30, 2022 11:17 am
by Klonan
The information here is too general and mixed in with your own script orginisation

Can you dissect out a few lines of console command or script that will accurately and reliably reproduce the issue?
A small save have (50x50) and the command to show the problem will very much help us check and fix the problem

Re: [1.1.74] pathfinder issue

Posted: Fri Dec 30, 2022 11:05 pm
by ILLISIS
As discussed in discord.. In a minimal environment with the ability to test in real time it is obvious that the negative path cache was the issue.

/c game.map_settings.path_finder.use_path_cache = false


Thank you for your assistance!

Re: [1.1.74] pathfinder issue

Posted: Thu Mar 23, 2023 3:55 pm
by StrangePan
Taking a look at this

Re: [1.1.74] pathfinder issue

Posted: Thu Mar 30, 2023 8:57 am
by StrangePan
Ok, this should be fixed in 1.1.79. I verified that the fix works using a unit test and the Lua commands you included in this post, but if your use case isn't fixed with that release, please let me know.