Skip to content

Reset spiderling walk instructions on Destroy. #19171

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

Merged
merged 1 commit into from
Oct 1, 2022

Conversation

warriorstar-orion
Copy link
Contributor

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 to foo 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:

  1. enabling the debugging options for GC ref finders
  2. changing two trivial things about spiderling behavior: how often it calls 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:

@ParadiseSS13-Bot ParadiseSS13-Bot added the -Status: Awaiting type assignment This PR is waiting for its type to be assigned internally label Sep 25, 2022
@AffectedArc07 AffectedArc07 added the Fix This PR will fix an issue in the game label Sep 25, 2022
@ParadiseSS13-Bot 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 Sep 25, 2022
@warriorstar-orion warriorstar-orion marked this pull request as ready for review September 25, 2022 13:38
@hal9000PR hal9000PR added the GC Related This PR optimises how a type GCs label Sep 25, 2022
@farie82 farie82 merged commit ad90b63 into ParadiseSS13:master Oct 1, 2022
github-actions bot added a commit that referenced this pull request Oct 1, 2022
@warriorstar-orion warriorstar-orion deleted the sw3 branch January 26, 2024 00:24
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 Fix This PR will fix an issue in the game GC Related This PR optimises how a type GCs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Anything with /datum/component/swarming fails to GC
5 participants