failed to find teleport destination

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sky
    Veteran
    • Oct 2016
    • 2321

    failed to find teleport destination

    so i got this message for the first time ever. i was in a cave dungeon, classic cave, i.e. long thin corridors.
    i assume the spell was looking for a room to TS me to but couldn't find any.

    however . should i be using a turn to do this? it's essentially a failed spell when i have 0% fail.
    "i can take this dracolich"
  • Nick
    Vanilla maintainer
    • Apr 2007
    • 9637

    #2
    OK, thanks. This is a failsafe I put in to stop teleports from hanging the game forever if there was no place to go. The case I was looking at was when a badly formed level was created with only a grid for the player, and a disconnected vault. Given your description, it looks like I need to allow the game to search for a bit longer.
    One for the Dark Lord on his dark throne
    In the Land of Mordor where the Shadows lie.

    Comment

    • kandrc
      Swordsman
      • Dec 2007
      • 299

      #3
      I've now hit this bug several times in the nightlies (in fact, several times in a row). You could fix it by instead of (what I assume you do) choosing a random teleport location repeatedly until you find one or time out, iterate the dungeon to build an array of all valid destinations, then randomly select one from there. The first is linear time (if you remove the timeout) with the possibility of an infinite loop, while the second is constant (albeit a moderately large constant) and will never fail with a false negative.

      Comment

      • AnonymousHero
        Veteran
        • Jun 2007
        • 1393

        #4
        Originally posted by kandrc
        I've now hit this bug several times in the nightlies (in fact, several times in a row). You could fix it by instead of (what I assume you do) choosing a random teleport location repeatedly until you find one or time out, iterate the dungeon to build an array of all valid destinations, then randomly select one from there. The first is linear time (if you remove the timeout) with the possibility of an infinite loop, while the second is constant (albeit a moderately large constant) and will never fail with a false negative.
        I was about to suggest the "build-a-list-of-valid-locations" approach too, but I think the issue there might be selecting locations such that they're uniformly distributed (in terms of location in space). There might a way to do that by doing a weighted random selection, though I haven't thought too much about it.

        Comment

        • Derakon
          Prophet
          • Dec 2009
          • 9022

          #5
          Originally posted by AnonymousHero
          I was about to suggest the "build-a-list-of-valid-locations" approach too, but I think the issue there might be selecting locations such that they're uniformly distributed (in terms of location in space). There might a way to do that by doing a weighted random selection, though I haven't thought too much about it.
          For the specific use case of teleportation, you want to send the character a certain distance away, so you'd sort the list of potential destinations by their distance from the character's current position, and then just take the first item off the list. This makes teleportation deterministic, but the dungeon itself is chaotic enough that I doubt it'd make a difference unless you cast it immediately again -- in which case it'd send you right back where you came from, which is arguably a neat feature.

          (If you're ever in the situation where you find you need to use teleportation twice in a row, you're in bad shape anyway...)

          Comment

          • Huqhox
            Adept
            • Apr 2016
            • 145

            #6
            As a handy side effect, if you can't find enough teleport to positions when you make the list then you know the dungeon generator failed and you can re-run the level generation
            "This has not been a recording"

            Comment

            • Pondlife
              Apprentice
              • Mar 2010
              • 78

              #7
              Originally posted by Derakon
              This makes teleportation deterministic, but the dungeon itself is chaotic enough that I doubt it'd make a difference unless you cast it immediately again -- in which case it'd send you right back where you came from, which is arguably a neat feature.
              I've had a few times where I've teleported from one sh1tstorm into another, and only escaped with another teleport. In these situations, you don't want something that sends you back where you came!
              Playing roguelikes on and off since 1984.
              rogue, hack, moria, nethack, angband & zangband.

              Comment

              • Nick
                Vanilla maintainer
                • Apr 2007
                • 9637

                #8
                Thanks guys, build a list and then choose from it is a much better approach than the current one.
                One for the Dark Lord on his dark throne
                In the Land of Mordor where the Shadows lie.

                Comment

                • PowerWyrm
                  Prophet
                  • Apr 2008
                  • 2986

                  #9
                  Originally posted by Pondlife
                  I've had a few times where I've teleported from one sh1tstorm into another, and only escaped with another teleport. In these situations, you don't want something that sends you back where you came!
                  Unfortunately, if you've played enough times Angband variants, you'll see that teleporting twice almost always brings you back near the location you teleported the first time, ending the life of your character. This is mainly because teleport range is too big (usually 400) and usually ends up choosing squares that are out of bounds. That's why playing a priest has a big advantage: the Portal spell has a much shorter range (100 or so) and will almost always teleport you to a new location.
                  PWMAngband variant maintainer - check https://github.com/draconisPW/PWMAngband (or http://www.mangband.org/forum/viewforum.php?f=9) to learn more about this new variant!

                  Comment

                  • Sky
                    Veteran
                    • Oct 2016
                    • 2321

                    #10
                    portal is way better than teleport self. TS, once you near the level cap, tends to cycle 2/3 locations and take you back exactly where you teleported away from.
                    "i can take this dracolich"

                    Comment

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