Skip to content

Conversation

@JoeyCheerio
Copy link

@JoeyCheerio JoeyCheerio commented Dec 26, 2025

This patch fixes the beach ball/Smissmas ornament ball from going invisible by preventing invalid numbers from being used in the math. If invalid numbers are used (for example 0) it catches it and changes it to 1

To note: While this issue could technically be fixed by preventing the Ball from using the is_boing property, it would also remove the jiggle effect when interacting with the world. My fix preserves both the visibility of the ball when shot as well as the jiggle effect included in the model's QC

Before

before.fix.mp4

After

after.fix.mp4

This patch fixes the beach ball/Smissmas ornament ball from going invisible by preventing invalid numbers from being used in the math. If invalid numbers are used (for example 0) it catches it and changes it to 1
boingSide.NormalizeInPlace();


if (data->boingDir.IsZero()) data->boingDir = Vector(0, 0, 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a poor way of fixing it, the source of this issue comes from the normalization of the velocity up above, which returns a non-zero result even if the velocity is zero, and it fails the epsilon check as it happens to be bigger than 0.00001f

Higher up on line 591, this will fix it properly:

		float speed;
		if ( vel.IsZero() )
		{
			vel = Vector( 0, 0, 1.0f );
			speed = 0.0f;
		}
		else
		{
			speed = vel.NormalizeInPlace();
			speed /= deltaT;
		}

Included Ficool's better fix
Generalisk added a commit to Generalisk/SourceSDK-Generalisk that referenced this pull request Dec 27, 2025
@FlaminSarge
Copy link
Contributor

Someone has already uploaded a fixed model for the ball that handles this the (probably) correct way, by adding a base bone on the model for which the jigglebone can jiggle relative to; see ValveSoftware/Source-1-Games#4208 (comment)

Does this change allow for better handling of jigglebones in general? If not, this probably does not need to go through, in favor of fixing the model itself.

Also should probably revert the whitespace changes.

@ficool2
Copy link
Contributor

ficool2 commented Dec 29, 2025

Does this change allow for better handling of jigglebones in general? If not, this probably does not need to go through, in favor of fixing the model itself.

This is likely to fix other assets other than the ball, therefore this PR is still relevant, besides theres clearly a bug in the code as the check for invalid inputs is not correct

@JoeyCheerio
Copy link
Author

JoeyCheerio commented Dec 29, 2025

Someone has already uploaded a fixed model for the ball that handles this the (probably) correct way, by adding a base bone on the model for which the jigglebone can jiggle relative to; see ValveSoftware/Source-1-Games#4208 (comment)

This is incorrect. I've tested the fix you linked before (which is what led me to actually investigating what caused the bug in the first place)
The root issue is not related to the model at all, it is entirely related to the is_Boing property.

For example the hat "A Rather Festive Tree" also uses the is_boing property. Turning it into a physics prop and shooting it also turns the jigglebones (The ones that use the is_Boing property) from that hat invisible in base TF2.

The PR fixes that.
You'll notice that only the bones with the Jigglebones are affected.

Before.is_Boing.Fix.mp4
After.is_Boing.Fix.mp4

@FlaminSarge
Copy link
Contributor

FlaminSarge commented Dec 30, 2025

The root issue is not related to the model at all, it is entirely related to the is_Boing property.

That's odd; why does the model fix work in that case, then? Why does adding the base bone somehow resolve the issue for that particular model? Is it related to skipping some broken logic here if another bone is present? Would be useful to know why exactly that workaround works even if it's not the 'correct' way to fix it.

Also it's looking like the ball model should get that base bone anyways in addition to this PR fix, just as a 'correctness' measure, since it seems like without a base bone if another bug crops up with jigglebones this can happen again (based on your video of the Xmas hat folding in on itself instead of outright disappearing, since it has the base bone).

This is likely to fix other assets other than the ball, therefore this PR is still relevant, besides theres clearly a bug in the code as the check for invalid inputs is not correct

Agreed that this PR should go through then.

Should still fix the whitespace, though.
Screenshot 2025-12-29 at 7 31 02 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants