-
-
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
Port /tg/ move manager, drift and jetpack components. #27698
Open
warriorstar-orion
wants to merge
21
commits into
ParadiseSS13:master
Choose a base branch
from
warriorstar-orion:port/tg/move_manager-2024-12-21
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Port /tg/ move manager, drift and jetpack components. #27698
warriorstar-orion
wants to merge
21
commits into
ParadiseSS13:master
from
warriorstar-orion:port/tg/move_manager-2024-12-21
+2,325
−485
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ParadiseSS13-Bot
added
Testmerge Requested
This PR has a pending testmerge request
-Status: Awaiting type assignment
This PR is waiting for its type to be assigned internally
labels
Dec 21, 2024
Burzah
added
the
Code Improvement
This PR will improve the code quality of the codebase
label
Dec 21, 2024
ParadiseSS13-Bot
added
-Status: Awaiting review
This PR is awaiting review from the review team
and removed
-Status: Awaiting type assignment
This PR is waiting for its type to be assigned internally
labels
Dec 21, 2024
warriorstar-orion
changed the title
Port /tg/ move manager, drift and jetpack components.
[DNM] Port /tg/ move manager, drift and jetpack components.
Dec 22, 2024
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. |
github-actions
bot
added
the
Stale
This PR has been left inactive and requires an update.
label
Jan 8, 2025
github-actions
bot
added
Merge Conflict
This PR is merge conflicted
and removed
Merge Conflict
This PR is merge conflicted
Stale
This PR has been left inactive and requires an update.
labels
Jan 8, 2025
github-actions
bot
added
Merge Conflict
This PR is merge conflicted
and removed
Merge Conflict
This PR is merge conflicted
labels
Jan 10, 2025
warriorstar-orion
changed the title
[DNM] Port /tg/ move manager, drift and jetpack components.
Port /tg/ move manager, drift and jetpack components.
Jan 11, 2025
ParadiseSS13-Bot
added
the
Testmerge Active
This PR is currently testmerged on production
label
Jan 11, 2025
ParadiseSS13-Bot
added
Testmerge Active
This PR is currently testmerged on production
and removed
Testmerge Active
This PR is currently testmerged on production
labels
Jan 12, 2025
ParadiseSS13-Bot
added
the
Testmerge Active
This PR is currently testmerged on production
label
Jan 17, 2025
ParadiseSS13-Bot
removed
the
Testmerge Active
This PR is currently testmerged on production
label
Jan 18, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
-Status: Awaiting review
This PR is awaiting review from the review team
Code Improvement
This PR will improve the code quality of the codebase
Testmerge Requested
This PR has a pending testmerge request
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recreation of #26637 because I can't reopen it due to a force-push or something. Note that /tg/ has moved away from the spacedrift component as of tgstation/tgstation#84869 in favor of more sophisticated newtonian physics in space; my goal here is to unblock all the movement code needed for AI controllers, not to have the latest-and-greatest version of inertial movement.
What Does This PR Do
This PR ports /tg/'s move_manager API, a replacement for use of the native BYOND
walk
procs. It introduces movement subsystems, which can be used for processing different kinds of movements, adding one for most atom movement and one for items drifting in space.Two new components are introduced:
The port comprises major pieces from these PRs:
move_manager was initially implemented as an SS, but /tg/ appears to be moving away from allowing SSes which don't fire, so it is now a global datum
GLOB.move_manager
(just for ease of porting, I don't necessarily agree with the move).Many signals are added.
Something which may be contentious is the glide_size_multiplier, a global which scales glide time based on TD. This may affect the appearance of gliding objects unrelated to movement but will require more testing.
I've had to step through a lot of this code line by line to get it to work, so if you think something needs more documentation, let me know and I should have a good enough understanding to add it.
I would have liked this to be more atomic but I couldn't find a good way to separate the various implementation work without distrusting the result.
Why It's Good For The Game
As the original PR states:
This puts control of movement in userspace and allows for more flexibility. As can be seen, multiple movement subsystems can exist in order to allow for prioritizing or different firing times (in this implementation, we have spacedrift as a separate manager versus everything else).
It's also a pseudo-prerequisite to basic mobs, again attempting to keep the work of porting that as atomic as possible by adding the beneficial dependencies separately.
For other benefits of this approach, see the code that's cleaned up in:
/mob/living/carbon/human/Process_Spacemove
which was coupled with modsuit jetpack behavior;inertia_dir
on every item moving around;sleep
-dependent code as in/obj/item/extinguisher/mini/nozzle/afterattack
,/obj/item/reagent_containers/spray
, and/obj/effect/decal/cleanable/blood/gibs/proc/streak
, among othersHow it Works
Cribbing from the original PR again:
TL;DR, the move_manager gets passed movement instructions attached to atoms in the form of move_loop datums and manages the work of moving things.
This provides mostly drop-in replacements for the `walk()` procs
walk(0)
->GLOB.move_manager.stop_looping()
walk()
->GLOB.move_manager.move()
walk_to()
->GLOB.move_manager.move_to()
walk_towards()
->GLOB.move_manager.home_onto()
andGLOB.move_manager.move_towards_legacy()
, check the documentation to see which you like betterwalk_away()
->GLOB.move_manager.move_away()
walk_rand()
->GLOB.move_manager.move_rand()
is random walk,GLOB.move_manager.move_to_rand()
is walk to a random placeIt also provides some signals for handling the continuation and stopping of movement, which could be helpful in the future.
Testing
Testing requires checking the behavior of everything that's had its
walk
proc usage replaced or which has been moved to the /drift component.This will require TMing especially when it comes to handling lots of moving things at once (e.g. a bunch of stuff drifting in space while someone is trying to fight Bubblegum), though, to be clear, I don't anticipate issues in such scenarios.
Known Issues
Declaration
Changelog
Despite the relatively invasive nature of this change, this should have no player-facing changes, except for to improve performance. If there's any change or discrepancy in movespeed, throw speed, pull speed, projectiles, etc., it is a regression.
NPFC