J-Tanzanite / Little-Anti-Cheat

Anti-Cheat for Source Games
286 stars 69 forks source link

[l4d2/any?] Detect rear vision #136

Closed lunatixxx closed 2 years ago

lunatixxx commented 2 years ago

I will suppose that it is something that you can not detect with convars, so how to detect or block it?

Basically they hook a little screen that show their back, even if they are not looking it. I guess we can blame the incompetence of Valve for this one...

I was able to get a part of code, where can i send you the password in private? https://pastebin.com/b0QjJYb9

J-Tanzanite commented 2 years ago

I'm really curious as to what you mean by rear vision... Steam is the easiest.

lunatixxx commented 2 years ago

Check pm on alliedmodder.

Like a car rearview mirror to be more clear.

azalty commented 2 years ago

It's how the engine is done. Blocking entities behind players will have the side effect that if they move their camera, enemies will be invisible for a couple of frames and will then pop (since there is a delay between the server and the client)

J-Tanzanite commented 2 years ago

Through some private messages yesterday, I realized what he was talking about, and it's unfortunately not something you can patch out or detect. There is a cheat for TF2 which has this feature as well, and there it's called "Spy Camera".

For those curious, it's a feature that renders what's behind you, imagine having two monitors, but the second monitor is small, is in the corner of your primary monitor and renders what's behind you.

You can't detect this server-side, you'd need a client side anti-cheat. You also can't patch this server-side without issues. The only way to prevent this feature from working, is by having an anti-wallhack plugin that prevents sending information of entities that are behind you. The issue with doing this, is that if you have high sensitivity or even some lag (ping), players will pop into existence as you turn around. Back when I had written my own anti-wallhack, I didn't block players behind you for this reason.

Also, this isn't an engine issue, regardless of how the engine works, cheat devs can always make this feature work. Sadly, I cannot detect this, and fixing this would cause issues that are worse.

lunatixxx commented 2 years ago

But behind you can be far away if there is nothing that obscure the vision ? A wall, a door... Why the problem will be different with an anti-wh in term of efficiency? A player could move fast away from a wall in field of view of the other player and it could cause the same problem.

azalty commented 2 years ago

That's why we don't use any anti-wh plugin, and we use the built-in occlusion thing from csgo, which doesn't remove wh, but prevents cheaters from seeing people from very far away.

lunatixxx commented 2 years ago

Which is a non solution, map are smalls so i doubt that they need to see from very far away.

azalty commented 2 years ago

The occlusion thingy in csgo does work. If you try to cheat in csgo, you'll see that you won't be able to see the enemies in wallhack when they're 30m+ away and there are a lot of walls between both of you.

I don't think there's such a feature in L4D2. You can try using one of the many anti-wh plugins that are still publicly available and try to see if it has any negative impact.

From a plugin POV, it is impossible to detect if a player is wallhacking, because what makes them able to wallhack is that the game sends all players' positions to the client so that weird bugs as the one we talked about earlier don't happen, as well as making the client able to process animations for example.

We can only try to limit wallhacking by not transmitting the other players unless they're close OR they could have a potential line of sight (to try to avoid the 'enemy popping' bug).

Developers have been trying to limit that for a long time, and most of the time, it's not really worth it. Lots of calculations have to be made (which slows down the server), and most of the time it's not worth it. I don't have enough time, knowledge and interest to develop a proper anti-wallhacking plugin that doesn't have big compromises.

(the plugin will just be shooting rays everywhere to try to see if an enemy can be seen OR if a ray lands near an enemy, indicating that due to lag compensation and ping, the enemy could be seen in a legit way by the client, and thus we should transmit the enemy)

L4D games have pretty open maps from what I can remember so this technique wouldn't be really useful for those games imo

Having moderators is often way more useful. Most wallhackers are pretty obvious about it. If they're not obvious, they're most of the time not a nuisance.

lunatixxx commented 2 years ago

Even if smac version does a decent job the prediction is often too early, or in rare cases too late and you see appearing the player in front of you because of the complexity of maps i suppose. I doubt that it's worth these problems on L4D2, this game has a lot of sound clues anyway it's not like counter strike.

But anyway do you think that it will be possible to implement manually some sort of fog of war which will block visibility with the help of stripper source on various walls and props, so that will have the same effect of an anti wh ? And why developers are not doing that in the map development?

azalty commented 2 years ago

Sure, you could add some sort of fog and not transmit players behind it, that's what danger zone maps on csgo do, but for performance reasons

Why don't mappers do that? Well:

lunatixxx commented 2 years ago

About that rear vision thing, actually smac is taking care of that already it seems. I did not see any problem with it in particular even when turning super fast my mouse

Vehicles that have transparent glasses are more problematic actually.

J-Tanzanite commented 2 years ago

I was going to reply to this a few days ago, but ended up not doing so as other things came up in my life. Besides, I figured that since Azalty was explaining why this is a bad idea, that you'd understand why this won't be worked on. Especially as stated, this is an anti-wallhack issue. Instead you've taken this to another thread xD So I'm going to try to explain this again, why I won't work on this, why this is a bad idea, and some other things. And hopefully that will put this to rest. :)


Like I initially said Sadly, I cannot detect this, and fixing this would cause issues that are worse and those issues specifically being: if you have high sensitivity or even some lag (ping), players will pop into existence as you turn around. Yes, you haven't noticed the popping, unfortunately, some players do, even at low pings they can notice it because they have high sensitivities. However, this scales with ping, the higher ping you have, the worse the problem gets. And this is reason enough not to work with this. You mention that SMAC takes care of this, and sorry to break it to you, but SMAC blocks everything outside of 90 degrees of you. The reason why it's set to as high as 90 degrees is to limit the popping, and 90 degrees is already a LOT. And even with that, with some ping, you'll notice popping.

The reason why this gets worse with ping is simple, the server doesn't see where you are aiming; it sees where you were aiming some time ago, as determined by your latency (ping) to the server. The greater the latency, the more incorrect the server will be as to where you're aiming and what you can see, meaning it will block things out that you've already turned around to see. And the server cannot predict with any good accuracy where you're going to aim.

At best, you can increase the blocking distance by latency, and I actually tested this years ago... To avoid popping, it has to increase by a lot per ms of ping. And in my testing, it ended up disabling itself almost instantly... Making it practically useless.


Here's the thing, Lilac is used by a lot of communites, some more competitive than others. And I simply won't add features that can negatively affect other communities. One of the principles of Lilac is to affect legit players as little as possible; ideally, not at all. This means I won't add a feature that by design will affect legit players. And what you're asking for (patching rear vision) will do this, by design.


Now, there's a greater issue at play here, because a proper fix to all this is to write an anti-wallhack. Sure, an anti-wallhack won't fix the rear vision thing (not without affecting legit players), but we can still limit wallhacking in other areas...

Back when I ran my own TF2 servers, I did make an anti-wallhack that worked well with rare popping issues (with an exception, see below). And lag was minimal (I had some nice optimizations). And here's why I won't do it:

  1. TF2 has fence props that are see-through, but aren't marked as such by the game, meaning some maps needed exceptions for specific spots and that was a nightmare to deal with. Now imagine dealing with this on several games.
  2. Most people who want an anti-wallhack from me are from CS:GO, and CS:GO has a sound issue related to wallhacks that I just can't be bothered to work on.
  3. The inevitable spam from people reporting specific spots that cause popping... Listen, this is unavoidable unless you use a very different anti-wallhack architecture, which I won't work on. See this. And some of those issues could be resolved by lowering some of my optimizations, which would cause more lag... And as I've come to learn, people run servers on literal potatoes... I'm not willing to deal with people reporting that. You either get little lag or 100% accuracy with ray tracing methods. And even if I reached 95-98% accuracy, people will still report those 2-5% and be up in arms over it.
  4. SoundESP... Yes, cheats can bypass anti-wallhacks entirely unless you block sounds too, and right there, we would need to discuss where the limit should be, for different games; because different games have different ideas as to what is acceptable. And a lot of source games, I don't play. And I don't just mean "removing client info from sounds", I also mean actually blocking sounds.
  5. Game specifics: Not all games work the same, and I would need to make accommodations for different games, different games that I don't play. And remember the fence issue in TF2? Yeah... Imagine more of that.
  6. Time... As of the last year, I've been busy with real life things, which means I haven't had a lot of time to work on these things. And that's ignoring the fact that all that I've done thus far, has been for free. I'm not going to prioritize free work over payed work or friends and family. To this date, I've gotten zero donations, which is fine! I didn't start this project for money. But if people really want me to work on anti-wallhacks and constant updates to the AC every time a new cheat drops - you'd need to give me a reason to... And I have to point out the irony of people who constantly ask for updates and who depend on this project, never donate. In life, you get what you pay for, but I've given far more than I've gotten payed, this is why I find spam requests fairly annoying, it's somewhat entitled :/

While I do know how to make an anti-wallhack, it would take a lot of time, and for all the reasons listed above:

  1. I don't want to.
  2. I don't have the time to do so.

I hope with this reply, you can finally see why this won't be worked on, why just blocking people behind you is a bad idea, and stop asking for this, it's not going to happen. Not because I don't want to, but because it's a bad idea. And I hope you now see why I haven't worked on an anti-wallhack.

Maybe I'll start the anti-wallhack stuff in the future, maybe... But as of right now, the answer is no.