Commit Graph

12 Commits

Author SHA1 Message Date
Bloop
4a989723e1 [NO GBP] Fixes even more AI related CI runtimes (#80262)
## About The Pull Request

Consider this a continuation of
https://github.com/tgstation/tgstation/pull/80202


![firefox_P62DdMv946](https://github.com/tgstation/tgstation/assets/13398309/1a784a27-e5c9-42d1-b160-7eb9251b3997)

~~It seems I missed a few.~~

Edit: Modified per request to handle this more broadly. If a pawn gets
`qdel`'d, the ai controller should be set to off and get removed from
the list of active controllers, and all their actions should be
canceled.

Also adds some qdeleted checks to `finish_action()`, which can still run
after the pawn gets qdeleted as part of the `CancelActions()` chain.

## Why It's Good For The Game

Less spurious CI failures.

## Changelog

Nothing player facing really.
2023-12-17 05:04:28 -05:00
Bloop
18047d74fe Fixes a bunch of AI related CI runtimes (#80202)
## About The Pull Request

<details><summary>A bunch of the numerous CI issues </summary>


![image](https://github.com/tgstation/tgstation/assets/13398309/70b0419e-0ac4-4a59-8acb-02511f8d6987)


![image](https://github.com/tgstation/tgstation/assets/13398309/4303923d-aaea-438f-9eb2-d27b510c7bc6)

</details>

You can view the full list of them here
https://github.com/Skyrat-SS13/Skyrat-tg/actions/runs/7148986054/job/19470671408.

What seems to be happening is, the `ai_controller` `fire()`s, and at
some point the the `pawn` var has become null from qdeletion. Many of
the `SelectBehaviors()` procs make use of that var, and then try to
access it without any safeties whatsoever.

I believe it is mainly happening because of long `do_after()`s and other
procs that sleep.

This PR just adds those safeties. I probably didn't get them all, but
this should fix the ones I have seen in CI. There may be a better
solution to cover all future cases of this but I will wait on feedback
to proceed. See below comments:

---

I don't know if you would rather this to always be checked at the
controller level instead (or in `able_to_plan()` perhaps?) but I could
do that if it's wanted. I wasn't sure if there were certain things that
depended on `SelectBehaviors()` running for cleanup so I opted against
that.

On that note, shouldn't we just be qdeleting the `ai_controller` when
the pawn gets qdeleted? Is that not already happening? And if not, is
there a reason for it? That would probably be the best way to handle
it...

## Why It's Good For The Game

I would like to stop seeing so many random CI failures, wouldn't you?

## Changelog

🆑
fix: fixes some AI runtimes that were caused by the pawn becoming null
/🆑
2023-12-10 18:22:56 -07:00
MrMelbert
ed2f04f486 Experiment with replacing weakrefs in AI blackboard with deleting signals, ideally making it easier to work with and harder to cause hard deletes (#74791)
## About The Pull Request

Replaces weakref usage in AI blackboards with deleting signals

All blackboard var setting must go through setters rather than directly

## Why It's Good For The Game

This both makes it a ton easier to develop AI for, and also makes it
harder for hard deletes to sneak in, as has been seen with recent 515
prs showing hard deletes in AI blackboards

(To quantify "making it easier to develop AI", I found multiple bugs in
existing AI code due to the usage of weakrefs.)

I'm looking for `@Jacquerel` `@tralezab` 's opinions on the matter, also
maybe `@LemonInTheDark` if they're interested

## Changelog

🆑 Melbert
refactor: Mob ai refactored once again
/🆑
2023-04-23 17:07:17 -06:00
oranges
4c48966ff8 Renames delta time to be a more obvious name (#74654)
This tracks the seconds per tick of a subsystem, however note that it is
not completely accurate, as subsystems can be delayed, however it's
useful to have this number as a multiplier or ratio, so that if in
future someone changes the subsystem wait time code correctly adjusts
how fast it applies effects

regexes used

git grep --files-with-matches --name-only 'DT_PROB' | xargs -l sed -i
's/DT_PROB/SPT_PROB/g'
git grep --files-with-matches --name-only 'delta_time' | xargs -l sed -i
's/delta_time/seconds_per_tick/g'
2023-04-11 21:31:07 -07:00
Holoo
0b8b9b9b6f fixes monkey controller runtimes and ai_behavior/give (#70778)
* Fixes monkeys' ``give`` AI stuff, allowing Monkeys to properly give things to people now.

Co-authored-by: Holoo <oleksanr.kozyr.yr1@gmail.com>
Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
2022-10-26 06:17:04 -04:00
Tastyfish
c2f124a3d2 Fixes monkey AI runtimes (#70696)
* Fixes monkey combat runtime

* better monkey subtree
2022-10-22 16:10:48 -04:00
itseasytosee
96e73097f7 Monkeys won't stay in combat mode forever after getting pissed off anymore. (#69488)
Monkeys will now drop out of combat mode in the following situations

- They have no enemies
- They have enemies but the monkey can not target them because they are far away
- They have enemies but they are dead/disabled
2022-08-30 16:56:31 -07:00
LemonInTheDark
f8aad14ae8 Harddel Fix Pack #42 + Better Live Reftracking Support (#63877)
* Hard Del Fixes, Ref Tracking Changes
2022-01-12 22:46:13 +01:00
tralezab
3d37916558 Monkey subtree breakup refactor! (#61741)
Splitting up monkey ai into subtrees allows me to make a punpun ai after this pr is merged, makes stopping planning matter for the AI subtrees, and more generic subtrees that can be used by most ais

It also gets rid of bad practices like setting blackboards in the ai controller.
2021-10-10 22:19:33 +01:00
aaaa1023
f04df890dd fixes misspellings of "aggressive" in a few areas. (#61092)
Fixes the spelling of "aggressive" in a few items, comments and a define.
2021-08-30 20:49:35 +01:00
AMonkeyThatCodes
a1f113b0eb All AI datum behaviors are now added using a wrapper (#60667) 2021-08-20 20:39:59 -07:00
ma44
7b5e83e1e9 Revives PR #58579; Sligh refactor to AI datums that allows for basic support of subtrees (#60249)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: coiax <yellowbounder@gmail.com>
Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Rohesie <rohesie@gmail.com>
Co-authored-by: Matthew J. <12817816+ZephyrTFA@users.noreply.github.com>
Co-authored-by: AnturK <AnturK@users.noreply.github.com>
Co-authored-by: Jonathan Rubenstein <jrubcop@gmail.com>
Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
Co-authored-by: Jordan Brown <Cyberboss@users.noreply.github.com>
Co-authored-by: Fikou <piotrbryla@onet.pl>
Co-authored-by: Emmanuel S. <emmanuelssr@gmail.com>
2021-07-28 17:56:31 -07:00