Predictive Pathing Tool Kit
As a Roblox developer, it is currently not feasible to do your own predictive pathing to overcome issues with latency between client and server when related to fast moving objects that have a network priority on the client due to player input.
If Roblox is able to address this issue, it would change the world of Racing games on Roblox, by allowing developers (like Myself) to finally cinch tight the problems involved with “Vision Lag.”
The Problem
A brief on “Vision Lag.” Each client may see themselves as “winning” when the server displays them as side by side. I go into more detail in this 17 minute video.
I know Roblox has no drive to creating a predictive pathing system for us due to the lack of activity on my previous thread and talking to various staff in the past from the physics team. So at the very least we need the basis of tools to handle it ourselves.
While early tests of such a system went well:
The player floating behind the opponent car would be where the car would normally be placed. The car goes through the wall at the end due to the high impulse of the stopping force. GTA V has this same issue when playing “Chicken” at high speed, but when racing in the same direction, the impulse is low.
Two things are basically deal breakers:
No UDP (Unordered packets) Support- No Reliable Client Ping Detection
Client Based Ping
When making calculations to place cars in front of where the server currently dictates them to be, you need a reliable source of a player’s ping. Currently the only way to do this is to Fire a Remote event, take down the time you fired it, wait for the response on the server, and then take down the time you received it. Using subtraction, you receive the ping. An officially system provided by Roblox would be less hacky, and likely more reliable with calculating the ping as there are more resources to Roblox in the background to run these calcs quicker. (As well I have worries about firing the remove events too often, as I’d be looking to fire one per frame, per player. That certainly adds up.) In a perfect world, a player’s ping would be an attribute of the player in Game.Players.
### Unordered Packets*
Staff responded pointing out that I was miss interpreting another issue as being TCP protocol, when in actuality it was UDP protocol. Check replies below for their response. Extend this section to see the original posting.
Unordered Packets Original Section
Currently with Roblox’s ordered packets (apart of TCP protocol), when packets get backed up, a car will just dead stop and wait for the missing packet to arrive. Once it arrive, all the packets fire off at once, which shoots the car forward to it’s current destination. What you get is a bunch of garbage as far as positioning data, as seen in races by ION** with lots of cars on track:
In iRacing, when packets get dis-organized or lost, the car will be “blinked” out. A similar system could be put in place by Developers if UDP was available to them to use, where frames where the packet is lost, the car simply would not be displayed. (To counteract car hitboxes going inside one another, either turning off collisions completely or not allowing cars to collide when a car is blinked back in, already inside another car. The latter is done by iRacing, the former is done by ION.)