Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Vanilla

Reply
 
Thread Tools Display Modes
Old September 5, 2017, 17:51   #1
Sky
Knight
 
Join Date: Oct 2016
Location: Glasgae
Age: 44
Posts: 685
Sky is on a distinguished road
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.
__________________
#ARKENSTONESMATTER
Sky is offline   Reply With Quote
Old September 5, 2017, 22:17   #2
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,573
Donated: $60
Nick is on a distinguished road
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 Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old September 8, 2017, 15:22   #3
kandrc
Adept
 
Join Date: Dec 2007
Posts: 222
kandrc is on a distinguished road
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.
kandrc is offline   Reply With Quote
Old September 8, 2017, 16:39   #4
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,306
AnonymousHero is on a distinguished road
Quote:
Originally Posted by kandrc View Post
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.
AnonymousHero is offline   Reply With Quote
Old September 8, 2017, 17:04   #5
Derakon
Prophet
 
Derakon's Avatar
 
Join Date: Dec 2009
Posts: 7,950
Derakon is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
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...)
Derakon is offline   Reply With Quote
Old September 8, 2017, 17:27   #6
Huqhox
Apprentice
 
Huqhox's Avatar
 
Join Date: Apr 2016
Age: 47
Posts: 51
Huqhox is on a distinguished road
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"
Huqhox is offline   Reply With Quote
Old September 8, 2017, 17:50   #7
Pondlife
Apprentice
 
Join Date: Mar 2010
Location: UK
Posts: 56
Pondlife is on a distinguished road
Quote:
Originally Posted by Derakon View Post
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.
Pondlife is offline   Reply With Quote
Old September 9, 2017, 00:52   #8
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,573
Donated: $60
Nick is on a distinguished road
Thanks guys, build a list and then choose from it is a much better approach than the current one.
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old September 11, 2017, 08:21   #9
PowerWyrm
Veteran
 
PowerWyrm's Avatar
 
Join Date: Apr 2008
Posts: 1,975
PowerWyrm is on a distinguished road
Quote:
Originally Posted by Pondlife View Post
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 http://www.mangband.org/forum/viewforum.php?f=9 to learn more about this new variant!
PowerWyrm is offline   Reply With Quote
Old September 11, 2017, 11:18   #10
Sky
Knight
 
Join Date: Oct 2016
Location: Glasgae
Age: 44
Posts: 685
Sky is on a distinguished road
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.
__________________
#ARKENSTONESMATTER
Sky is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Furyband: Help with failed god quest Theyli Variants 6 May 31, 2016 23:14
Saving game... failed! Jimbo Vanilla 4 November 8, 2013 15:50
[3.3.2] Assertion failed in mon-time.c Gorbad Development 4 March 27, 2012 18:37
Assertion failed in object\identify.c jens Development 10 June 14, 2011 14:48
Failed to Create Temporary File \s87g.1. d1sc0nnected Vanilla 2 April 2, 2008 18:45


All times are GMT +1. The time now is 23:43.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.