• sugar_in_your_tea
      link
      fedilink
      English
      arrow-up
      8
      ·
      1 year ago

      Pathing should be low hanging fruit here. Most NPCs don’t need accurate pathing, and can use a much faster algorithm to calculate. Hopefully the devs do a round of optimizations for late game content since that seems to be where most of the issues are.

      • Sanctus@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 year ago

        We don’t know how their NPCs are built though. The pathing seems to be the same for every NPC that moves, so I bet its baked in somewhere up the inheritance tree. They already use ocular occlusion to take down some of the clutter out of view. The fact is the city probably pushes the limits of the engine in its current state.

        • sugar_in_your_tea
          link
          fedilink
          English
          arrow-up
          2
          ·
          1 year ago

          Oh it’s certainly pushing it to the limits, which is why they need to change things. If it’s pathing, they have a ton of options to make it smoother, since most NPCs don’t need fancy pathing logic.

          • Sanctus@lemmy.world
            link
            fedilink
            English
            arrow-up
            2
            ·
            1 year ago

            They’re probably using A*. I don’t really see how you can get more efficient than that.

            • sugar_in_your_tea
              link
              fedilink
              English
              arrow-up
              4
              ·
              edit-2
              1 year ago

              That’s optimal if you want to find the best path to a destination, but NPCs milling about a town don’t need the best path, they just need to move toward their goal more or less. And most go on a mostly fixed route, so you can just store the ideal path in memory and let the NPC evade up to some distance from that path.

              This makes it a lot more friendly to do a multi-threaded implementation since you don’t need to figure out collision avoidance until it’s about to happen, just look a few steps ahead and course correct as needed.

              Enemies should use proper pathing, but NPCs don’t need to be anywhere near that sophisticated.

              But I have no idea what they’re actually doing under the hood, it’s just concerning that it gets slow when the player moves without interacting with any NPCs.

              • Sanctus@lemmy.world
                link
                fedilink
                English
                arrow-up
                1
                ·
                edit-2
                1 year ago

                Yeah but with how optimal the game is are they really not using waypoints for jobber npcs already? This game runs extremely well. That seems like a hell of an oversight. Thats why i figured the pathfinding was baked in somewhere higher up or something.

                Edit: I really don’t think it is pathing. These models have insane LoD. I’m thinking they tuned it since D:OS2 but its the same engine. I bet its just compounding factors of high polygons, environmental effects (the earthquakes) and NPCs just existing in high number on top of that. There is more than double the amount of NPCs inside the city than anywhere else in the game.

                • sugar_in_your_tea
                  link
                  fedilink
                  English
                  arrow-up
                  2
                  ·
                  edit-2
                  1 year ago

                  In the Digital Foundry review, they saw huge performance dips when just running in small circles, when standing still had no impact. As in, on a high end system, performance dropped from ~90FPS to mid-60s, just by moving in a tight circle (i.e. not enough to actually move the camera).

                  That sounds a lot like pathing to me, though other things could certainly be causing it.

                  It just seems like something there is poorly optimized and it shows when there are a lot of NPCs around.

                  And the game essentially uses last gen tech (DX11, no RTX, performance drop on Vulkan, etc), so it’s not pushing the boundaries all that much, so it’s probably not fully optimized. It should be feasible to optimize it to at least not get FPS dips when moving vs standing still in towns, if not get a bit better performance on older CPUs (e.g. Zen 2 CPUs like 3600 and whatever is in the Steam Deck). It runs pretty well, it they could probably get a bit more.

                  • Sanctus@lemmy.world
                    link
                    fedilink
                    English
                    arrow-up
                    1
                    ·
                    edit-2
                    1 year ago

                    Pushing the boundaries of the engine is different than pushing the boundaries of the industry. Maybe it could be the pathfinding. But movement doesn’t necessarily mean its pathfinding. I’m sure transforming all those polygons costs more computationally than pathfinding.