Reset spiderling walk instructions on Destroy. #19171
Merged
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.
What Does This PR Do
ACTUALLY fixes #19130.
I completely jumped the gun in #19147. It wasn't until @GDNgit pointed out the same issues with simple robots that I realized the common factor between all the GC failures wasn't any component, but the use of
/walk_to
.After extensive testing I've come to the conclusion that when a
/walk_to(foo, ...)
call is being processed in the background by BYOND, this counts as a reference tofoo
for the purposes of qdel'ing it. Only a handful of objects use/walk_to
. Most are simplemobs, most hostile mobs, and spiderlings, which are not a mob, but which move anyway (which is why spiderlings is happening in one PR, and the other fixes are happening later).The fix is easy; as per the BYOND docs, "A call to a walking function aborts any previous walking function called on Ref. To halt walking, call walk(Ref,0)." (It refers to "walk", not "walk_to", in both proc's docs, but I am 99% sure that if you start with a walk_to, then halting it should also be a walk_to.
Why It's Good For The Game
GCs failures bad. If this is right (which I have incredibly high confidence in) then this means other bugs will get fixed too.
Testing
I painstakingly put these two videos together to demonstrate the before and after.
In both videos, I first show the entire diff of the running server; both cases include:
random_skitter
(from 33% of the time to all of the time) and has spiderlings grow by a constant, large amount, every process tick.These changes are to more reliably reproduce the behavior. I think it can be pretty universally agreed that these changes have no impact on the behavior under test.
The only other difference between the two diffs is the addition of
/walk_to(src, 0)
in the spiderling's Destroy.In both videos, a spiderling is spawned and grows.
In the first video, there is a period of waiting (fast-forwarded) until about 150 seconds when the GC ref finder seizes the game and starts logging the GC failure.
In the second video, there is a period of waiting (fast-forwarded) until 300 seconds when I give up waiting for the hard destroy.
Before
gc_before_2.mov
After
gc_after.mov
Changelog
🆑
fix: Fix GC failures for spiderlings
/:cl: