• ProgrammingSocks@pawb.social
    link
    fedilink
    arrow-up
    9
    ·
    edit-2
    6 months ago

    If the trajectory and speed says either the client or another player will cross a wall soon where the player sees them THEN it could send the data to the client. You need some tolerance for ping up to maybe 200ms but that’s it. Wallhacks could give you at most a flash of a couple specific people.

    • huginn@feddit.it
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      edit-2
      6 months ago

      You need to account for every gap in the wall, nook and cranny and peephole for these sightlines. You’d have to bake so much detail into every calculation server side that it would effectively be rendering the entire map to host a single game.

      • ColonelPanic@lemm.ee
        link
        fedilink
        arrow-up
        4
        ·
        6 months ago

        There are many ways of doing this. I know the source engine uses visboxes, which are calculated once at map compile time. It takes a while to compile, but it means that clients can use the pre-compiled data to calculate parts of the map that are visible and the server can use them to determine what the player can see at a given time. I’m not sure whether it does that or not, but it would make sense to use that data.

      • ProgrammingSocks@pawb.social
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        edit-2
        6 months ago

        It could be a client-side check with verification on the server. Basically transmitting which places are in view. Ray casting like the other person said. Not raytracing which is much more computationally intensive. A server side check basically so that the client can’t just say they’re looking around every corner at once.

        • huginn@feddit.it
          link
          fedilink
          arrow-up
          1
          arrow-down
          3
          ·
          6 months ago

          But then you’re adding extra latency to all visual calculations.

          Your client needs to know if something is visible within the framerate of their PC.

          You cannot do that fast enough.

          • ProgrammingSocks@pawb.social
            link
            fedilink
            arrow-up
            1
            arrow-down
            1
            ·
            6 months ago

            Why not? More computationally intensive things are done to calculate lighting in a lot of modern games as I alluded to. Yes it would increase the load on your CPU but that’s less of a problem nowadays with higher core counts and clock speeds and it’s not like modern anticheats don’t steal some CPU cycles already. I think you underestimate the power of modern computers. I’m not trying to be condescending here but it is worth remembering that gigahertz means BILLIONS of calculations per second.

            We’re only talking in theoreticals right now anyways, it is entirely possible that a game studio has tried this and it hasn’t worked, I just don’t put a lot of faith in modern game companies.

            • huginn@feddit.it
              link
              fedilink
              arrow-up
              1
              ·
              6 months ago

              You cannot break the speed of light with computational effort.

              You’re saying that you want to have a round trip from client to server and back happen in-between frames.

              You cannot do that. Period. You will not ever have latencies that low.

              Even if you frame lock it at 60fps that means you’re calculating views, sending the data up the tube, checking it on the server, responding back with all the data about the new character that should appear and then rendering the new guy within 17ms.

              That is physically impossible.

                • huginn@feddit.it
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  6 months ago

                  So you’re going to take all the places a character could be in the next 200ms, do Ray casting on all of them and send that data to the server to check every 17ms?

                  While the server also does that for 15 other players at the same time.

                  Do you know what algorithmic complexity is? Big O notation? If so - that’s a n³ * 15m³ problem space that you’re expanding out across 200ms every 17ms, where n is player locations possible in x/y/z and m is the other players locations. Physics collisions are usually the biggest drain on a computer’s cycles in game and in the worst case that’s n² complexity.

                  You’re talking insanely taxing here.