-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Refactors AI / camera eyes and slows holopad holograms to walk speed #25078
Refactors AI / camera eyes and slows holopad holograms to walk speed #25078
Conversation
Camera Eyes previously had duplicated logic across several files. This change uncooks the spaghetti. Additionally, half-baked support for TG's multicam feature has been removed, as it was not functional or in use.
This change completes a refactor of AI eyes, which were previously used by xenobio consoles, syndicate and abductor camera consoles, shuttle docking computers, holograms, and, of course, the AI. Duplicated logic has been extracted to an abstract base mob, /mob/camera/eye, from which new types for each of the above now derive. Functionality is largely the same, with only a few minor cosmetic differences (i.e. camera eyes are now appropriately named given their type and user), as well as a quality-of-life enhancement for holograms, slowing their movement speed to base run speed to prevent users from accidentally zooming out of calls.
The acceleration toggle was broken in the camera eye refactor, as previously the boolean was stored on the AI rather than its eye. This change fixes that.
With the camera eye refactor, the syndicate advanced camera consoles lost the ability to view maintenance tunnels and other areas without active cameras, seeing static in their place instead (as all other cameras do). This change reinstates the original behavior.
General minor code quality improvements suggested by GDNgit Co-authored-by: GDN <[email protected]>
I personally liked being able to zoom away as AI if you were urgently needed as whilst in a holopad, although I suppose that run speed isn't that slow. AI players are probably used to the high speed, however, and the fix to messing up is just triple clicking for them, instead of requesting a whole new call. |
After some discussion on discord I agree that the change could be frustrating for many AI players who are used to the zoominess and have mastered it. Although the AI Commands tab is already rather bloated, I will add a toggle for fast holograms. |
Rename parameter names to avoid src accesses, remove an ambiguous and unused mob_define and holopad range variable from a previous WIP, change the for loop in /mob/camera/eye/relaymove to a for-to loop, and change the chat message warning, sent when an AI Eye is created on an AI that already has one, to a stack trace
This pull request seems to be stale as there have been no changes in 14 days, please make changes within 7 days or the PR will be closed. If you believe this is a mistake, please inform a development team member on Discord. |
Previously, the relaymove proc for hologram eyes was redundant and nearly impossible to read. It has been separated out into a few different named procs, and has had its use of `spawn` removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really like what you did here, didn't have time to chek logick, will give it a second look later.
Co-authored-by: Drsmail <[email protected]> Signed-off-by: asciodev <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New description/changelog LGTM.
Changed a number of camera eye-related variables to camel_case style, added appropriate autodoc comments, as per code review. Also removed an unused cameranet function, modified the call signature of a cameranet function to be more semantic, and changed a qdel-on-initialize in camera eyes to return INITIALIZE_HINT_QDEL instead. Co-authored-by: Luc <[email protected]>
Co-authored-by: Luc <[email protected]> Signed-off-by: asciodev <[email protected]>
I mass-replaced everything that I could find related to this system from |
Something like, mildly annoying but super small that I doubt can be fixed, is that if the AI moves in their camera-view, and I'm pretty sure it's as a result of this PR, and they let go of the key while the game is still trying to move them to that tile, it does like a weird, slow movement, it's mostly a visual thing. Just figured I would point it out (this is kinda nitpicky), it has no real harm but I was maybe hoping to see if there was possibility of tweaking it to make it not do that? Not sure how code worky. It does this to holopads aswell, much more noticeably (see second video if they both attach properly) 302e19a41876a0fd5a4ee4db98d51826.mp42bec9d631209a889f6af56fae439ab84.mp4 |
PR ParadiseSS13#25078 introduced a few bugs related to AI eyes, mechs, and holograms. This change fixes those bugs. Now, entering a mech with an active hologram eye will first release that eye before granting control of the mech. Double clicking on a turf as an AI while in a mech will no longer unstick the camera from the mech. When exiting a mech, the AI will now properly refocus on its core instead of on the spot that it first entered the mech. AI holograms no longer receive normal audio near their holopads, receiving only holopad-relayed speech now instead. AIs will no longer be able to activate a holopad while occupying a mech.
* Fixes #28022: mecha/AI/hologram bugs from #25078 PR #25078 introduced a few bugs related to AI eyes, mechs, and holograms. This change fixes those bugs. Now, entering a mech with an active hologram eye will first release that eye before granting control of the mech. Double clicking on a turf as an AI while in a mech will no longer unstick the camera from the mech. When exiting a mech, the AI will now properly refocus on its core instead of on the spot that it first entered the mech. AI holograms no longer receive normal audio near their holopads, receiving only holopad-relayed speech now instead. AIs will no longer be able to activate a holopad while occupying a mech. * Update code/_onclick/ai_onclick.dm Co-authored-by: Luc <[email protected]> Signed-off-by: Burzah <[email protected]> --------- Signed-off-by: Burzah <[email protected]> Co-authored-by: Burzah <[email protected]> Co-authored-by: Luc <[email protected]>
What Does This PR Do
This change completes a refactor of AI eyes, which were previously used by xenobio consoles, syndicate and abductor camera consoles, shuttle docking computers, holograms, and, of course, the AI. Duplicated logic has been extracted to an abstract base mob, /mob/camera/eye, from which new types for each of the above now derive. Functionality is largely the same, with only a few minor cosmetic differences (i.e. camera eyes are now appropriately named given their type and user), as well as a quality-of-life enhancement for holograms, slowing their movement speed to base run speed to prevent users from accidentally zooming out of calls. A toggle for switching between this behavior and full speed has also been added to AI Commands, called "Toggle Fast Holograms", disabled by default.
Why It's Good For The Game
Testing
force_answer_call
to 1. I then called the Bridge, and upon being auto-answered, I was given sight and control over a hologram on the bridge, as expected. It was no longer zoomy. I left the holopad range and was disconnected from the call, regaining sight and control over my character. I was also able to exit a call using the associated action button.Changelog
🆑 Ascio
add: Camera eyes not belonging to the AI now have descriptive names, allowing easier orbiting
add: Added a "Fast Holograms" toggle to AI commands, which sets holopad holograms to camera eye speed (disabled by default)
tweak: Slowed holopad holograms to base run speed by default to prevent accidental holocall hangups
/:cl: