Commit Graph

12 Commits

Author SHA1 Message Date
SkyratBot
2ed6af479c [MIRROR] [NO GBP] Fixes even more AI related CI runtimes [MDB IGNORE] (#25682)
* [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.

* [NO GBP] Fixes even more AI related CI runtimes

* Update _ai_controller.dm

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-12-17 15:00:53 +00:00
SkyratBot
c2520730a5 [MIRROR] Fixes a bunch of AI related CI runtimes [MDB IGNORE] (#25552)
* 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
/🆑

* Fixes a bunch of AI related CI runtimes

---------

Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
2023-12-10 20:49:07 -05:00
SkyratBot
e6f66d3a4a [MIRROR] Experiment with replacing weakrefs in AI blackboard with deleting signals, ideally making it easier to work with and harder to cause hard deletes [MDB IGNORE] (#20719)
* 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
/🆑

* Experiment with replacing weakrefs in AI blackboard with deleting signals, ideally making it easier to work with and harder to cause hard deletes

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2023-04-26 21:17:15 +01:00
SkyratBot
9a594755f3 [MIRROR] Renames delta time to be a more obvious name [MDB IGNORE] (#20507)
* Renames delta time to be a more obvious name

* updates to our code

---------

Co-authored-by: oranges <email@oranges.net.nz>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2023-04-12 20:45:43 +01:00
SkyratBot
852014a131 [MIRROR] fixes monkey controller runtimes and ai_behavior/give [MDB IGNORE] (#17184)
* 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>

* fixes monkey controller runtimes and ai_behavior/give

Co-authored-by: Holoo <38228316+Holoo-1@users.noreply.github.com>
Co-authored-by: Holoo <oleksanr.kozyr.yr1@ gmail.com>
Co-authored-by: Zephyr <12817816+ZephyrTFA@ users.noreply.github.com>
2022-10-26 16:56:26 -04:00
SkyratBot
726332bddf [MIRROR] Fixes monkey AI runtimes [MDB IGNORE] (#17105)
* Fixes monkey AI runtimes (#70696)

* Fixes monkey combat runtime

* better monkey subtree

* Fixes monkey AI runtimes

Co-authored-by: Tastyfish <crazychris32@gmail.com>
2022-10-22 17:06:38 -04:00
SkyratBot
de503f6b92 [MIRROR] Monkeys won't stay in combat mode forever after getting pissed off anymore. [MDB IGNORE] (#15937)
* 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

* Monkeys won't stay in combat mode forever after getting pissed off anymore.

Co-authored-by: itseasytosee <55666666+itseasytosee@users.noreply.github.com>
2022-08-31 09:30:30 -07:00
SkyratBot
65b8082678 [MIRROR] Harddel Fix Pack #42 + Better Live Reftracking Support [MDB IGNORE] (#10639)
* Harddel Fix Pack #42 + Better Live Reftracking Support

* awooga

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-01-12 21:57:49 +00:00
SkyratBot
87f9a90cea [MIRROR] Monkey subtree breakup refactor! [MDB IGNORE] (#8748)
* 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.

* Monkey subtree breakup refactor!

Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
2021-10-11 16:16:48 +01:00
SkyratBot
7c20242e85 [MIRROR] fixes misspellings of "aggressive" in a few areas. (#7869)
* fixes misspellings of "aggressive" in a few areas.

* aa

Co-authored-by: aaaa1023 <74441292+aaaa1023@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-09-01 16:54:51 +01:00
SkyratBot
851a58ef7b All AI datum behaviors are now added using a wrapper (#60667) (#7679)
Co-authored-by: AMonkeyThatCodes <20987591+AMonkeyThatCodes@users.noreply.github.com>
2021-08-21 22:14:52 +01:00
SkyratBot
bdc2b2d3c9 [MIRROR] Revives PR #58579; Sligh refactor to AI datums that allows for basic support of subtrees (#7214)
* 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>

* Revives PR #58579; Sligh refactor to AI datums that allows for basic support of subtrees

Co-authored-by: ma44 <guyonleagueoflegends@gmail.com>
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-29 11:11:03 +01:00