Occlusion checking

Is there a way to check visibility from point to point using occlusion in code?

This would be very useful for online games, as it would reduce the amount of traffic several times and prevent cheating (ESP, Chams, etc.). That checking with raycast and using distance is all nonsense

To the contrary, what you are saying makes little sense.

Visibility has very little to do with cheating, safe from “seeing opponents through walls”. However, the positional information would still have to be available on the client-side in games like Counterstrike because you need to play positional audio (footsteps, weapon fire) regardless of whether an opponent can be seen.

Similarly, traffic does not automatically go down. At most you may be able to avoid syncing animation state or sync at a lower rate. But games already do that - based on distance.

Rest assured, if a system like that would make sense and save as much traffic as you say it would for a notable number of games/genres, it would definitely exist.

Funny answer, you’re trying to argue with the Counter-Strike game, but you can’t give at least one example of why positional information about players should be present on the client. In it, the server decides how the game is going and the client does not need to know about the other players who are out of sight (behind a wall, for example). On the client side, it doesn’t even visually exist because the server has deleted the entity on the client, but continues to simulate its presence even if it is out of the player’s line of sight (blood splashes, sounds, etc.). Study the device of the xash3d engine (a clone of GoldSource) at your leisure and see that using occlusion, the server calculates who can see what on the server side and to whom to send what information.

I’ll add a little bit about the amount of traffic. Connect to the full server of any Valve game running on the GoldSource or Source, Source 2 engine and see how much traffic is consumed (usually from 5 to 50 kb/s), while only entity deltas are sent, taking into account the visibility of players on the server side

Uhm yes, I did: positional audio. That’s either tied to the player’s position, or there’s an RPC “play this sound at x,y,z” also giving away a possible opponent’s position.

I also mention CS specifically because it’s one of the few cases where some form of optimization may reduce bandwidth or make cheating at least a little less useful. But this fails for most other games, simply stepping up to an “open world” battlefield shooter and occlusion culling of network players makes very little sense anymore, while distance checking does the job well enough.

Hahahahaha… And now look at Rust and there is an open world and there is an occlusion that is calculated on the server side and regulates what the client should see… That’s how Harry got rid of another cheating problem.