Fiddling with pathfinding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ewert
    Knight
    • Jul 2009
    • 707

    Fiddling with pathfinding

    Ok I like streamlined superfast playstyles, and couple things about the pathfinder annoys me. I will just try to make the changes for myself if nothing else, but please feel free to give feedback / opinions / ideas.

    Search range:
    Computing power is insane nowadays. Is there a reason it is limited? Why do I have to manually run through explored areas to be closer to unexplored ones to auto explore again? Total MEH, will try to find where this is set to put it to 255 or something. My first glance found a max_pf_radius set to 100, but I swear it is much less in the actual explore function, will have to check further. Especially since I can mouseclick muuuuch further (I assume the actual 100 radius 500 path steps max).

    Doors:
    I think having the autoexplore be "careful" isn't really the best option, I prefer it to be autoEXPLORE not autoexplore-but-nah-lets-not-look-behind-that-door-ever. Carefulness should be the player, not the pathfinding algorithm. I already made a shortcut for opendoor next to my explore button, but problem is the autoexplore won't even stop next to the door easily always ... To be honest, for myself, I'd be happy if the explore automatically stops next to a door, but if you press it again (or for first time) NEXT to a door, it will open the door and proceed from there until disturbed as usual. Or at the minimum, if it finds and stops next to a door, if there is no explorable areas found on next action, open it and proceed from there.

    Traps:
    The autoexplore is sometimes obviously super stupid when it comes to bypassing trap grids. You can literally be next to an open corridor spot next to a trap, and it returns a "confused" message if you try to explore again. Maybe this will be getting too complex for a basic explore function to change though, so not too fussy about this one. MAYBE a "if pathing step = trap, check if any grid next to step1 are empty as well as next to step2 and use that". Again though, not a big issue.

    Lets see what I find in the code ...
  • ewert
    Knight
    • Jul 2009
    • 707

    #2
    Ok dungeon level generation says max width is 198 and height 66, and if pathfinding uses radius/2 for max NWNESESW corners of pathfinding region, setting the radius to 400 ought to cover the whole levels. XD

    Comment

    • ewert
      Knight
      • Jul 2009
      • 707

      #3
      Or ... update my game to the newest version, it seems the pathfinding code was changed? XD Will see how the newer one works...

      Comment

      • ewert
        Knight
        • Jul 2009
        • 707

        #4
        Ugh. Automelee taken out, autosteponitems taken out, stops at first "explored" spot instead of until interrupt. This is so much worse, ouch... Why these major features taken out?

        Comment

        • ewert
          Knight
          • Jul 2009
          • 707

          #5
          Looking at my old files vs new one, I think this part is the one that fixes exploring at least a bit:
          /* Ewert: if second to last step, run it */
          if (path_step_idx == 1) {
          player->upkeep->running_withpathfind = false;
          run_init(path_step_dir[path_step_idx]);
          }

          Would need formatting to the new code though.

          Now I am wondering which version I had saved on my computer to play with, I thought I just had some older release as I don't currently have mingw installed and could not have compiled my personal versions. But maybe I just had a personal compiled version saved...

          Comment

          • Martina25
            Rookie
            • Dec 2024
            • 1

            #6
            I think your ideas for improving the pathfinder are on point. I especially agree that the max_pf_radius limit feels artificial. Maybe bumping it up to 255 is a good call if computing power allows it. Worth digging into the code, as it seems the algorithm behaves differently in practice than the settings suggest.

            About the doors, that’s a solid idea to make autoexplore more dynamic. Maybe try adding a condition in the code for autoexplore to continue if the next action is opening a door? I’d do it like that myself. Good luck experimenting!

            Comment

            Working...
            😀
            😂
            🥰
            😘
            🤢
            😎
            😞
            😡
            👍
            👎