Commit Graph
2 Commits
Author SHA1 Message Date
e9acaff140 [MIRROR] Attempts to fix the leash unit test CI failures [MDB IGNORE] (#23556)
* Attempts to fix the leash unit test CI failures (#78157)

## About The Pull Request

Fixes https://github.com/tgstation/tgstation/issues/77704

Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/23467
Fixes https://github.com/Skyrat-SS13/Skyrat-tg/issues/23511

What it says on the tin. This has started causing CI failures with the
Tramstation test in almost every single PR downstream and it's gotten to
the point where it's become a major headache.

I don't know why it's happening only only on Tramstation, or why it's
happening at all-- but I will say it instantly began ramping up in
frequency immediately after merging
https://github.com/tgstation/tgstation/pull/75924 , which was the same
PR that was also causing the progressbar harddels previously to crop up
every time @ LemonInTheDark .

This attempts to fix it by doing 2 things:

~~1) Make sure the `COMSIG_LEASH_PATH_COMPLETE` always gets sent, which
will prevent needless false 'timeouts' whenever every iteration of the
check_distance() loop returns early. Now it will only timeout when it
actually times out.~~

1) Increases the timeout timer to 80 seconds. Why so long? Well, I've
looked at a number of individual CI failures and it looks like it tries
to complete the path somewhere between 40-75 seconds after the time out
failure. Most of the time it should not take this long though and will
just finish right away as normal.

<details><summary>Timeouts with timestamps shown here so you can see
what I am talking about</summary>

![firefox_mjwj5LCEje](https://github.com/tgstation/tgstation/assets/13398309/376be09f-ab85-4362-a75f-156c76a5c901)

![firefox_St29Dis9Jh](https://github.com/tgstation/tgstation/assets/13398309/f5bfbb5f-fc24-404d-ba41-e84130885500)

</details>

<details><summary>And here</summary>

![firefox_joAs0qA0f6](https://github.com/tgstation/tgstation/assets/13398309/13955036-a120-4ea4-adcb-8c945d0695ab)

![firefox_WABTuH6Z1j](https://github.com/tgstation/tgstation/assets/13398309/222af6fb-8cb1-4ea1-97aa-c5785294da58)

</details>

<details><summary>And here</summary>

![firefox_BaZXVwFzPE](https://github.com/tgstation/tgstation/assets/13398309/c68f0c3a-553b-42ca-aef4-a04628c5abf0)

![firefox_qoMid37BUi](https://github.com/tgstation/tgstation/assets/13398309/8ce48a2d-3b21-4346-aa9f-654e66b2a6b7)

</details>

2) Moves the priority of the test down so it happens later, with the
other long tests. This might even fix the issue on its own--haven't seen
the test take more than 0.1s to complete so far in any of my runs. Maybe
things just needed some more time to load?

So far I've done about 10 test runs and haven't seen a single timeout
with these two changes. I'm fairly confident the issue is fixed but
we'll see.

Test functioning:

![image](https://github.com/tgstation/tgstation/assets/13398309/fd7e9cf4-3573-4971-bbee-2fe45f82dafb)

## Why It's Good For The Game

Stops a PR blocking spurious CI failure.

## Changelog

🆑
fix: leash unit test will time out less often and increases the timer
until it is considered 'timed out', to reduce false CI failures
/🆑

* Attempts to fix the leash unit test CI failures

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-09-06 21:05:04 -04:00
cab87c97e5 [MIRROR] Add leash component to pAIs that keeps them within range instead of directly teleporting them back, increases default range to max range [MDB IGNORE] (#22745)
* Add leash component to pAIs that keeps them within range instead of directly teleporting them back, increases default range to max range (#77030)

## About The Pull Request

Tries to keep pAIs in range of their owner by moving them closer when
the owner moves, rather than jarringly teleporting every time the owner
gets out of range. Does this by calculating the closest path a nearby
tile and forcefully moving you there. Still a bit janky at times but is
better than teleporting directly onto the owner 100% of the time I feel.
Also prevents you from moving out of range, rather than forcefully
teleporting you back.

Increases the default pAI range to the maximum (9 tiles)

## Why It's Good For The Game

New leashing makes being a leashed pAI significantly less jarring and
obvious. Ideally we would also have a visible max range too.

Default pAI range was pretty small in my testing and I think it's not
unreasonable to think a lot of people won't bother changing it. That
they are leashed at all is the important part.

## Changelog

🆑
qol: pAIs now try to stay within range of their owner, and teleport back
only when necessary
qol: Default max pAI range has been changed to the maximum range you can
choose (9 tiles)
/🆑

---------

Co-authored-by: Jacquerel <hnevard@ gmail.com>

* Add leash component to pAIs that keeps them within range instead of directly teleporting them back, increases default range to max range

* Fixes the leash enable/disable

* A workaround because the procs are private.

* Update card.dm

* Update card.dm

what I get for rushing

* Update card.dm

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Jacquerel <hnevard@ gmail.com>
Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
2023-07-30 16:24:44 -04:00