Rocket Science Homepage

Buggy/broken bounces? - Rocket Science #12

Published:

Would you like to load embedded YouTube content?



* required

Transcript

Intro and status update

Hey guys, HalfwayDead here. Before I get to the video topic, I want to just take a quick second to confirm that the Patch 1.41 did not make any ninja changes to the physics or cars. As such, I'm not going to create an additional video for that.

Alright, let's talk about buggy bounces: why they happen, show a couple of examples, and possible ways to fix them.

Bounces

First, we need to understand bounces in general, so let's do that with a flat part of the wall.

As I've said in previous videos, the physics tickrate is 120, which means the true state of the ball is calculated 120 times a second. Each tick, the game checks if the ball touches the wall. If it does, then the bounce gets calculated based on the linear and angular velocity of the ball and the incoming angle relative to the surface normal.

The surface normal is a vector which is perpendicular to the wall. As long as the ball isn't so fast that it would go through the wall within 1 tick, there is not much that can really go wrong on a flat wall.

Curved meshes

Problems start to occur when you get interactions with curved meshes or multiple adjacent meshes. Because of the finite amount of ticks, the ball will already be slightly inside of the wall when the bounce gets calculated. This means, it's not using the true first touch that the ball made with the wall, and on a curve that will mean a different surface normal and a different/wrong angle bounce.

That would be basic hit detection. Psyonix seems to have some further tricks up their sleeve. Unfortunately, I don't exactly know what they're doing, but they had a patch about a year ago where they made some changes to bouncing behaviour in general, and by now all the inside facing curves work great, even at high ball speeds.

Goal posts

So what is still broken? Quick and simple: the posts. They are curved outwards and much more extreme. The bounces at certain angles and speeds can be completely wrong.

For example, this one. It should absolutely not bounce to the ground like that. How do I know that? After all, post bounces are always hard to read, and a tiny change in trajectory will change the bounce by a lot.

The answer is actually quite simple. In the custom training editor, if I aim slightly lower, then the shot will actually bounce slightly higher, which makes no sense at all. But that still doesn't tell me that the one bouncing down is broken and not the one bouncing higher.

To make sure I'm right, I am using a little trick to increase the physics tickrate from 120 to 500. As a result, a lot more bounces will work properly, and in this case, we can see that it shouldn't bounce down.

Potential solutions

1. Increasing physics tickrate

Ah, so the solution is just to increase the physics tickrate? Well, in a dream world, maybe.

Every PC, console and server has to run the same physics simulation. Increasing the tickrate would increase performance requirements, so I highly doubt that will happen. Most games run their physics at 60Hz, half of what Rocket League uses, although most games aren't based around physics either.

2. Continuous collision detection

The following idea might work though: Whenever a wall hit is detected, instead of using the location of that tick, we solve the physics for the exact time when the ball first made contact with the wall. That would allow us to determine the correct bounce in between two ticks, and it would essentially be the same as infinite ticks per second.

This would still require extra performance on bounces and might cause problems if the car hits the ball in the same tick. How feasible it is, is something only Psyonix can determine in the end. It is not unlikely that they've already thought of this but discarded the idea for a good reason.

Case Study: Wasteland

Lastly, I want to talk about Wasteland because, from my testing, it seems to be the best map at the moment.

Hitting the posts at middle goal height, they work perfectly. The crossbar has the same bug I showed earlier, though. But the important difference, in my opinion, is the following bounce, which I've seen quite often in real games. It's just infuriating to have a shot which is clearly on target bounce straight out. This kind of bounce only happens on Wasteland if it basically hits the post.

I believe the reason for why it works best on Wasteland is because the posts aren't actually curves. They are 90° corners, and I'm wondering if it might be smart to have all the maps work exactly the same way. Even though the bounces wouldn't match the visuals perfectly, they would always be the same, and I think that overall people would get better at reading the post bounces.

Maybe leave a comment if you agree or disagree with this. I think this kind of feedback could be very valuable to Psyonix in case they're considering to try something like this.

Closing Remarks

Alright, I'm going to try my best at getting all this info to Psyonix so they can either optimize meshes or code, and hopefully one day we'll have the game completely free of buggy bounces.

Big thanks to my patrons for supporting me financially, which allows me to spend a lot of time on this kind of stuff. If you want to become one of them, you can do so at the link on screen, and in return you'll get to vote on which topics I should prioritize. The next poll is going to come out soon. To stay up to date about this channel follow my Twitter or join my Discord, and I'll see you soon for the next video.