• 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.

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

              But why only when the player is moving? Surely the NPCs are also moving all the time, so just moving the player and maybe nudging the party members (so like 4 new characters moving?) shouldn’t drop frames by ~30%. Something seems off there.

              I hope they figure it out and patch it, because it would really impact the experience on lower end hardware, like the Steam Deck (i.e. stable 30 FPS vs stutters in the late game).

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

                No idea, I’m wondering if they had their camera locked on them. I could see why camera movements would cause it. Either way I hope they fix it too.