this post was submitted on 18 Dec 2024
79 points (98.8% liked)

PC Gaming

8770 readers
213 users here now

For PC gaming news and discussion. PCGamingWiki

Rules:

  1. Be Respectful.
  2. No Spam or Porn.
  3. No Advertising.
  4. No Memes.
  5. No Tech Support.
  6. No questions about buying/building computers.
  7. No game suggestions, friend requests, surveys, or begging.
  8. No Let's Plays, streams, highlight reels/montages, random videos or shorts.
  9. No off-topic posts/comments, within reason.
  10. Use the original source, no clickbait titles, no duplicates. (Submissions should be from the original source if possible, unless from paywalled or non-english sources. If the title is clickbait or lacks context you may lightly edit the title.)

founded 2 years ago
MODERATORS
top 17 comments
sorted by: hot top controversial new old
[–] riskable@programming.dev 43 points 4 days ago (2 children)

Excellent defense: "You sent me the packets revealing where all the other players were. If you didn't want me to know they were behind walls why did you tell me precisely where they were?"

Yeah, doing such checks on the server side of things is more computationally intensive but it would solve that problem entirely and you wouldn't need client-side anti-cheat bullshit anymore.

The first rule of network programming is never trust the client. How does anti-cheat software work? By trusting the client.

[–] Maalus@lemmy.world 23 points 4 days ago (3 children)

It is impossible to do these types of checks on serverside. Your PC needs to know where to render the enemy character ahead of time, otherwise they'll pop into existence after you are dead. Bonus points for packet loss. Programming games isn't the same as validating input from some rando trying to log in on a site, it's an unsolved problem that all games have an issue with - from FPS like CS, RTS like Starcraft 2, to mobas like League.

[–] communist@lemmy.frozeninferno.xyz 2 points 4 days ago* (last edited 3 days ago)

Immortal gates of pyre does it, and it's just sc2 but better.

[–] riskable@programming.dev -2 points 3 days ago

It is impossible to do these types of checks on serverside.

If the client can make a determination as to whether or not to draw a player the server can too (and refuse to send those packets). It's not impossible, just more computationally intensive and thus, more expensive (on the server side of things).

Naive way: Render exactly what the player will see on the server. Do this for every client and only send the data to the client if the another player enters the view.

More intelligent way: Keep track of the position and field of view of each player and do a single calculation to determine if that player can see another. If not, don't send the packets. It will require some predictions but that's no different than regular, modern game-specific network programming which already has to do that.

Servers these days have zillions of cores. It really isn't too much to ask to dedicate a thread per player to do this kind of thing. It just means that instead of one server being able to handle say, 500 simultaneous players you can only handle say, 100-250 (depending on the demands of your game).

If your players host their own servers then it's really no big deal at all! Plenty of cores for their personal matches with their friends or randos from the Internet. If you're a big company with a game like Fortnite then it's a huge burden compared to the low-effort system currently in place.

[–] stinky@redlemmy.com 0 points 4 days ago (2 children)

Why impossible? Server-authoritative programming is common in PVP gaming, even high-performance recent games. I don't think anyone is suggesting lazily loading chunks of player data like wandering into a new chunk in Minecraft. Just write efficient, clean code that anonymizes or encrypts player data so it can't be read client-side.

[–] Mojave@lemmy.world 9 points 4 days ago* (last edited 4 days ago)

Okay, now the player data is encrypted and unreadable by clients.

How will the client display where the players are without data....

Why are you bothering to spend cycles sending this useless, encrypted data......

If you mean to decrypt the player data once it reaches the client, then you have solved no issues.............

[–] Evotech@lemmy.world 2 points 3 days ago (1 children)

Show me one multiplayer fps that does not trust the client with anything.

[–] stinky@redlemmy.com 2 points 3 days ago (1 children)

The issue here was that fortnite broadcasts locations of enemy players in packet data, not that it trusts clients "with anything".. where did you get that from?

[–] Custodian1623@lemmy.world 1 points 3 days ago (2 children)

how else should it inform the client of enemy players

[–] Mojave@lemmy.world 2 points 1 day ago

Work arounds are for devs to solve, not schmucks on lemmy. CS:GO used to use something similar to occlusion culling to prevent this exact problem. Don't send the client all of the enemy locations/data unless the client is within roughly the right distance/sight to see that enemy. This is not a full fix, but dramatically nerfs wall hacking.

I've seen community plugins for TF2 and other source engine games that will add "ghost" players. Generate ai characters, turn them invisible, and send their data to clients. If someone keeps shooting at the ghosts, they can easily get caught and banned.

There are entire industries dedicated to finding solutions to this problem, check out this research paper about this exact subject if you want.

[–] stinky@redlemmy.com -4 points 3 days ago* (last edited 3 days ago) (1 children)

That's an excellent issue for you to research on your own time! If you know anyone on the OverWatch development team you could ask for their input as well. Please report back to this thread with your findings, we're all very interested in the results.

[–] Custodian1623@lemmy.world 1 points 3 days ago (1 children)
[–] stinky@redlemmy.com -4 points 3 days ago (1 children)

Sorry to hear that. Best of luck with your future projects though.

[–] Custodian1623@lemmy.world 1 points 3 days ago

be nicer to people

[–] MentalEdge@sopuli.xyz 13 points 4 days ago* (last edited 4 days ago) (2 children)

"Oh no, we don't need to worry about any sanity checks in the database, that's all taken care of in the javascript frontend"

I didn't come up with that, but it's the same logic. Actually expressing something like it in a professional setting could get you fired.

Not in the games industry, though.

[–] Maalus@lemmy.world 9 points 4 days ago

Because there is a reason nobody does that serverside. Programming games and programming a service are two different beasts.

[–] weew@lemmy.ca 1 points 3 days ago

Most other industries don't expect millisecond response times.

You take longer than that in an action FPS game, your game is fundamentally broken and unplayable.