Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Suggestions ➜ Shortest Path Speedwalking

Shortest Path Speedwalking

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1  2 3  

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #15 on Tue 23 Mar 2004 12:28 AM (UTC)
Message
Quote:

When saving the speedwalk thusly generated, you also specified which two locations it was a path between, and if it were valid for all your characters or just one. There was also a mechanism for generating reverse paths if it was not a one-way kind of path.


In that case, I have gone a fair way down that track already. My plugin detects the room names, and generates the reverse path (you don't have to use it of course).

What it doesn't do at present is take you to the nearest node, although I think that bit would be pretty trivial, or to go multiple legs. One approach would be to simply always go back to a central spot - within reason - and then set out again for somewhere else. This might work OK in a smallish town.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Belshazzar   (9 posts)  Bio
Date Reply #16 on Tue 23 Mar 2004 02:21 AM (UTC)
Message
Poromenos,

Actually the traveling salesman problem is orders of magnitude more difficult. It is what is called an "NP-Complete" problem. (http://www.pcug.org.au/~dakin/tsp.htm) which means nobody has figured out a good algorithm to solve it for large values of n.

This problem, by comparison, is a single-source shortest path problem which can easily be solved in a finite amount of time for large numbers of nodes using serveral well known algorithms.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #17 on Tue 23 Mar 2004 02:37 AM (UTC)

Amended on Tue 23 Mar 2004 04:30 AM (UTC) by Nick Gammon

Message
I am having fairly good results by playing with a bit of recursion.

What I am doing so far is looking at the paths from A to B, and then for each B looking for all paths *from* B (eg. to C) and so on, until we run out of paths. So far this has been fairly quick, although I suspect it will get out of hand soon enough.

The debugging displays show the process in action ...


Darkhaven Square
You are standing within the expanse of the famous Darkhaven Square.  
A stone statue of occupies the square's center, surrounded by gardens of shrubbery 
which enhance the air of serenity and peace here in the center of the city.  
The main road lead away in the cardinal directions, 
while to the northeast and northwest are forested paths.  
The spires of a cathedral can be seen rising to the northwest.  
Exits: north east south west up northeast northwest.

<33/33 hp 100/100 m 110/110 mv>
Current room believed to be [Darkhaven Square]
finding destinations from Darkhaven Square prefix 
considering Darkhaven Academy path {auto} 3e s d
existing = 
** addding destination Darkhaven Academy path = {auto} 3e s d
recursing to find walks from Darkhaven Academy with prefix {auto} 3e s d
  finding destinations from Darkhaven Academy prefix {auto} 3e s d
  considering Entrance to the Academy path {auto} u
  existing = 
  ** addding destination Entrance to the Academy path = {auto} 3e s d{auto} u
  recursing to find walks from Entrance to the Academy with prefix {auto} 3e s d{auto} u
    finding destinations from Entrance to the Academy prefix {auto} 3e s d{auto} u
    considering Darkhaven Academy path d 
    existing = {auto} 3e s d
considering Entrance to the Academy path 3e s 
existing = {auto} 3e s d{auto} u
considering The Darkhaven Inn path 2w s 
existing = 
** addding destination The Darkhaven Inn path = 2w s 
recursing to find walks from The Darkhaven Inn with prefix 2w s 
  finding destinations from The Darkhaven Inn prefix 2w s 
  considering The Tavern path n w s 
  existing = 
  ** addding destination The Tavern path = 2w s n w s 
  recursing to find walks from The Tavern with prefix 2w s n w s 
    finding destinations from The Tavern prefix 2w s n w s 
    considering The Darkhaven Inn path {auto} n e s
    existing = 2w s 
considering The Tavern path {auto} 3w s
existing = 2w s n w s 

  1: Darkhaven Academy ({auto} 3e s d)
  2: Entrance to the Academy ({auto} 3e s d{auto} u)
  3: The Darkhaven Inn (2w s )
  4: The Tavern (2w s n w s )



Result at the end in bold.

The interesting ones here are "Entrance to the Academy" where it went down into the Academy and up again, and "The Tavern" where it went into the Inn and out again.

Now with some removal of redundant paths (eg. merging The Tavern so that it becomes 3w s) it might give fairly good results.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #18 on Tue 23 Mar 2004 03:32 AM (UTC)
Message
OK now, this is all working pretty well. :)

I put in the code to remove backtracks from the generated path, and now get results like this:


Current room believed to be [The Tavern]
  1: Darkhaven Academy (n 6e s (down) )
  2: Darkhaven Square (n 3e )
  3: Entrance to the Academy (n 6e s )
  4: The Academy Healer (n 6e s (down) 6n )
  5: The Darkhaven Inn (n e s )


So I type cg 5 (go to Inn) and when I get there:


Current room believed to be [The Darkhaven Inn]
  1: Darkhaven Academy (n 5e s (down) )
  2: Darkhaven Square (n 2e )
  3: Entrance to the Academy (n 5e s )
  4: The Academy Healer (n 5e s (down) 6n )
  5: The Tavern (n w s )


Let's go to the Academy Healer (cg 4) and see what we see ...


Current room believed to be [The Academy Healer]
  1: Darkhaven Academy (6s )
  2: Darkhaven Square (6s (up) n 3w )
  3: Entrance to the Academy (6s (up) )
  4: The Darkhaven Inn (6s (up) n 5w s )
  5: The Tavern (6s (up) n 6w s )


Yes, it all seems pretty symmetric.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #19 on Tue 23 Mar 2004 03:40 AM (UTC)

Amended on Tue 23 Mar 2004 04:30 AM (UTC) by Nick Gammon

Message
I have now added one more node (from '[Entrance to the Academy] to [The Young Adventurer's Necessities]') - a single walk east, and now when I go back to the Tavern, it factors it in (as three legs: 1) go to Darkhaven Square, 2) go to the Entrance to the Academy. 3) go to The Young Adventurer's Necessities).


Current room believed to be [The Tavern]
  1: Darkhaven Academy (n 6e s (down) )
  2: Darkhaven Square (n 3e )
  3: Entrance to the Academy (n 6e s )
  4: The Academy Healer (n 6e s (down) 6n )
  5: The Darkhaven Inn (n e s )
  6: The Young Adventurer's Necessities (n 6e s e )


This is pretty cool stuff. And fast, I don't notice any time taken to evaluate it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #20 on Tue 23 Mar 2004 03:42 AM (UTC)
Message
For anyone that wants to play with it, the plugin is currently this:


<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE muclient>
<!-- Saved on Monday, March 22, 2004, 4:43 PM -->
<!-- MuClient version 3.47 -->

<!-- Plugin "Automap" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Automap"
   author="Nick Gammon"
   id="23a544e6b6eeb7ea26c29b7d"
   language="VBscript"
   purpose="Creates speedwalks from one checkpoint to another one"
   save_state="y"
   date_written="2004-03-22 16:38:10"
   requires="3.47"
   version="1.1"
   >
<description trim="y">
<![CDATA[
cp - add a checkpoint
cl - list checkpoints from this location
cg x  - go to checkpoint x (eg. cg 5)
cc - clear current speedwalk - start new checkpoint

Automap:help - this description


]]>
</description>

</plugin>


<!--  Get our standard constants -->

<include name="constants.vbs"/>

<!--  Triggers  -->

<triggers>
  <trigger
   back_colour="8"
   bold="y"
   enabled="y"
   match="*"
   match_back_colour="y"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   send_to="9"
   sequence="100"
   text_colour="9"
   variable="room"
  >
  <send>%1</send>
  </trigger>
  <trigger
   enabled="y"
   match="&lt;*&gt;*"
   script="OnGetRoomFromPrompt"
   sequence="100"
  >
  </trigger>
  <trigger
   back_colour="8"
   bold="y"
   enabled="y"
   match="The reddish sun sets past the horizon."
   match_back_colour="y"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   sequence="90"
   text_colour="9"
  >
  </trigger>
</triggers>

<!--  Aliases  -->

<aliases>
  <alias
   script="OnClearcheckpoint"
   match="cc"
   enabled="y"
   sequence="100"
  >
  </alias>
  <alias
   script="OnCheckpointlist"
   match="cl"
   enabled="y"
   sequence="100"
  >
  </alias>
  <alias
   script="OnCheckpoint"
   match="cp"
   enabled="y"
   sequence="100"
  >
  </alias>
  <alias
   script="OnCheckpointgoto"
   match="cg *"
   enabled="y"
   sequence="100"
  >
  </alias>
</aliases>

<!--  Script  -->


<script>
<![CDATA[
'----------------------------------------------------------
'  Load mapping array
'----------------------------------------------------------
Sub OnPluginInstall

  ArrayCreate "map"
  ArrayImport "map", GetVariable ("map"), ","

  ArrayCreate ""  ' work array
  ArrayCreate "dest"  ' destinations array

'
' turn auto-mapping on
'  

  EnableMapping vbTrue  

End Sub

'----------------------------------------------------------
' The plugin is saving its state
'----------------------------------------------------------
sub OnPluginSaveState

'
' Save mapping array
'
  SetVariable "map", ArrayExport ("map", ",")

end sub

'----------------------------------------------------------
'  helper routine to add a new path to the array
'----------------------------------------------------------
Sub AddPath (from_location, to_location, speedwalk)
dim currspeedwalk, currpath, newpath
  
  newpath = EvaluateSpeedwalk (speedwalk)

  ArrayClear ""  ' get rid of previous stuff

'
'  get current entries into work array
'
  ArrayImport "", ArrayGet ("map", from_location), ","

'
'  see what the current path there is
'
  currspeedwalk = ArrayGet ("", to_location)

  If currspeedwalk <> "" Then
    currpath = EvaluateSpeedwalk (currspeedwalk)
    If Len (newpath) > Len (currpath) Then
      ColourNote "white", "red", "New path is: " & speedwalk
      ColourNote "white", "red", "Old path is: " & currspeedwalk
      ColourNote "white", "red", "Retaining older, shorter, path."
      Exit Sub
    End If ' new path longer
  End If  ' have an old path

'
'  note path from last checkpoint
'
  ArraySet "", to_location, speedwalk

  ColourNote "white", "blue", "Path from '[" & _
             from_location & "] to [" & _
             to_location & "] noted as " & _
             speedwalk
'
'  put back new destinations
'
  ArraySet "map", from_location, ArrayExport ("", ",")

End Sub	' AddPath 

'----------------------------------------------------------
'  Make a checkpoint (node)
'----------------------------------------------------------
Sub OnCheckpoint (name, line, wildcards)
Dim room, checkpoint, mapstring


'
'  get into variables to save time and confusion
'
room = trim (GetVariable ("room"))
checkpoint = trim (GetVariable ("checkpoint"))
mapstring = GetMappingString 

If Mapping Then
  If checkpoint <> "" And _
     room  <> "" And _
     mapstring <> "" Then

    AddPath checkpoint, room, mapstring

'
'  now add reverse path
'

    AddPath room, checkpoint, "{auto}" & ReverseSpeedwalk (mapstring)

  End If  ' already have a checkpoint
'
'  note new checkpoint
'
  OnClearcheckpoint "", "", ""

Else
  ColourNote "white", "red", "Auto-mapper not active"
End If ' mapping 

End Sub  ' OnCheckpoint 

'----------------------------------------------------------
' Clear a checkpoint
'----------------------------------------------------------
Sub OnClearcheckpoint (name, line, wildcards)

'
'  clear checkpoint (start from here)
'
  SetVariable "checkpoint", GetVariable ("room")
'
'  start mapping again from here
'
  DeleteAllMapItems

  ColourNote "white", "blue", "New checkpoint started at: " _
     & GetVariable ("room")

End Sub ' OnClearcheckpoint 

'----------------------------------------------------------
'  Remove backtracks from a speedwalk
'----------------------------------------------------------
Function RemoveBacktracks (path)
dim topkey, topitem, w, k, result, count, prev

  RemoveBacktracks = ""
  ArrayCreate "q"
  ArrayCreate "walk"
  ArrayClear "q"
  ArrayClear "walk"

  w = Split (EvaluateSpeedwalk (path), vbCrLf)

  If IsEmpty (w) Then Exit Function

    for each k in w   

    if ArraySize ("q") > 0 then
 
'
'  what is currently at top of queue? (actually a stack)
'
      topkey = CInt (ArrayGetLastKey ("q"))
      topitem = ArrayGet ("q", topkey)

'
'  If we are about to add inverse direction, just discard both
'
      if (topitem = "n" and k = "s") _
      or (topitem = "s" and k = "n") _
      or (topitem = "e" and k = "w") _
      or (topitem = "w" and k = "e") _
      or (topitem = "ne" and k = "sw") _
      or (topitem = "sw" and k = "ne") _
      or (topitem = "nw" and k = "se") _
      or (topitem = "se" and k = "nw") _
      or (topitem = "up" and k = "down") _
      or (topitem = "down" and k = "up") Then
         ArrayDeleteKey "q", topkey
      Else
         ArraySet "q", topkey + 1, k
      End If

    Else
'
'  Nothing in queue - just add it
'
        ArraySet "q", 1, k
    end if  ' anything in queue

  next

'
'  now we have the cleaned up walk in the queue, pull it out again
'   and turn back into a speedwalk string
'
  w = ArrayListValues ("q")

  If IsEmpty (w) Then Exit Function

  result = ""
  prev = ""

  for each k in w

    k = trim (k)
    
    if k <> "" then
   
'
'  multiple length movements must be put in brackets, if not already 
'   (eg. up, down, ne, nw)
'
      if len (k) > 1 and InStr (k, "(") = 0 then
        k = "(" & k & ")"
      end if

      if k = prev Then
        count = count + 1
      else
        if prev <> "" then
          if count > 1 then
            result = result & CStr (count) & prev & " "
          else
            result = result & prev & " "
          end if ' more than 1
        end if  ' having a previous one
        prev = k
        count = 1
      end if   ' change in k
    end if ' not blank k
  next  ' processing each one

'
'  do final one
'

  if prev <> "" then
    if count > 1 then
      result = result & CStr (count) & prev & " "
    else
      result = result & prev & " "
    end if ' more than 1
  end if  ' having a previous one

  RemoveBacktracks = result

End Function  ' RemoveBacktracks 

'----------------------------------------------------------
'   Add destinations to "dest" array from location "from"
'----------------------------------------------------------
Sub GetDestinations (orig, from, speedwalk, indent, level)
dim d, k, existing, path

'debug   Note indent & "finding destinations from " & from & " prefix " & speedwalk

   ArrayCreate level
   ArrayClear level  ' get rid of previous stuff
   ArrayImport level, ArrayGet ("map", from), ","

'
'  check each one
'
   d = ArrayListKeys (level)

   If IsEmpty (d) Then Exit Sub
  
   For Each k In d

   if k <> orig then

     path = ArrayGet (level, k)
     existing = ArrayGet ("dest", k)

'debug     Note indent & "considering " & k & " path " & path
'debug     Note indent & "existing = " & existing

     If existing = "" Then

       ArraySet "dest", k, speedwalk & path
'debug       Note indent & "** addding destination " & k & " path = " & speedwalk & path

'
'  recurse to get destinations from *this* destination
'
   
       If k <> from Then
'debug         Note indent & "recursing to find walks from " & k & " with prefix " & speedwalk & path
         GetDestinations orig, k, speedwalk & path, indent & "  ", level + 1
       End If 
     End If	' not already having a path there

   End If  ' not going to where we started

   Next	' end of doing each destination

End Sub ' GetDestinations 

'----------------------------------------------------------
'  List available checkpoints
'----------------------------------------------------------
Sub OnCheckpointlist (name, line, wildcards)
Dim room, destinations, count, k

  room = trim (GetVariable ("room"))
  count = 0

  ColourNote "white", "blue", "Current room believed to be [" & _
           room & "]"

'
'  get current entries into work array
'
   ArrayClear "dest"
   GetDestinations room, room, "", "", 1
  
   destinations = ArrayListKeys ("dest")

   If Not IsEmpty (destinations) Then
  
    For Each k In destinations
      count = count + 1
      world.ColourNote "white", "blue", "  " & _
          CStr (count) & ": " & k & " (" & _
          RemoveBacktracks (ArrayGet ("dest", k)) & ")"

    Next

   Else
     ColourNote "white", "blue", "No known destinations from here"
   End If

End Sub ' OnCheckpointlist 

'----------------------------------------------------------
' go to a checkpoint
'----------------------------------------------------------
Sub OnCheckpointgoto (name, line, wildcards)
Dim room, destinations, which

  room = trim (GetVariable ("room"))
  which = CInt (wildcards (1)) - 1 ' which choice, make zero-relative

'
'  get current entries into work array
'
   ArrayClear "dest"
   GetDestinations room, room, "", "", 1
  
   destinations = ArrayListKeys ("dest")

   If Not IsEmpty (destinations) Then
  
     If which < lbound (destinations) or _
        which > ubound (destinations) Then
       ColourNote "white", "red", "Destination " & wildcards (1) & _
           " out of range " & CStr (lbound (destinations) + 1) & " to " & _
           CStr (ubound (destinations) + 1)
       Exit Sub
     End If

'
'  go there :)
'
     Send EvaluateSpeedwalk (RemoveBacktracks (ArrayGet ("dest", destinations (which))))

   Else
     ColourNote "white", "blue", "No known destinations from here"
   End If

End Sub ' OnCheckpointgoto 

'----------------------------------------------------------
' deduce room name if on same line as prompt
'----------------------------------------------------------
Sub OnGetRoomFromPrompt (name, line, wildcards)
dim lines, styles, text

  line = GetLinesInBufferCount
  styles = GetLineInfo (line, 11)

'
'  Should be 2 styles, the prompt and the room name
'
  If Styles <> 2 Then Exit Sub

'
'  Room name is bold
'
  If Not GetStyleInfo (line, 2, 8) Then Exit Sub

'
'  Room name is red text
'
  If Not GetStyleInfo (line, 2, 14) = BoldColour (2) Then Exit Sub

'
'  Room name is black background
'
  If Not GetStyleInfo (line, 2, 15) = NormalColour (1) Then Exit Sub

'
'  Get name
'

  SetVariable "room", GetStyleInfo (line, 2, 1)
  

End Sub ' OnGetRoomFromPrompt 


]]>
</script>


<!--  Plugin help  -->

<aliases>
  <alias
   script="OnHelp"
   match="Automap:help"
   enabled="y"
  >
  </alias>
</aliases>

<script>
<![CDATA[
Sub OnHelp (sName, sLine, wildcards)
  world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub
]]>
</script> 

</muclient>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #21 on Tue 23 Mar 2004 03:55 AM (UTC)
Message
Cute though this algorithm is, it doesn't actually find the shortest path, it finds *a* path, especially if multiple nodes are involved. It really needs modifying (probably only a couple of lines) to make it choose the shorter of two alternatives when comparing paths, at present it just takes the first.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #22 on Tue 23 Mar 2004 04:12 AM (UTC)

Amended on Tue 23 Mar 2004 04:13 AM (UTC) by Nick Gammon

Message
A bit more exploring, and I can't really fault the path generation (apart from not really testing to find the shortest). Now I have this lot:


Current room believed to be [The Young Adventurer's Necessities]
  1: Darkhaven Academy (w (down) )
  2: Darkhaven Square (w n 3w )
  3: Entrance to the Academy (w )
  4: Outside the Tower of Sorcery (w n w s )
  5: Quills and Parchments (w n 3w 2s w s )
  6: The Academy Healer (w (down) 6n )
  7: The Alchemist's (w n 3w 2s 2w n )
  8: The Darkhaven Courier (w n 3w 2s 2w s )
  9: The Darkhaven Inn (w n 5w s )
  10: The Scribe's Tent (w n 3w 2s 3w n )
  11: The Shining Emerald (w n 3w 2s 3w s )
  12: The Tavern (w n 6w s )
  13: The Wizard's Tent (w n 3w 2s w n )


I have added another alias "ci" (checkpoint info) so we can see what is generating all this stuff. So far it is:


Darkhaven Academy
  Darkhaven Square = u n 3w 
  Entrance to the Academy = {auto} u
  The Academy Healer = 6n 
Darkhaven Square
  Darkhaven Academy = {auto} 3e s d
  Entrance to the Academy = 3e s 
  Outside the Tower of Sorcery = 2e s 
  Quills and Parchments = 2s w s 
  The Alchemist's = 2s 2w n 
  The Darkhaven Inn = 2w s 
  The Tavern = {auto} 3w s
  The Wizard's Tent = 2s w n 
Entrance to the Academy
  Darkhaven Academy = d 
  Darkhaven Square = {auto} n 3w
  The Young Adventurer's Necessities = e 
Outside the Tower of Sorcery
  Darkhaven Square = {auto} n 2w
Quills and Parchments
  Darkhaven Square = {auto} n e 2n
The Academy Healer
  Darkhaven Academy = {auto} 6s
The Alchemist's
  Darkhaven Square = {auto} s 2e 2n
  The Darkhaven Courier = 2s 
The Darkhaven Courier
  The Alchemist's = {auto} 2n
  The Shining Emerald = n w s 
The Darkhaven Inn
  Darkhaven Square = {auto} n 2e
  The Tavern = n w s 
The Scribe's Tent
  The Shining Emerald = {auto} 2s
The Shining Emerald
  The Darkhaven Courier = {auto} n e s
  The Scribe's Tent = 2n 
The Tavern
  Darkhaven Square = n 3e 
  The Darkhaven Inn = {auto} n e s
The Wizard's Tent
  Darkhaven Square = {auto} s e 2n
The Young Adventurer's Necessities
  Entrance to the Academy = {auto} w


The outdented lines are the nodes, the indented ones the nodes you can get to directly from them, and the path to do so.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Belshazzar   (9 posts)  Bio
Date Reply #23 on Tue 23 Mar 2004 08:12 AM (UTC)
Message
I installed the Automap plugin, and after some tweaking to recognize Two Towers (towers.angband.com) style room names, it seems to work for rooms with unique names. It has trouble dealing with multiple checkpointed rooms named the same thing. Probably because A. they have the same hash key and B. it's hard to tell them apart programmatically anyway.

Was there a feature to add a Special move to a speedwalk by typing in #(Action/Reverse)? It does not work for me anymore. (Whether or not I have the Automap plugin loaded)


The following regexp worked to match t2t room names which are all something like:
The front room of the Half-Mast House(stairs and out)
or
Inside the river gate of the city(s, sw, guardhouse, ne, e, out and nw)

match="^([^ ].*)\(.*\)$"
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #24 on Tue 23 Mar 2004 08:37 AM (UTC)
Message
They are not hashed, it literally stores the room name.

Yes, I can't see how it can tell two different rooms that happen to have the same name, unless you changed it to save a name you supply (eg. you might make it take your supplied name rather than the derived name).

I didn't test unusual speedwalks, the technique you mentioned is not supported. Try going into the Mapper dialog and adding a special direction.

This is all still pretty preliminary, however it is gratifying to see it works as well as it does.

If you used it for a while I think the number of possible destinations would rise quite quickly, so probably the "cl" alias would need to be altered to take an argument, eg. "cl shop".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #25 on Wed 24 Mar 2004 12:47 AM (UTC)
Message
I haven't had much comment on this so far, but it is working pretty well as far as I am concerned. The only problem I see is that it will soon need pruning because the number of destinations will keep rising.

After wandering around Darkhaven for a while, and then going back to the main square, this is what I get:


cl
Current room believed to be [Darkhaven Square]
  1: A Corridor in the Abandoned Mansion (4s 3w n)
  2: Abbigayle's Language Lessons (3e s (down) n w)
  3: Annir's Clothing (4s 2w n)
  4: Armory (2s 2e s)
  5: Darkhaven Academy (3e s (down))
  6: Entrance to the Academy (3e s)
  7: Entrance to the Darkhaven Art Gallery (4s w n)
  8: Intersection of Horizon Road and Falcon Road (4w)
  9: Intersection of Vertic Avenue and Law Avenue (4s)
  10: Intersection of Vertic Avenue and Market Street (2s)
  11: Outside the Tower of Sorcery (2e s)
  12: Quills and Parchments (2s w s)
  13: The Academy Healer (3e s (down) 6n)
  14: The Alchemist's (2s 2w n)
  15: The Blacksmith's Tent (2s e s)
  16: The Butcher's Shop (2s e n)
  17: The Dairy Tent (2s 3e n)
  18: The Darkhaven Bakery (2s 2e n)
  19: The Darkhaven Courier (2s 2w s)
  20: The Darkhaven Inn (2w s)
  21: The Guild of Thieves (3s 2w n)
  22: The Laboratory of Skills and Spells (3e s (down) n e)
  23: The Scribe's Tent (2s 3w n)
  24: The Shining Emerald (2s 3w s)
  25: The Tavern (3w s)
  26: The Wizard's Tent (2s w n)
  27: The Young Adventurer's Necessities (3e s e)
  28: Weaponry Shop (2s 3e s)


You can now filter the places listed by adding a wildcard string (eg. square, shop, tent), like this:


cl tent
Current room believed to be [Darkhaven Square]
  1: The Blacksmith's Tent (2s e s)
  2: The Dairy Tent (2s 3e n)
  3: The Scribe's Tent (2s 3w n)
  4: The Wizard's Tent (2s w n)


You can analyse the raw data collected by checkpointing the various rooms, by typing "ci" (checkpoint info) ...


ci
N1. A Corridor in the Abandoned Mansion
  P1. Annir's Clothing = s e n 
  P2. The Guild of Thieves = {auto} s w n 2e n
N2. Abbigayle's Language Lessons
  P3. Darkhaven Academy = {auto} e s
  P4. The Laboratory of Skills and Spells = 2e 
N3. Annir's Clothing
  P5. A Corridor in the Abandoned Mansion = {auto} s w n
  P6. Entrance to the Darkhaven Art Gallery = s e n 
N4. Armory
  P7. The Dairy Tent = n e n 
  P8. The Darkhaven Bakery = {auto} 2n
N5. Darkhaven Academy
  P9. Abbigayle's Language Lessons = n w 
  P10. Entrance to the Academy = {auto} u
N6. Darkhaven Square
  P11. Entrance to the Academy = 3e s 
  P12. Intersection of Vertic Avenue and Market Street = {auto} 2s
  P13. Outside the Tower of Sorcery = 2e s 
  P14. The Darkhaven Inn = 2w s 
N7. Entrance to the Academy
  P15. Darkhaven Academy = d 
  P16. Darkhaven Square = {auto} n 3w
  P17. The Young Adventurer's Necessities = e 
N8. Entrance to the Darkhaven Art Gallery
  P18. Annir's Clothing = {auto} s w n
  P19. Intersection of Vertic Avenue and Law Avenue = s e 
N9. Intersection of Horizon Road and Falcon Road
  P20. The Scribe's Tent = 2s e n 
  P21. The Tavern = {auto} e s
N10. Intersection of Vertic Avenue and Law Avenue
  P22. Entrance to the Darkhaven Art Gallery = {auto} w n
  P23. Intersection of Vertic Avenue and Market Street = 2n 
N11. Intersection of Vertic Avenue and Market Street
  P24. Darkhaven Square = 2n 
  P25. Intersection of Vertic Avenue and Law Avenue = {auto} 2s
  P26. Quills and Parchments = {auto} w s
  P27. The Blacksmith's Tent = e s 
  P28. The Guild of Thieves = s 2w n 
N12. Outside the Tower of Sorcery
  P29. Darkhaven Square = {auto} n 2w
N13. Quills and Parchments
  P30. Intersection of Vertic Avenue and Market Street = n e 
  P31. The Wizard's Tent = {auto} 2n
N14. The Academy Healer
  P32. The Laboratory of Skills and Spells = {auto} 5s e
N15. The Alchemist's
  P33. The Darkhaven Courier = 2s 
  P34. The Shining Emerald = {auto} s w s
N16. The Blacksmith's Tent
  P35. Intersection of Vertic Avenue and Market Street = {auto} n w
  P36. The Butcher's Shop = 2n 
N17. The Butcher's Shop
  P37. The Blacksmith's Tent = {auto} 2s
  P38. The Darkhaven Bakery = s e n 
N18. The Dairy Tent
  P39. Armory = {auto} s w s
  P40. Weaponry Shop = 2s 
N19. The Darkhaven Bakery
  P41. Armory = 2s 
  P42. The Butcher's Shop = {auto} s w n
N20. The Darkhaven Courier
  P43. The Alchemist's = {auto} 2n
  P44. The Wizard's Tent = n e n 
N21. The Darkhaven Inn
  P45. Darkhaven Square = {auto} n 2e
  P46. The Tavern = n w s 
N22. The Guild of Thieves
  P47. A Corridor in the Abandoned Mansion = s 2w s e n 
  P48. Intersection of Vertic Avenue and Market Street = {auto} s 2e n
N23. The Laboratory of Skills and Spells
  P49. Abbigayle's Language Lessons = {auto} 2w
  P50. The Academy Healer = w 5n 
N24. The Scribe's Tent
  P51. Intersection of Horizon Road and Falcon Road = {auto} s w 2n
  P52. The Shining Emerald = 2s 
N25. The Shining Emerald
  P53. The Alchemist's = n e n 
  P54. The Scribe's Tent = {auto} 2n
N26. The Tavern
  P55. Intersection of Horizon Road and Falcon Road = n w 
  P56. The Darkhaven Inn = {auto} n e s
N27. The Wizard's Tent
  P57. Quills and Parchments = 2s 
  P58. The Darkhaven Courier = {auto} s w s
N28. The Young Adventurer's Necessities
  P59. Entrance to the Academy = {auto} w
N29. Weaponry Shop
  P60. The Dairy Tent = {auto} 2n


The identifying codes at the front are for making deletions. For instance, if you find that a path is incorrect, you can delete it:


cdel p60
Path from [Weaponry Shop] to [The Dairy Tent] deleted.


This might happen because you had to flee combat, or were transported there somehow other than normal walking.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #26 on Wed 24 Mar 2004 12:50 AM (UTC)

Amended on Wed 24 Mar 2004 12:51 AM (UTC) by Nick Gammon

Message
The interesting thing about the database listing is that from (say) the Scribe's tent we only know of 2 (direct) destinations:


...
N24. The Scribe's Tent
  P51. Intersection of Horizon Road and Falcon Road = {auto} s w 2n
  P52. The Shining Emerald = 2s 
...


However by typing "cl tent" when we are there it deduces all the others:


cl tent
Current room believed to be [The Scribe's Tent]
  1: The Blacksmith's Tent (s 4e s)
  2: The Dairy Tent (s 6e n)
  3: The Wizard's Tent (s 2e n)


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #27 on Wed 24 Mar 2004 01:28 AM (UTC)
Message
Quote:

Was there a feature to add a Special move to a speedwalk by typing in #(Action/Reverse)? It does not work for me anymore.


See Game menu -> Do Mapper Special (Ctrl+Alt+D).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Poromenos   Greece  (1,037 posts)  Bio
Date Reply #28 on Wed 24 Mar 2004 10:43 AM (UTC)
Message
The plugin works fine for me too, although the mapper gets confused when i recall... Maybe I should change it so that it will store the current room, and when I type a destination it will move to it if the current room is a known one it will walk to the destination, or prompt me to walk to a known room...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #29 on Wed 24 Mar 2004 08:38 PM (UTC)
Message
Yes, it would get confused by things like recall which move you in a non-standard way.

In fact, while mapping I would avoid:


  • Using 'recall' or movement spells
  • Fleeing combat
  • Auto-following another player
  • Moving quickly (as the "You can't move that way" message can be associated with the wrong direction command)
  • Being transported by another player (eg. an admin) from one place to another


However if any of those things *do* happen just type "cc" (checkpoint clear) to reset the mapping from the current room.

Also be cautious with one-way moves (eg. doors that need opening, one-way portals etc.).

The latest version of the "shortest path" plugin, which I will upload later today, has some extra features:


  • It auto-resets the mapper when you enter a known room (this is to stop tortuous paths being stored when you are really only a couple of moves from a known node)
  • You can add a one-way move ("cp nr" - checkpoint no-reverse) - this stops it generating the reverse path
  • You can delete wrongly-entered moves, so you can tidy up the moves database.
  • You can type "cn" (checkpoint node) which will take you to the most recently-visited known node. It does this by simply taking the mapping direction from the last node and reversing it.
  • You can filter when doing a "cl" (checkpoint list) - eg. "cl shop" - this restricts the displays to lines with that word in them
  • You can manually define a room (eg. "cr Hotel") - this can be useful if you are in an area with lots of rooms with the same name.


I just want to add a final feature - to save/load areas so that you can keep the nodes database down to a manageable size when visiting different areas.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


119,037 views.

This is page 2, subject is 3 pages long:  [Previous page]  1  2 3  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.