Critical server delay

I’ve been making weapon system for a while, until i got a problem - exploiters can just send some packets with information about “hit” and it will work, because packets contained info about parts that was “hit” with a bullet. I decided to fix this and make a new communication system:

Client is doing the first raycast, and if it’s successful, it waits raycast1.Distance/bulletSpeed and fires another raycast that finally shows a hitmarker, makes bullet hole and sends info (position and direction) to server, where it fires ANOTHER raycast and only then it deals damage or creates an explosion. So yeah, this might work, but… target may move to the side and avoid server raycast because of the client-server delay. That’s very annoying, because 80% of all bullets just don’t deal any damage, but there’s a hitmarker and blood particles. I may perform raycasting from a server and then get the result on client and do hitmarker or bullet hole, but the client will get too much delayed information (Very critical to ingame experience).

Is there a way to make such system that will be protected from exploiters, but also register bullets normally?
server delay

The way a good bit of games do this is by sending the timestamp with the hit data to the server and then using those positions for the raycast instead of the servers current ones. Rocket League actually gives a very good talk on this in one of their developer présentations.

2 Likes

Can you give me a link to that developer presentation please?

Here is the presentation. The talk starts the networking section around 23:39.

1 Like

So, how i understood, i need to make some kind of a lag compensation system that rewinds time to validate hit on server. I just don’t know how to make it - isn’t it going to be that laggy for a server because of amount of different enemies with different sizes and amount of parts that can be shot and of a constant saving data about all of this?

Okkayy, i may be getting somewhere. I think that my large scale game doesn’t need the lag compensation method. Instead, i’ll try to do all of raycasting and sending results to the server, but the server will be VERY strict for these results. Range, direction, ammo and etc. will be sanity checked on the server and only then there’s gonna be damage. I’ll try this and see how it goes.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.