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

[MIRROR] Reworks targeting behavior to fall back onto proximity monitors. Refactors ai cooldowns a bit #2931

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

Steals-The-PRs
Copy link
Collaborator

Mirrored on Nova: NovaSector/NovaSector#2028
Original PR: tgstation/tgstation#82640

About The Pull Request

Nother bit ripped out of #79498
Implements a get_cooldown() proc to get around dumb manual overrides and empower me to optimize the findtarget logic

Adds modify_cooldown, uses it to optimize find_potential_targets further

No sense running the behavior if we're just waiting on its output, so let's run it once a minute just in case, then push an update instantly if we find something

Optimizes connect_range and promxity_monitors

We know what turfs exist before and after a move
We can use this information to prevent trying to update turfs we don't care about.

This is important because post these changes mobs with fields will be moving a lot more, so it's gotta be cheap

Implements a special kind of field to handle ai targeting

If we run targeting and don't like, find anything, we should setup a field that listens for things coming near us and then handle those things as we find them.

This incurs a slight startup cost but saves so much time on the churn of constant costs

Note:
We should also work to figure out a way to avoid waking ais if none is near them/they aren't doing anything interesting

We don't need to do that immediately this acts as somewhat of a stopgap (and would be good regardless) but it is worth keeping in mind)

IMPORTANT

I am unsure whether this is worth it anymore since #82539 was merged. As I say it was done as a stopgap because ais didn't know how to idle.
If not I'll rip er out and we'll keep the other refactoring/optimizations.

Why It's Good For The Game

Cleaner basic ai code, maybe? faster basic ai code, for sure faster proximity monitors (significantly)

…ors. Refactors ai cooldowns a bit (#2028)

* Reworks targeting behavior to fall back onto proximity monitors. Refactors ai cooldowns a bit (#82640)

## About The Pull Request

Nother bit ripped out of #79498
[Implements a get_cooldown() proc to get around dumb manual overrides
and empower me to optimize the findtarget
logic](tgstation/tgstation@7047d29)

[Adds modify_cooldown, uses it to optimize find_potential_targets
further](tgstation/tgstation@4ebc8ce)

No sense running the behavior if we're just waiting on its output, so
let's run it once a minute just in case, then push an update instantly
if we find something

[Optimizes connect_range and
promxity_monitors](tgstation/tgstation@bcf7d7c)

We know what turfs exist before and after a move
We can use this information to prevent trying to update turfs we don't
care about.

This is important because post these changes mobs with fields will be
moving a lot more, so it's gotta be cheap

[Implements a special kind of field to handle ai
targeting](tgstation/tgstation@80b63b3)

If we run targeting and don't like, find anything, we should setup a
field that listens for things coming near us and then handle those
things as we find them.

This incurs a slight startup cost but saves so much time on the churn of
constant costs

Note:
We should also work to figure out a way to avoid waking ais if none is
near them/they aren't doing anything interesting

We don't need to do that immediately this acts as somewhat of a stopgap
(and would be good regardless) but it is worth keeping in mind)

## IMPORTANT

I am unsure whether this is worth it anymore since #82539 was merged. As
I say it was done as a stopgap because ais didn't know how to idle.
If not I'll rip er out and we'll keep the other
refactoring/optimizations.

## Why It's Good For The Game

Cleaner basic ai code, maybe? faster basic ai code, for sure faster
proximity monitors (significantly)

* Reworks targeting behavior to fall back onto proximity monitors. Refactors ai cooldowns a bit

---------

Co-authored-by: LemonInTheDark <[email protected]>
@Iajret Iajret merged commit c2dc840 into master Apr 17, 2024
27 checks passed
@Iajret Iajret deleted the upstream-mirror-2028 branch April 17, 2024 12:11
Iajret pushed a commit that referenced this pull request Jun 8, 2024
* Fixes some Raptor grammar (#83794)

## About The Pull Request

Corrects some grammar in the raptor code. (This time it should be
correct!)

## Why It's Good For The Game

Good grammar is best grammar

## Changelog

:cl:
spellcheck: fixes bad raptor grammar
/:cl:

* Fixes some Raptor grammar

---------

Co-authored-by: krookodilehunter <[email protected]>
Co-authored-by: NovaBot13 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants