Cars Predictive Pathing

As a Roblox Developer specializing in cars & racing in a competitive nature, due to what the community calls “Vision Lag.” After sitting down with someone from the physics team at RDC, I really like what they had to say about fixing the issue, until they hit the catch. They said without anyone pushing on the DevForum for a change to this, it’d never happen, so, here I am. Here is my Feature Request.

So, to start off, the problem. Vision Lag. Vision Lag occurs when a client sends their position to the server and then to other clients slower than what they visually see their position at. Because of this you get weird issues where the view from two racers & a spectator are 3 wildly different views. I made a video to help understand the problem.

When Analyzing some screenshots from the video, you can see just how bad it is:


In this photo, at the start of the race, the Orange car sees the Orange & Pink car even, whereas the Pink car sees themself way out front. Even more out front than what the spectator sees.


Now as we get to the corner, each car sees themselves out in front, whereas the spectator sees them dead even. This causes issues where cars are able to drive inside one another from a spectator view, because neither car see their opponent in that spot they actually are. Because of that there is a lot of issues dictating what position you ever actually are in when the racing is side by side and close. Also, this makes car to car contact extremely difficult as neither car actually sees their opponent in the right place. Most collision causes in weird glitching.

So, what is my proposed solution. After talking with someone from Physics, their suggestion was a system similar to GTA V with simulated positioning. Apparently in GTA V, the server places the cars slightly ahead of their actual location to help decrease the issues with latency, and because of that certain glitches appear at high difference of speed things, however for low difference of speed issues like car to car bumping and rubbing, it works really well. (Playing chicken is still glitchy, but it’s not the intended thing for racing anyways.) Predicted Simulated Positioning would change the world of racing on Roblox.

123 Likes

This problem is not just racing related. I have refrained from making MOBA style games using the Roblox physics engine because of this very problem. A part of highlevel play in MOBA games is about character positioning. League of Legends, DOTA2, Heroes of The Storm; These games don’t allow characters to walk through eachother, or glitch around. In these games you use your character as a tool to flank, bodyblock, and obstruct. Without mechanics like these, MOBA games lose an entire dimension of gameplay.

11 Likes

A possible solution would be to make the physics engine more accessible to game developers. With a physics engine that is accessible to game developers, it would be possible for developers to implement the custom extrapolation that their games may need.

Extrapolation, for those who don’t know, is predictive physics on clients. Extrapolation is very finicky and would need to be custom implemented per project for best results.

Extrapolation allows games to trust clients less with stuff like raycast hit detection, while still feeling snappy and immediate to the user. This is currently a big tradeoff/compromise that games on Roblox have to decide on right now.

6 Likes

GTA doesn’t have servers. There are servers that matchmake players together, but from there, it’s entirely a P2P mesh network, no servers involved except for data saving and money changing hands. (This is also where GTA’s exploiting problem shines bright)

I agree with VitalWinter about per-project implementation. This could be considered as an option for the physics engine at some point, but it’ll be far down the pipeline.

4 Likes

Idk exactly what I’m talking about. I just know that the guy from the Physics department at Roblox during one of the lunches seemed very excited to make a project out of it, but mentioned that without support from the DevForum, he wouldn’t be able to work on it. I didn’t quite understand all the technical aspects of it, but basically I just want car to car collisions for Pete sake.

8 Likes

I’m still relatively new to using Set Network Ownership, so I’m not entirely sure of its capabilities.
I was reading your post on ‘Cars that hit and be hit’, which reminded me of a demo of dynamically prioritizing network ownership to the player that is closest to the nearest physics object(s).

Now, in a racing game I don’t think this would be very stable, and I don’t know the effects of continuously displacing network ownership.

My idea is this. In racing, typically it is the leader that will be less likely to collide with another car.
So, if network ownership for collisions of given to the 2nd placed car, who is more likely to collide with the 1st placed car, then I would believe that would produce a more realistic collision.

Of course, this would get very complicated when there are multiple cars bunched together and as I said, I’m not fully sure of SNOs capabilities.

Either way, might be worth testing. =]

Someone in our community tested with this, and it made some latency issues between when you’d put in the controls to when it’d happen. I.E. It would be a .5-1 second lag from the time you hit Left Arrow to when your car would start to turn.

What about just doing it on the straightaways then?
If you can do it through the straight-ways it may be enough time to sync up the players, then give ownership back to the players about 5 seconds before the next turn.

May be tricky to implement on smaller maps though.

Also affects throttle and brake. Affects all inputs.

The difference in position is due to latency and interpolation. There is no true solution to this problem, just some best methods which have drawbacks.

Changing physics ownership is not and should not be used as a solution. Doing this type of ownership changing is even worse than running all physics on the server (which is already awful). Not only is there more delay but you also don’t get the exploit protection of it running on the server and the delays will feel random/clunky to end users.

To do this properly you will need to have ways of customising how positions and collisions are replicated, which on the Roblox platform is not supported through conventional means. If you are a very competent developer you can run every car as a local object and do custom replication/collision resolution (which I’m currently using in a project so wont release too many details until after the project is finished). This method does however require a fair bit of effort and is extremely hard to tune correctly.

As stated earlier the (AFAIK) only other and best solution would be for Roblox to offer up options to allow for position extrapolation of physics objects within their own replication system. This is however a very complex problem so I wouldn’t go expecting it anytime soon.

3 Likes

I mean. As far as not seeing it soon, I feel like the post has garnered a lot of support based on the likes so I’d like if it’s in the pipeline.

Going to try and get this in today, it’s a pretty big one so I may follow-up with questions/feedback.

12 Likes

Something I wanted to include about this post. Since recent physics updates targeted at PGS, this problem still exists, but it’s somewhat different depending on the type of car being utilized. Noticeably, my custom chassis, lovingly referred to as G-Chassis, has been able to withstand car to car contact. The custom chassis utilizes Roblox’s constraint system to drive the car. The car to car contact however, it usually incorrect, which can cause messy situations where on both driver’s screens they are infront of the other driver, and getting pushed. So, I’ve seen drivers actually get a speed boost into a wall from the fact both drivers, on their own ends, are being pushed further and further along by the other.

Recently, ickyerick has started using a system which dumps everyone into one physics channel. (The owner of the all the car’s physics is one single person)

While this does allow for perfect contact, it’s the extremely laggy for both driver input & makes the cars look like they’re going in Slow-Mo. While we’re trying to take steps in the right direction, it’s still incredibly hard to find a perfect fix given the limits placed on us by Roblox, and as the rise of more and more games with vehicles are concerned, this feature becomes more and more valuable for the overall community of Roblox.

1 Like

This has probably already been said. But I mean if you’re gonna set one person as the car’s physics owner. Why not put everyone on an equal plane by setting the server as the vehicles physics owner and disable the auto ownership assignment that the server usually do?

I mean that’s essentially the same thing as what ickyerick is doing. He’s setting the network owner of all cars to one individual rather than specifically the server. Still the same problems all the same.

1 Like

My post was about setting it specifically to the server instead of an individual. That’s what I was curious about.

This is much needed for car games that require any type of proper interaction. I’ve worked a lot with demolishion derby gameplay in Car Crushers 2’s derby mode, and really the lack of this is the only big limitation to making the gameplay work and feel as good as most of the players want it to be.

It sucks to commonly get complaints from players who avoided attacks/didn’t get hit by an enemy vehicle but still took damage, and not being able to do anything about it except explain that I can’t provide a good fix for it on roblox.

21 Likes

I wondered if you’ve gotten any further with this?

I see a member of Developer Relations has seen this post but there still haven’t been any follow-ups after that. This problem is a big issue with my game and I think what you’re proposing is a really good way to solve it.

1 Like

Nah, good luck ever seeing them getting around to dealing with this.
The answer for years has been more or less that developers need to take a crack at creating a system like this for themselves.