Cars Predictive Pathing

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.

22 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.

We can’t create a system like this ourselves, Roblox doesn’t give us the required access/apis to the engine.

We can, but it probably won’t look quite right;

RunService.Heartbeat:Connect(function()
    for _, Car in workspace.Cars:GetChildren() do
        if Car.NewPosition.Value ~= Car.PrimaryPart.Position then
            local PlayerPing = Car.Player.Value:GetNetworkPing() + LocalPlayer:GetNetworkPing()
            Car:PivotTo(Car:GetPivot() + (Car.PrimaryPart.AssemblyLinearVelocity * PlayerPing))
            Car.NewPosition = Car.PrimaryPart.Position
        end
    end
end)

(basically pseudocode, I know it won’t work because :GetNetworkPing doesn’t function for other clients - only local player, but if you set everything up then what was described should happen, players should be moved forward by their velocity and ping to be more representative of where they are on their screen).

1 Like

That’s unfortunate, racing games especially need something like this because I’ve just created race positions for my game. I calculate them on the server because if it was calculated on the client people would be confused when it says their first but they finish in second or third. But because it’s calculated on the server, it could be telling them they’re in second when it looks like they’re in first, I’ll try creating my own system but I’m not really good with this kind of stuff. (physics)

Also, @Judgy_Oreo I looked at your code for an example of how to do it and I found this post which lets you see everyone’s pings from the server. I was wondering if I’d need to change anything else or if it would pretty much work with just changing the bit where you check people’s pings?

Edit: I just realised that we need to see others players’ pings from every client separately, I could send everyone’s pings through a remote event though…

Hey there, another developer here struggling with the same issue on collisions in racing games. The way it is now, it is impossible to create a realistic car racing game on Roblox. Collisions without vision lag is necessary to provide an immersive experience.

1 Like

I wonder if this was a problem pre-PGS… Probably.
It’s interesting that this has not been addressed yet in the physics system. Currently, the only solution is to set the network ownership to the server, but input lag will make the gameplay horrible.

Well I don’t see why you can’t account for each of the player’s ping now that workspace:GetServerTimeNow is available. :
Meaning you would have to move the players who are a bit behind the certain intervals accounting how far the difference is between their time and server’s time.

At this point, it’s down to the developer to develop some form of system to “fix” this. That said, it’s an uphill battle.

You’d be better off supporting my other thread, here. Staff responded pointing out that UDP is already how the physics are ran, so forget that part, but there is still currently no good way to get ping in real time to propogate to the clients & make adjustments to where cars should be.

You’re on a right track & I took a stab at it using your code idea with some extra additives to make your psuedocode into proper code.

When reviewing the footage, I measured the difference between me reaching the line and them reaching the line, I got about 6 frames [60 fps]. That’s about .1 of a second but the margin of victory was recorded at about 1/3 of that.

So still not perfect, but it’s closer one could suppose. My thing is, I’m still just not so certain one can get a reliable enough ping of all players, to be readable locally, to output accurate results.

4 Likes

Reviving this topic here…
i dont know how but the guys at Avenue Vance Empire claim that they successfully solved this issue and could do real time collision physics on A-Chassis, no lag at all on their pre release ION Apex Racing, i wanted to know how they did that and if its really true, because the beta game costs 500 robux and i dont have the money to buy the game to test

1 Like

I’ve seen it in the videos and I can hazard a guess at how it’s done but it still has some drawbacks considering this isn’t actually great ways to obtain ping still. (GetPing is still not a perfect function for this use case)

2 Likes