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

Smoother AI tracking #36383

Open
wants to merge 56 commits into
base: Bleeding-Edge
Choose a base branch
from

Conversation

SECBATON-GRIFFON
Copy link
Contributor

@SECBATON-GRIFFON SECBATON-GRIFFON commented Apr 20, 2024

[tweak]

What this does

redoes #34059 but without the retracking stuff as it caused some controversy
actually locks the AI eye to the tracked mob so it gets updated on movement rather than every second.
adds an event that detects if someone enters or exits the cameranet on a turf to check if the AI can keep following them through static instead of checking every second. (with the usual exception for borgs with a camera) does not apply when tracking stops via usual means like moving away or jumping somewhere else.
changes the snowflaked checks for AI blocking items to be a variable called "blocks_tracking" that does its functionality.

Why it's good

less jumpy when tracking mobs

Changelog

🆑

  • tweak: AIs can now track mobs as they move, rather than jumping to them every second.
  • tweak: AI messages when they stop being able to follow a target are now more general, as cameras are not the only thing that stops tracking.

@D3athrow-Issues D3athrow-Issues added the Tweak I changed the thermostat from 70 degrees to 69 degrees. label Apr 20, 2024
@SonixApache
Copy link
Contributor

has your parole been lifted yet?

Copy link
Collaborator

@jwhitak jwhitak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are multiple issues with this PR, and in my testing I found at least one more problem.

Now tracking Ian on camera.
No longer tracking Ian on camera.
Now tracking Dessert on camera.
ADMIN LOG: [Dilt]/(H.E.R.B.I.E.) deleted Dessert at (264,257,1)

I had jumped on the old local test server, used the track button to look at Ian, then used the button to look at Dessert. I qdel'd Dessert, and after a moment, the camera suddenly jumped back to Ian.

And when tracking Ian, it wasn't even smooth. Just an instant jump. I saw the step changes to try and help the tracking, but it doesn't seem to work?

code/_hooks/events.dm Outdated Show resolved Hide resolved
code/game/machinery/camera/tracking.dm Outdated Show resolved Hide resolved
for(var/obj/item/I in target_mob.get_all_slots())
if(I.blocks_tracking)
return FALSE
if(target_mob.is_wearing_item(I,slot_wear_id))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't get_all_slots return the ID slot already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah, just the items from them, not their positions on the mob

code/game/machinery/camera/tracking.dm Outdated Show resolved Hide resolved
code/modules/mob/living/silicon/ai/freelook/eye.dm Outdated Show resolved Hide resolved
@SECBATON-GRIFFON
Copy link
Contributor Author

SECBATON-GRIFFON commented May 13, 2024

There are multiple issues with this PR, and in my testing I found at least one more problem.

Now tracking Ian on camera.
No longer tracking Ian on camera.
Now tracking Dessert on camera.
ADMIN LOG: [Dilt]/(H.E.R.B.I.E.) deleted Dessert at (264,257,1)

I had jumped on the old local test server, used the track button to look at Ian, then used the button to look at Dessert. I qdel'd Dessert, and after a moment, the camera suddenly jumped back to Ian.

And when tracking Ian, it wasn't even smooth. Just an instant jump. I saw the step changes to try and help the tracking, but it doesn't seem to work?

just added /event/destroyed to the thing that stops tracking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tweak I changed the thermostat from 70 degrees to 69 degrees.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants