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.
/🆑
This commit is contained in:
Kapu1178
2024-06-27 00:01:36 -04:00
committed by GitHub
parent 8a16be72ee
commit 6b73d6a8ed
10 changed files with 14 additions and 13 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