Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TG Mirror] Goats will randomly attack you [MDB IGNORE] #32

Closed
wants to merge 1 commit into from

Conversation

ffmirrorbot[bot]
Copy link

@ffmirrorbot ffmirrorbot bot commented Oct 13, 2023

Mirrored on Skyrat: ${this.url}
Original PR: (original url)

About The Pull Request

We accidentally lost this behaviour when we converted goats to basic mobs.
Formerly (and now again) goats had a 0.5% chance per second to simply decide to attack you for no reason at all.
While attacking you they also have a 10% chance per second to get bored of doing that and stop.

Additionally, we were outputting a fluff message every time you attacked a goat which would spam chat if you were trying to fist fight each other. I added a 20 second cooldown onto it.

As is often the case, implementing this led me down a bit of a rabbit hole.
We were previously bypassing faction checks via a mixture of flags on AI behaviours and blackboard keys.
I have moved this entirely to the blackboard now, rather than making targetting subtypes just to skip faction checks.

This entails having one blackboard key which is "by default do we care about factions?" and another which is "are we currently ignoring factions for some other reason?"
Retaliatory AI will generally enable the second flag, so you can get pissed off at someone you would usually not mind hanging out with if they start something with you. Certain mobs which want to hunt other mobs but not be hunted in return just ignore factions entirely all the time and use the former.

The upshot of this is that the default behaviour for expected default retaliatory AI shouldn't require you to set any specific kind of targetting datum and will Just Work.

In a similar vein because I was touching largely the same mobs I made the "flee when injured" component apply its "don't flee because not injured" flag instantly upon application rather than needing to manually set it in the blackboard definition, so that also Just Works.

Changelog

🆑 Jacquerel
fix: Pete's anger management training has worn off, and he will once again sometimes pick a fight with you for absolutely no reason.
qol: Attacking a goat will not spam messages so frequently.
/:cl:

* Goats will randomly attack you (#78930)

We accidentally lost this behaviour when we converted goats to basic
mobs.
_Formerly_ (and now again) goats had a 0.5% chance per second to simply
decide to attack you for no reason at all.
While attacking you they also have a 10% chance per second to get bored
of doing that and stop.

Additionally, we were outputting a fluff message every time you attacked
a goat which would spam chat if you were trying to fist fight each
other. I added a 20 second cooldown onto it.

As is often the case, implementing this led me down a bit of a rabbit
hole.
We were previously bypassing faction checks via a mixture of flags on AI
behaviours and blackboard keys.
I have moved this _entirely_ to the blackboard now, rather than making
targetting subtypes just to skip faction checks.

This entails having one blackboard key which is "by default do we care
about factions?" and another which is "are we currently ignoring
factions for some other reason?"
Retaliatory AI will generally enable the second flag, so you can get
pissed off at someone you would usually not mind hanging out with if
they start something with you. Certain mobs which want to hunt other
mobs but not be hunted in return just ignore factions entirely all the
time and use the former.

The upshot of this is that the default behaviour for expected default
retaliatory AI shouldn't require you to set any specific kind of
targetting datum and will Just Work.

In a similar vein because I was touching largely the same mobs I made
the "flee when injured" component apply its "don't flee because not
injured" flag instantly upon application rather than needing to manually
set it in the blackboard definition, so that also Just Works.

:cl:
fix: Pete's anger management training has worn off, and he will once
again sometimes pick a fight with you for absolutely no reason.
qol: Attacking a goat will not spam messages so frequently.
/:cl:

---------

Co-authored-by: san7890 <the@ san7890.com>

* Goats will randomly attack you

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: san7890 <the@ san7890.com>
@Iajret Iajret closed this Oct 17, 2023
@Iajret Iajret deleted the upstream-mirror-24312 branch October 17, 2023 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants