[MIRROR] Fixes Pathfinder module AGAIN, General JPS Tweak (#28410)

* Fixes Pathfinder module AGAIN, General JPS Tweak (#84348)

## About The Pull Request

1. Fixes the modsuit pathfinder module's pathfinding for the second
time. This time AI idling broke it, we just make it not idle.
2. Changes the heuristic used by JPS nodes from Chebyshev distance to
Euclidean distance. I have no real logical explanation, it just appeared
to produce a more optimal path. CC @ LemonInTheDark
3. Renames `get_dist_euclidian()` to `get_dist_euclidean()`.

Red line: Euclidean dist JPS path (roughly)
Green line: Chebyshev dist JPS path (roughly)

![image](https://github.com/tgstation/tgstation/assets/75460809/57d75ff3-ee6d-4f73-82da-0e66e026d790)
## Changelog
🆑
fix: MODsuit pathfinder module works. Again.
code: AI pathfinding should produce slightly better paths.
/🆑

* Fixes Pathfinder module AGAIN, General JPS Tweak

* Update goldeneye.dm

---------

Co-authored-by: Kapu1178 <75460809+Kapu1178@users.noreply.github.com>
Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com>
This commit is contained in:
SkyratBot
2024-06-27 17:44:18 +05:30
committed by GitHub
co-authored by Kapu1178 SpaceLoveSs13
parent 58850b75af
commit 08749748f5
11 changed files with 15 additions and 14 deletions
@@ -114,7 +114,7 @@
var/locx = (target_turf.x - here_turf.x) + 24
var/locy = (here_turf.y - target_turf.y) + 24
if(get_dist_euclidian(here_turf, target_turf) > 24)
if(get_dist_euclidean(here_turf, target_turf) > 24)
userot = TRUE
rot = round(get_angle(here_turf, target_turf))
else
@@ -208,7 +208,7 @@
var/here_turf = get_turf(computer)
var/target_turf = get_turf(signal)
var/trackdistance = get_dist_euclidian(here_turf, target_turf)
var/trackdistance = get_dist_euclidean(here_turf, target_turf)
switch(trackdistance)
if(0)
program_open_overlay = "[initial(program_open_overlay)]direct"
@@ -471,7 +471,7 @@
*/
/obj/item/circuit_component/mod_program/radar/proc/can_track(datum/source, atom/signal, signal_turf, computer_turf)
SIGNAL_HANDLER
if(target.value && get_dist_euclidian(computer_turf, signal_turf) > MAX_RADAR_CIRCUIT_DISTANCE)
if(target.value && get_dist_euclidean(computer_turf, signal_turf) > MAX_RADAR_CIRCUIT_DISTANCE)
return COMPONENT_RADAR_DONT_TRACK
return COMPONENT_RADAR_TRACK_ANYWAY