Client-side prediction

Hello everyone,
While developing quite a large-scale game, I am anticipating a chance of ping increase to be probable. The FPS open-world survival game will hopefully be roughly 50-ish players, but the issue I am expecting to face is, due to the fact that bullet physics will be server-side for security reasons, there will be a large issue of the replication of what a player sees to be very off of what the server sees. This will cause a lot of issue, but my question is how can we make an FPS game that is capable of having the server predict what the client sees? Likeā€¦ How can it be possible, and has anyone done client-side prediction before and succeeded with it?

2 Likes

you could keep the projectile physics within the client (it can handle the workload pretty well for things like this)

and then have the hit/damage infliction take place on the server, you could then have the server handle ā€˜fakeā€™ projectiles just for replication purposes.

for example:

1). player shoots a handgun, the client fires some local projectiles.

2). the server will acknowledge that the player started shooting, and will send off some ā€œfakeā€
projectiles just for REPLICATION purposes, these projectiles will most likely be less abundant as theyā€™ll only be ā€œtracer roundsā€.

3). if the local projectiles hit something then you can fire a remote to make the server validate that hit.

hopefully this helps you figure out a good design for your projectile replication/hits.

2 Likes

Although I appreciate the help, it would be easy to do it this way but it wonā€™t be secure.
In Deadzone Classic, it is very common for hackers to kill every player because shots are all client sided, so the hacker would utilize the remote event and just send off data to the server that the hacker shot x, y, and z with 100% damage, killing everyone in the game almost instantly, without having to fire any gun. That is why the developers resulted in having the server create the bullets and only the server will be able to utilize bullet physics. But that creates another problem, which is latency. Letā€™s say on my client that I aim the gun to a trajectory that will hit a running person. But because of ping, when I fire, the bullet gets created later than the time I click, causing the shot to miss. What client-side prediction does is that itā€™s meant to estimate what the client saw or the trajectory of the bullet in relivance to the person at a given time. But the issue with ROBLOX is its limits with the system, where server side physics always copies over to the other clients so if I wanted to record and temporarily replicate that of another person I canā€™t because it will duplicate to all clients. That being said, that creates a problem that is drastically harder to solve because ROBLOX does not allow an option for server-only replication.
So that is why Iā€™m openly asking for ideas to hopefully figure out something by some sort of a makeshift prediction system that is functional. Read the following as it explains a bit more about what Client-Side prediction is:
https://www.gabrielgambetta.com/client-side-prediction-server-reconciliation.html

Sorry for bumping, but have you found anything?

1 Like