MUSHclient generic graphical mapper module

Posted by Nick Gammon on Fri 12 Mar 2010 03:26 AM — 244 posts, 1,052,938 views.

Australia Forum Administrator #0
Nick's mapper engine


I am pleased to release a generic "MUD mapper" engine. It is the product of a considerable amount of work that started off as a mapper for SmaugFUSS, then was modified to work with Achaea and Imperian. However eventually I realised the best thing was to abstract out the "core" mapping part (the non-MUD-specific part) and let individual MUDs just interface with it.

Features


  • Draws in realtime your current room, and the rooms around you, by "walking" outwards from your current location.
  • For each known room a box is drawn to represent the room, and lines for each exit.
  • If the exit room is known then the process is repeated, potentially drawing hundreds of connected rooms.
  • Under control of the calling plugin each room can be individually coloured (e.g. to show shops, trainers, or just to indicate terrain type like water, desert).
  • You can zoom in to see more clearly, or zoom out to see "the big picture".
  • The mapper can be dragged around the screen with the mouse.
  • You can configure its size to be what you desire.
  • You can configure the colours used to display things like known rooms, unknown rooms, etc.
  • You can configure the depth of the search - the bigger the depth the slower it runs, but you see more detail.
  • It is fast, even zoomed right out on Imperian, and displaying over 400 rooms at once, it takes about 0.07 seconds to draw. With 100 rooms visible (zoomed in) it takes about 0.01 seconds to draw.
  • The room name, and area name (if supplied) are displayed on the map.
  • You can LH click on any visible room to speedwalk to that room by the shortest route.
  • Speedwalking is "throttled" so that it only moves from one room to the next once you arrive there. Even then you can add in a configurable delay, in case the MUD requires it.
  • Speedwalking auto-cancels if it detects it has ended up in an unexpected room number enroute.
  • There is a generic "room finder" built in. This can be called by the owner plugin to detect the shortest path to any room - you specify in the calling plugin the condition. For example, nearby shops, trainers, portals, or match on text in the room name. Found rooms can be walked to by just clicking on the hyperlink in the list of found rooms.
  • If the player RH clicks on a room a user-supplied callback is called. This can be used to implement other behaviour. For example, in the Imperian plugin, I made a bookmark feature, so players can bookmark places of interest. You can then quickly go to any of your bookmarked rooms.
  • If you hover over a room with the mouse a plugin-defined message appears (e.g. room name, terrain type, exits)
  • Recently trod paths are shown with a thicker line, so you can see where you have come from.
  • You can colour different areas in different ways, for example you might dim out all but the current area to make the current area stand out more.
  • It is designed to be "MUD neutral". This is done by having the mapper "call back" to the calling plugin whenever it needs room details. The calling plugin can then read a database, get information from memory, or some other method to fill in things like the room name, desired colour, and other details.



How to use


Tutorial: http://www.gammon.com.au/forum/?id=12635

First you install it in a plugin like this:


require "mapper"


Then in the plugin installation function you initialise the mapper like this:


mapper.init { config = config, get_room = get_room, show_help = OnHelp, room_click = room_click  } 
mapper.mapprint (string.format ("MUSHclient mapper installed, version %0.1f", mapper.VERSION))


This specifies some general configuration (like colours, mapper size), and a few callback functions.

  • config is table of colours and other values used to control the mapper's behaviour. The plugin can serialise that to the save_state file to preserve settings between sessions.
  • get_room is called when the mapper needs to know details about a room.
  • show_help is called if the player clicks on the "?" help button on the map.
  • room_click is called if the player RH-clicks on a room.


A simple get_room function might look like this:


function get_room (uid)
 
  local room = load_room_from_database (uid)
  
  if not room then
     return nil  -- room does not exist
  end -- if

  room.hovermessage = room.name   -- for hovering the mouse

  -- desired colours

  room.bordercolour = ColourNameToRGB "lightseagreen"
  room.borderpen = 0 -- solid
  room.borderpenwidth = 1
  room.fillcolour = ColourNameToRGB "green"
  room.fillbrush = 0 -- solid

  -- obviously you would look these up in practice
  room.area = "Darkhaven"
  room.exits = { n = 21001, s = 21002, se = 21003 }

  return room

end -- function


The mapper uses the colours you supply to draw this room. It then uses the exits table to work out which rooms are connected to this one. So in this example the process would be repeated as it drew rooms 21001, 21002 and 21003 (and then repeated again for whatever exits they had).

In practice the function would be more complex, as you work out colour based on terrain or type of room, you would look up area names and exits, and have a more complex "hover" message. However it illustrates the general idea.

Drawing the map


The map is drawn when the plugin wants it to be, by calling the draw function, like this:


mapper.draw (uid)


So once you detect you have changed rooms (however this is done) and you know the new room number or identifier, you just call "draw" to have it drawn. This will cause the mapper to first call back for information about the supplied room number (as described above) and then for each of that room's exits.

Various other function are exposed for use by the caller, such as hide (), show (), zoom_in (), zoom_out (), all of which might be called by aliases in the plugin.

Generic searching


The code below illustrates one of the searches I put into the Imperian/Achaea plugin. It reads from the database doing a full-text search for whatever words you supply in the search alias, getting a list of matching rooms.

It then calls the mapper.find function, passing down the starting room, and a callback function. The mapper then calls this function for each room it finds as it "walks" outwards from the starting room, asking if this room satisfies the condition. If it returns true (or a non-nil value) then that room will be displayed in the "matching rooms" list. It can also indicate if the search is to continue by returning true or false as the second return value. This lets the mapper know whether to keep searching or not. You might return false if you knew all desired rooms had been found, or if you simply only wanted to find one (e.g.. the nearest shop). The count, if supplied, is used as a hint message to the player that some rooms matched the condition, but couldn't be walked to in the scan distance.


function map_find (name, line, wildcards)
 
  local rooms = {}
  local count = 0
  
  -- find matching rooms using FTS3
  for row in db:nrows(string.format ("SELECT uid, name FROM rooms_lookup WHERE rooms_lookup MATCH %s", fixsql (wildcards [1]))) do
     rooms [row.uid] = true
     count = count + 1
  end   -- finding room
  
  -- see if nearby
  mapper.find (
    function (uid) 
      local room = rooms [uid] 
      if room then
        rooms [uid] = nil
      end -- if
      return room, next (rooms) == nil
    end,  -- function
    true,  -- show vnum
    count  -- how many to expect
    )
  
end -- map_find




Download


The mapper module is available here:

http://github.com/nickgammon/mushclient/blob/master/lua/mapper.lua

It may have bugs, new versions will be uploaded from time to time. More documentation is in the source. I will publish an example plugin that uses it shortly.

[EDIT] Changed on 13 March to reverse the sense of LH and RH clicks.

See http://www.gammon.com.au/forum/?id=10138&page=7 (page 7 of this thread) for a suggested plugin that could be used on MUDs that don't directly supply room numbers.
Amended on Sun 18 Aug 2019 07:05 AM by Nick Gammon
Australia Forum Administrator #1

Examples:

Note the yellow desert surrounding the city.

Note the shops which are the brown squares with the different texture.

Amended on Fri 12 Mar 2010 04:59 AM by Nick Gammon
Australia Forum Administrator #2
Example searches...

Bookmarks search


> mapper bookmarks

 
Antioch Shuk (13224) - 7 rooms away [Assorted goods such as vials, weapons, etc.]
Antioch Commodity Tent (14333) - 7 rooms away [Commodity vendor]
Divine Gifts (13233) - 8 rooms away [Designs, flowers, jewelry]
Clothing tent (13805) - 8 rooms away [Clothing patterns vendor]


Shops search



> mapper shops

Gathering tent (13276) - 6 rooms away [Newsroom]
Antioch Treasure Tent (13284) - 6 rooms away [Bank]
Antioch Shuk (13224) - 7 rooms away [Shop]
Antioch Commodity Tent (14333) - 7 rooms away [Shop]
Divine Gifts (13233) - 8 rooms away [Shop]
The Antiochian Refinery (11801) - 8 rooms away [Shop]
Clothing tent (13805) - 8 rooms away [Shop]
Forge of the Lion (13231) - 8 rooms away [Shop]
The Desert Mirage (13232) - 8 rooms away [Shop]
The Stehl Rose (2496) - 9 rooms away [Shop]
Curious Wanderer (2495) - 9 rooms away [Shop]



Full-text search



> mapper find garden


A garden of rock and wind (5356) - 14 rooms away
A garden of sea urchins and coral (14838) - 30 rooms away
The center of the garden (7227) - 39 rooms away
Overlooking a small garden (23865) - 43 rooms away

...

A white pebble path through the garden (23866) - 44 rooms away
Elmwood adjoining garden of a tavern (964) - 45 rooms away
There were 100 matches which I could not find a path to within 50 rooms.




Areas search

(Finds the nearest room in a different area to the current one)



> mapper areas

Victory Circle (13254) - 1 room away [the City of Antioch]
Under the Shuk (14187) - 8 rooms away [the Sewers of Antioch]
Amid the dunes (11263) - 11 rooms away [the Theroc Encampment]
Heartlands nearing desert's edge (264) - 11 rooms away [the Heartlands]

...

There were 95 matches which I could not find a path to within 50 rooms.

Amended on Fri 12 Mar 2010 04:21 AM by Nick Gammon
#3
Hi Nick,

I love the look of this system. I play a Mud that does not have unique room names or numbers. I am guessing this system won't work on Mud's like this...

Please tell me I am wrong? I would love something like this.

Thanks,
Garrion.
USA #4
You would need some sort of cooperation from the MUD to provide unique identifiers for the rooms. It is very complicated to guess at a room's unique identity, and I don't think Nick has code to do that. What kind of MUD do you play? I'm a little surprised that there are no unique rooms. Or did you mean that there are occasionally rooms that aren't unique? (How can a physical location not be unique?)
#5
I'm very excited to see this work being done in such a cool way.

I'm a little concerned by the exits that do not connect on the map window, hoping that will be fixed eventually.

I'll be glad to provide you with a copy of my own mapper script for Lusternia, based on the MudBot module, as it has some nice features for locating people on the map, auto-locating you when you get lost or teleport, and things like that...
USA #6
Larkin said:
I'm a little concerned by the exits that do not connect on the map window, hoping that will be fixed eventually.


Where exit lines don't meet up, they're not supposed to: those exits don't go to the same rooms. The map is drawn with all exits the same length, so it's very easy and common for rooms to overlap. The closest room is drawn first, since it's a breadth-first algorithm, and any rooms that would also occupy that same spot aren't drawn.
#7
My mapper allows for custom lengths on exit lines, to draw the irregular layouts better.

Should also consider one-way exits and special exits (enter portal, transverse ethereal, etc).
USA #8
Larkin said:
My mapper allows for custom lengths on exit lines, to draw the irregular layouts better.

Something I suggested too. What we've got now is still phenomenal though.
Australia Forum Administrator #9
Garrion said:

I love the look of this system. I play a Mud that does not have unique room names or numbers. I am guessing this system won't work on Mud's like this...


I presume you mean you aren't sure which room you are in? The rooms would have to be unique internally.

You could ask nicely if you can find out the unique room number (eg. on a MUSH you could do that). Failing that, you may be able to do something like hash:

<room title> + <room description> + <room exits line>

and have something that usually would be unique. Then the mapper could be made to work.

Otherwise you might point out to the MUD admins that if they aren't prepared to help you get your mapper to work, there are other MUDs around that are. :)
Australia Forum Administrator #10
Larkin said:

I'm a little concerned by the exits that do not connect on the map window, hoping that will be fixed eventually.


As Twisol said, that is intentional. If you get close enough, the lines join. This is one of the problems of mapping 3D space onto a 2D screen (and indeed this has always been a problem for map-makers).

The unjoined lines are a hint that if you go closer there are rooms to be explored there.

Larkin said:

I'll be glad to provide you with a copy of my own mapper script for Lusternia, based on the MudBot module, as it has some nice features for locating people on the map, auto-locating you when you get lost or teleport, and things like that...


This mapper assumes you know where you are (ie. by the MUD telling you a room number/code).

However I am always open to suggestions for improvements.
Australia Forum Administrator #11
Larkin said:

My mapper allows for custom lengths on exit lines, to draw the irregular layouts better.

Should also consider one-way exits and special exits (enter portal, transverse ethereal, etc).


This mapper regenerates the map every time you move from the raw data (ie. current room and its exits). There isn't a "map file" on disk that you can edit and lengthen lines. Having said that I was thinking it could auto-join small gaps.

It currently handles one-way exits by drawing a small arrow.
Australia Forum Administrator #12
Following on from a comment by Twisol before, the mapper now has a "mapper goto x" command. This assumes you know a particular room number, and just want to go there (from wherever you happen to be). For example, in a city you may want to go the bank, or your guild HQ or something.

So this just locates the quickest path to that room, and automatically speedwalks you there.

This would be a handy thing to bind to a hotkey for a place you need to visit often (eg. for a quest).
#13
If you haven't looked at the MudBot mapper module, I seriously recommend giving it a good scan. It's a very well built, albeit a bit confusing, mapper.

You have the database, and MudBot has a plain text file, so the two are similar in that there is a data source from which you start. I'll build a translator from MudBot to SQLite, if the feature set in this new mapper comes together nicely. :)

The plain text format is straightforward and flexible enough that it's incredibly useful. For example:
AREA
Name: Serenwilde Forest.

ROOM v1
Name: Atop an oak.
Type: trees
E: in 438
E: down 100
E: west 2


Defines an area, followed by a room in that area. The room has a vnum (defined by the mapper, not the game, but that can change with ATCP codes now), name, terrain type, and a few exits to other vnums.

A detected exit to the north that isn't yet linked to another room:
DE: north


A detected exit that is locked to the down:
DEL: down


An exit that looks better when the length is doubled (length of 0 is the default), used for rendering ASCII maps:
E: southeast 275
EL: southeast 1


A special exit triggered by a special command and followed by a special message (the 9 is an alias for 'up' in this case, meaning you can send 'up' and the mapper sends 'transverse ethereal' instead):
SPE: 540 9 "transverse ethereal" "You place your hands on the Moonhart Mother Tree..."


That's most of the useful stuff, but there are a few more things like joining two areas together via an exit or substituting a cardinal direction to be rendered for some non-standard exit ('in' can become 'north' on a particular exit on the map).

When I re-wrote the MudBot mapper in Lua, I used Ked's pathfinder algorithm because the MudBot code confused me there. I understand what MudBot is doing but not exactly how. He stores the path tree in the map rooms, such that if you're running along a path and something pushes you into a nearby room, it knows the path from that room already and can keep going toward your destination with no additional effort. Very slick, really.
USA #14
Nick Gammon said:
You could ask nicely if you can find out the unique room number (eg. on a MUSH you could do that).

For whatever reason, many MUD admins have a gut reaction against giving out this data. I think they feel like it's giving information to players that they can exploit. Usually this is a somewhat irrational reaction, IMHO, however the one place it is justified is when you want a maze type of area where rooms intentionally look very similar, and exits aren't necessarily as expected. If you had a mapper program, the whole purpose of the maze would disappear. Now, you might argue that such mazes shouldn't exist, but, well...
Australia Forum Administrator #15
David Haley said:

For whatever reason, many MUD admins have a gut reaction against giving out this data. I think they feel like it's giving information to players that they can exploit.


I think we are moving away from making things hard for the player. MUD numbers are, as far as I can see, quite low these days, and if you are going to make things hard for players by not letting them use mappers, and sending them into very annoying mazes, well I think you and your builders are going to be there on your own.
Australia Forum Administrator #16
Larkin said:

... if you're running along a path and something pushes you into a nearby room, it knows the path from that room already and can keep going toward your destination with no additional effort.


You make an interesting point here. I have amended the mapper plugin (and added a bit more functionality to the engine) so that it remembers the last place you tried to speedwalk to. Then if you have to stop for some reason (eg. closed door, combat, found a nice shop), you can then type "mapper resume" and it recomputes the path to the previous destination from wherever you are now. So in the case of being pushed into (or walking into) a nearby room, that would still work. I am not precomputing all those paths (after all there might be hundreds of them) but the calculation to re-find the path from where you are is very fast.
Australia Forum Administrator #17
I decided to reverse the sense of LH and RH clicks on a room.

Walking to a room is something you do more often than adding a bookmark, so now LH-clicking walks to a room.
USA #18
Nick Gammon said:
I think we are moving away from making things hard for the player. MUD numbers are, as far as I can see, quite low these days, and if you are going to make things hard for players by not letting them use mappers, and sending them into very annoying mazes, well I think you and your builders are going to be there on your own.

Oh, well, I don't disagree with you at all. I was just saying that this is why many players are simply out of luck, unless they are willing to change games, because their admins have this principled opposition to giving players information.
Australia Forum Administrator #19
I think my earlier suggestion of trying to generate a unique ID by hashing room name, room description, and exits, has some chance of success. Any sort of unique ID will do after all. However that slows you down because then you have to manually take each exit to work out where the exits from the earlier room lead. And then go back to confirm that it is a 2-way exit. It's a pain, basically.

It can be done, after all we humans figure it out. However I'm not offering to do it, for a MUD that might only have 20 players on it.
Australia Forum Administrator #20
What's everyone's opinion on this?

I previously had it so you clicked to walk to a room, and sat back watching it move. On the status bar you see "Speedwalks to go: 3" (and then 2, 1, then "Ready"). That was a bit of a confirmation you had got there.

But then I found myself staring at the screen wondering if I should do something else. So I added a display "Speedwalk completed." like this (line in bold):


Antioch Commodity Tent.
This has been marked as holy ground. A wheeled cannon rests here. A 
golden-helmed royal guard is here, a broad scimitar hanging at his side. 
Foreman Rozri stands here, overseeing the production of commodities. There are 
3 elite Justicar of the Shahs here. You see a sign here instructing you that 
WARES is the command to see what is for sale.
You see exits leading north, east, south, and west.
H:52 M:52 <eb> 
w
Speedwalk completed.
The Antiochian Refinery.
This has been marked as holy ground. A spirited Shaahri stallion trots about. A
pile of iron rods sits near the wall. You see a sign here instructing you that 
WARES is the command to see what is for sale.
You see a single exit leading east.
H:52 M:52 <eb> 


But now I'm starting to think it is annoying. What do you think? Have nothing? Have an option? Have the message?
USA #21
Quote:
But now I'm starting to think it is annoying. What do you think? Have nothing? Have an option? Have the message?

Seems that you might as well have the option.
#22
Nick Gammon said:

But now I'm starting to think it is annoying. What do you think? Have nothing? Have an option? Have the message?


My speedwalking shows a message after each prompt indicating the number of moves left and the current direction being sent.
8619h, 6900m, 6900e, 10p, 29400en, 25517w elrxk<>-
[Path calculated in 2063.7660 microseconds.]
[Path: portal exit serenwilde, out, d, d, s, nw, n, w, w, w, n.]
8619h, 6900m, 6900e, 10p, 29400en, 25531w elrxk<>-(11 - portal exit serenwilde) 
You will no longer view the map when you move.
8619h, 6900m, 6900e, 10p, 29400en, 25531w elrxk<>-
You portal to the Portals of Serenwilde.
The Portals of Serenwilde. (Serenwilde Forest.)
Superimposed over this location, an ethereal forest reaches up to the sky. You see a sign here instructing you to use the PORTAL command to enter the aetherplex system. There is an aetherways portal here.
You see a single exit leading out.
8619h, 6900m, 6900e, 10p, 29399en, 25531w elrxk<>-(10 - out) 

Atop an oak. (Serenwilde Forest.)
Superimposed over this location, an ethereal forest reaches up to the sky. A striped badger is here, licking its paws.
You see exits leading west, down, and in.
8619h, 6900m, 6900e, 10p, 29398en, 25531w elrxk<>-(9 - down) 

A wooden ladder. (Serenwilde Forest.)
Superimposed over this location, an ethereal forest reaches up to the sky.
You see exits leading up and down.
8619h, 6900m, 6900e, 10p, 29397en, 25531w elrxk<>-(8 - down)
#23
Nick Gammon said:

I think my earlier suggestion of trying to generate a unique ID by hashing room name, room description, and exits, has some chance of success. Any sort of unique ID will do after all. However that slows you down because then you have to manually take each exit to work out where the exits from the earlier room lead. And then go back to confirm that it is a 2-way exit. It's a pain, basically.

It can be done, after all we humans figure it out. However I'm not offering to do it, for a MUD that might only have 20 players on it.


I play the Discworld mud and am yet to speak to admin about this. I know a lot of players use MUSHclient and a fair few use my plugins so I am hoping that admin will be open to helping getting this to work.

What I am trying to understand is what I need from them to make this work.

By the sound of it I may be able to get it to work using th hash method you described.

Example of output:
[passageway in a cave]
 -*       
   \  |   
    @-*-*-
   /      
 -*     


Plants attempt to grow through the rocks in this part of the cave. Mostly ferns and moss dominate the walls and ground, although the odd dead tree root stretches across the floor. The limestone here is stained from water running down and mixing with the chemicals from the plants. Great chunky boulders mix with finer gravel on the ground, making it difficult to find a quick way between them. The cave goes deeper towards the northwest and southwest while the sweet smell of freedom is to the east.
There are three obvious exits: east, northwest and southwest.


I can start a new thread if you feel this conversation is not appropriate here.

Thanks,
Garrion.
Amended on Sat 13 Mar 2010 12:12 AM by Nick Gammon
Australia Forum Administrator #24
I think there is hope there. The little map itself is probably going to be different for most rooms.

If you can detect the start of the room name (something in square brackets maybe?) or because it is a different colour, and then capture everything up to and including "There are * obvious exits", and then hash the lot, that should give you a unique ID.

Given you can generate that by doing something like:


id = utils.tohex (utils.md5 (name .. map .. desc .. exits))


Now we know the ID we are more or less ready. Now you need to save that to the database, eg.

  • id = hash
  • name = the room name above
  • desc = description (for searching)
  • exits = <break up exits line to get them all> - initially set the destination for each exit to be zero or empty or something.


Now you need to know that moving from room A via exit "n" (or whatever) leads to room B.

This is what I did before Achaea sent the full exit info:


valid_direction = {
  n = "n",
  s = "s",
  e = "e",
  w = "w",
  u = "u",
  d = "d",
  ne = "ne",
  sw = "sw",
  nw = "nw",
  se = "se",
  north = "n",
  south = "s",
  east = "e",
  west = "w",
  up = "u",
  down = "d",
  northeast = "ne",
  northwest = "nw",
  southeast = "se",
  southwest = "sw",
  ['in'] = "in",
  out = "out",
  }  -- end of valid_direction
  
-- try to detect when we send a movement command
function OnPluginSent (sText)
  if valid_direction [sText] then
    last_direction_moved = valid_direction [sText]
--    print ("Just moved", last_direction_moved)
    if current_room and rooms [current_room] then
      expected_exit = rooms [current_room].exits [last_direction_moved]
      if expected_exit then
        from_room = current_room
      end -- if
--     print ("expected exit for this direction is to room", expected_exit)
    end -- if
  end -- if 
end -- function


So basically it stored the last direction I moved every time I moved somehow (eg. keypad, typing, speedwalk).


Now you need to detect a room change (basically the room ID differs from the last one).

Then you can see if you went somewhere, where you didn't know that takes you there (ie. an unknown exit) like this:


-- here when location changes, eg. : Room.Num 7476
function got_room_number (s)
  
  local room_number = s
    
  if not room_number then
    return
  end -- no room number

  current_room = room_number
  mapper.draw (room_number)
  
  if expected_exit == "0" and from_room then
    fix_up_exit ()
  end -- exit was wrong

end -- got_room_number


Notice I draw the map, and then fix the exit (maybe the exit should be fixed first). Now the code in fix_up_exit was:


function fix_up_exit ()

  local room = rooms [from_room]
  
  dbcheck (db:execute (string.format ([[
      UPDATE exits SET touid = %s WHERE fromuid = %s AND dir = %s;
    ]], 
        fixsql  (current_room),     -- destination room
        fixsql  (from_room),       -- from previous room
        fixsql  (last_direction_moved)  -- direction (eg. "n")
        )))
        
  mapper.mapprint ("Fixed exit", last_direction_moved, "from room", from_room, "to be to", current_room)
  
  room.exits [last_direction_moved] = current_room
    
  last_direction_moved = nil
  from_room = nil
  
end -- fix_up_exit


That was the general idea. We know the old room. We know the new room. We know which way we walked. That is enough to fix the exit up.
Australia Forum Administrator #25
Garrion said:

What I am trying to understand is what I need from them to make this work.


If they are going to help, the least they can do is give you a unique room ID. That saves a *lot* of mucking around. Maybe as some configurable option, so that, when enabled, it says something like:


Entering room 23433.


or for your example:


[passageway in a cave] (23433)


Even better is to give you the destinations of exits. That simplifies things *a lot*.

eg.

instead of:


There are three obvious exits: east, northwest and southwest.


... something like:


There are three obvious exits: east(23432), northwest(23431) and southwest(23430).


Then it is just a case of banging that stuff into the database in one hit.
Amended on Sat 13 Mar 2010 12:36 AM by Nick Gammon
Australia Forum Administrator #26

I am working with Lasher to incorporate the mapper module into Aardwolf, to show it works on a different MUD:

Amended on Sun 14 Mar 2010 04:06 AM by Nick Gammon
Australia Forum Administrator #27
A few other features have been added to the latest version:

  • You can choose to suppress drawing of areas other than the current area. This looks good on Aardwolf, where different areas have different scales, so the "outside" is drawn to a different scale than going "into" a zone.
  • You can add, change, or remove existing exits. This lets you add an exit that the MUD may not reveal to you (for example, a hidden exit).
  • You can configure the colour of the various terrains. For example, if you see a desert square in bright yellow, and you want to tone it down a bit, you can configure that "desert" will be a different colour. This immediately affects all rooms of that terrain type.
  • A number of MUDs are offering to supply pre-made mapping databases. This lets you immediately see the layout without having to walk to every room yourself.
  • The plugin designed for Achaea, Imperian (and other) MUDs now has more detection of things that stop speedwalking (like doors, water) and either stops the speedwalk, or attempts to open the door, or swim, as required.


I personally like the look and feel a lot (and not just because I wrote it), because you feel more immersed if you can see what is going on around you.

After all, in real life, when you are walking down a street you see more than one or two houses ahead of you.
#28
I admit up front that I'm very inexperienced in the ways of muds and even less when it comes to scripts and the like. I was trying to follow your guide, but I admit that I'm in over my head as far as figuring this out on my own.

When you said-
=====================================================
First you install it in a plugin like this:


require "mapper"

Then in the plugin installation function you initialize the mapper like this:


mapper.init { config = config, get_room = get_room, show_help = OnHelp, room_click = room_click }
mapper.mapprint (string.format ("MUSHclient mapper installed, version %0.1f", mapper.VERSION))

=====================================================

Could you elaborate on this more? I'm feeling dumb even having to ask this question. Do I create a plugin and put this in it? And also I've downloaded the mapper.lua file and was wondering how I implement it.
#29
Yes, you create a plugin and put that (or something similar, configured for your MUD) into it.
#30
What do I do with the mapper.lua file?
#31
When you install MUSHclient 4.51, mapper.lua is installed into the 'lua' sub-directory for you. It's part of the distribution now.
#32
Ok I'm still having problems. I downloaded 4.51.

======================================================
require "mapper"

mapper.init { config = config, get_room = get_room, show_help = OnHelp, room_click = room_click }
mapper.mapprint (string.format ("MUSHclient mapper installed, version %0.1f", mapper.VERSION))
======================================================

Is this what needs to go into an xml plugin? I'm so confused.
#33
That's only the start of it. There are functions and triggers you need to supply that tell the mapper when you've detected a room, the exits, terrain, etc.

This mapper module is generic and useful for storing and manipulating the map data, but it's left as an exercise to the end user (with help, of course) to make it work for your particular setup.
#34
Ok well I tried making that plug-in and I received an error messege.

========================================================
C:\Program Files\MUSHclient\lua\mapper.lua:1107: No 'config' table supplied to mapper.
stack traceback:
[C]: in function 'assert'
C:\Program Files\MUSHclient\lua\mapper.lua:1107: in function 'init'
[string "Plugin"]:154: in main chunk
========================================================
#35
Try config = {} instead, to use the default configuration.
Australia Forum Administrator #36
As an example of the mapper plugin, see the one I wrote for the ATCP-enabled MUDs (eg. IRE games, like Aetolia, Achaea, Imperian):

http://github.com/nickgammon/plugins/blob/master/ATCP_Mapper.xml

If you are playing one of those it should just work. If not, you can use it as a guideline. It saves rooms to a SQLite3 database for future use. It also uses the ATCP_NJG plugin to grab the ATCP data from the MUD.

There is an example config table you could borrow from it at the very least.
#37
Thanks Nick, I'll see if I can get this working for the CircleMUD I'm playing.
#38
Lusternia is just getting around to adding some of the newer ATCP messages, but I have managed to get a slightly modified version of the mapper module to work with my settings.

I'm not sure of a couple things yet, though.

  1. How do I add a new area and set the area for any particular room?
  2. Is there any mechanism for setting up a special exit such that it links to a particular room? The ATCP doesn't cover special exits too well yet, which will hopefully change in the future.
  3. How do I set the colors for the various terrain types? I found a function for editing the colors, and it looks like it's called by the right-click callback, but the room_click function throws an error:

Run-time error
Plugin: Mapper (called from world: Test)
Function/Sub: mapper.mouseup_room called by Plugin Mapper
Reason: Executing plugin Mapper sub mapper.mouseup_room
[string "Plugin"]:867: bad argument #1 to 'WindowInfo' (string expected, got nil)
stack traceback:
        [C]: in function 'WindowInfo'
        [string "Plugin"]:867: in function 'room_click'
        .\mapper.lua:261: in function <.\mapper.lua:253>
Error context in script:
 863 :     tf [v.name] = v.func
 864 :   end -- for
 865 :       
 866 :   local choice = WindowMenu (mapper.win, 
 867*:                             WindowInfo (mapper.win, 14), 
 868 :                             WindowInfo (mapper.win, 15), 
 869 :                             table.concat (t, "|"))
 870 :    
 871 :   local f = tf [choice]
Australia Forum Administrator #39
I've just uploaded to Git the latest changes in case you are out of sync with them.

I think for that particular message you need to go into the mapper.lua module and make "win" not be local.

Larkin said:

1. How do I add a new area and set the area for any particular room?


There is no present mechanism for adding areas. The workaround is to either use the sqlite3.exe command-line program and a bit of SQL, or one of the SQLite3 GUI editor programs (see their site) to maybe do it a bit more easily.

The SQL would need to look like:


INSERT INTO areas (uid, name, date_added) VALUES ('1234', 'Area name', DATETIME('NOW'))


Larkin said:

2. Is there any mechanism for setting up a special exit such that it links to a particular room? The ATCP doesn't cover special exits too well yet, which will hopefully change in the future.


The right-click mechanism lets you add exits, however only to the known directions.

Larkin said:

3. How do I set the colors for the various terrain types? I found a function for editing the colors, and it looks like it's called by the right-click callback, but the room_click function throws an error:


Once you get that fixed terrain-colour editing should work OK.
#40
I've got several ideas for improvements and tweaks (still want the user-configurable exit lengths), but it's a matter of having the time and patience. Once I got it installed and functioning, I was pretty impressed with what I saw.

Thanks for the scripts and tips!
Australia Forum Administrator #41
I'm sure it can be improved, but it's a start. Suggestions welcome. Take not of the options at the file start:


<!DOCTYPE muclient [
  <!ENTITY show_vnums "true" > 
  <!ENTITY show_timing "false" > 
  <!ENTITY show_completed "false" > 
  <!ENTITY show_database_mods "true" > 
  <!ENTITY show_other_areas "false" > 
  <!ENTITY show_area_exits "true" > 
  <!ENTITY speedwalk_prefix "" > 
]>


They are intended as an easy way of customizing it, however the problem is such changes are global to all worlds, where you might want one to show other areas, and one not. Oh well, future enhancement.

The speedwalk_prefix option is a new idea suggested by Lasher. If non-empty, it does a fast speedwalk rather than waiting for each room change. So in the case of Aardwolf you might make it "run".

Another new option is "show_area_exits" - which if true draws a circle over the nearest room that goes to another area. Effectively this lets you know "how to leave the zone".
#42
I think the logic for when to draw stub exits is incorrect, but I'm unable to tweak and test at this very moment. I noticed last night, however, that even on a small, orthogonal map, it showed stub exits when it should just be showing the full line.

I think that line 692 should look like this instead, maybe:
(drawn [exit_uid] and drawn [exit_uid].coords ~= next_coords) then



I would really like to see database handler functions for the areas, such that the area could be set for a room manually or from a trigger. If an area doesn't exist yet, it needs to be added to the areas table and then it can be set as the area for a room, obviously. While walking around mapping then, you use the current_area (name or id?) for each room you create. So, if you walk into a new area and check SURVEY to get the area name, that becomes your new area for rooms you create, unless you walk back into an area you have mapped and continue there, then you take the area name from the already mapped rooms you pass through. (Hope that makes sense!)

I'm also very interested in variable length exit lines, which I realize is probably a lot easier in ASCII mapping than miniwindow mapping.

The up/down/in/out exits being drawn in ne/nw/se/sw directions isn't always practical or preferred, so an option to draw little symbols like up/down triangles or just the different colored edges would be nice.
USA #43
Larkin said:
I think the logic for when to draw stub exits is incorrect, but I'm unable to tweak and test at this very moment. I noticed last night, however, that even on a small, orthogonal map, it showed stub exits when it should just be showing the full line.

I think that line 692 should look like this instead, maybe:
(drawn [exit_uid] and drawn [exit_uid].coords ~= next_coords) then

I'm pretty sure this has been fixed for several days now; I ran around the Eastern Ithmia in Achaea to create a map, and I noticed it too, but I mentioned it to Nick and he had already pushed a fix to GitHub an hour before. All three of us independently came up with the same solution, though, which is a good sign! ;)
#44
Looking at the latest mapper.lua on GitHub, it doesn't appear fixed to me. Am I missing something?
USA #45
Larkin said:

Looking at the latest mapper.lua on GitHub, it doesn't appear fixed to me. Am I missing something?


I see precisely this in my copy of mapper.lua, which was copied straight from GitHub with no modifications of my own:

      -- if another room (not where this one leads to) is already there, only draw "stub" lines
      if drawn_coords [next_coords] and 
        (not drawn [exit_uid] or drawn [exit_uid].coords ~= next_coords) then


EDIT: I see the difference. Moment so I can figure out what both mean.
Amended on Fri 19 Mar 2010 05:59 PM by Twisol
USA #46
(not drawn [exit_uid] or drawn [exit_uid].coords ~= next_coords) then

"If it hasn't been drawn yet, or it has but it's not the same room, draw a stub."

(drawn [exit_uid] and drawn [exit_uid].coords ~= next_coords) then

"If it has been drawn, and it's not the same room, draw a stub."

At first glance it looks like you're right, Larkin. Not really in the mood to dig in and tinker, though.
Australia Forum Administrator #47
Larkin said:

I think that line 692 should look like this instead, maybe:
(drawn [exit_uid] and drawn [exit_uid].coords ~= next_coords) then



I think you are right - it seems to draw certain spots better with that change. This BTW was one part (getting the stubs right) that too hours.

Larkin said:

I would really like to see database handler functions for the areas, such that the area could be set for a room manually or from a trigger. If an area doesn't exist yet, it needs to be added to the areas table and then it can be set as the area for a room, obviously. While walking around mapping then, you use the current_area (name or id?) for each room you create. So, if you walk into a new area and check SURVEY to get the area name, that becomes your new area for rooms you create, unless you walk back into an area you have mapped and continue there, then you take the area name from the already mapped rooms you pass through. (Hope that makes sense!)


I am hoping to get away from having to send specific MUD commands (like SURVEY) and parse results. The ATCP data should send sufficient information for extra rooms and areas to be added.

Larkin said:


I'm also very interested in variable length exit lines, which I realize is probably a lot easier in ASCII mapping than miniwindow mapping.

The up/down/in/out exits being drawn in ne/nw/se/sw directions isn't always practical or preferred, so an option to draw little symbols like up/down triangles or just the different colored edges would be nice.


Yes, well good luck with changing that. :)

The problem is that mapper is drawn on the fly, as you can see, and it assumes a certain symmetry. So even something like changing the length of an exit would then create a square that doesn't have a room in it, but later iterations should not put a room in. However later iterations, which decide whether to draw a one-way arrow or not (based on whether, one step away, is its target room) would also have to change.

And doing things like moving up from ne means that the target rooms down is no longer sw. So you would have to keep track of which way which exit goes for which room.
Australia Forum Administrator #48
Twisol said:

(not drawn [exit_uid] or drawn [exit_uid].coords ~= next_coords) then

"If it hasn't been drawn yet, or it has but it's not the same room, draw a stub."

(drawn [exit_uid] and drawn [exit_uid].coords ~= next_coords) then

"If it has been drawn, and it's not the same room, draw a stub."

At first glance it looks like you're right, Larkin. Not really in the mood to dig in and tinker, though.


There were certain situations where it didn't draw stubs when it should, and this caused me to move the registering of whether it was drawn yet from the start of the draw_room function to the part that inserts the room into the table "ready for drawing next time". This has probably caused a ripple effect, and I think your proposed solution is correct. More extensive testing might confirm that
#49
I wasn't suggesting that the mapper send MUD-specific commands, like SURVEY, automatically. Just that it should provide a mechanism by which we can set the area for a room, adding it to the database when necessary.

And, the map is drawn on-the-fly the first time you encounter a room, but then with a bit of user fiddling, they should be able to adjust the map to their own liking. If the exit lengths are stored in memory and the database, rendering the map is a snap. If a user makes a weird set of exit lengths, yes, it will look goofy, but that's up to them to fix the goofy parts then. Have a look at the in-game maps drawn in the IRE games for examples that work nicely.

Those in-game maps also use the symbolic representation of the in/out/up/down exits, which is one reason I suggest that option.
Australia Forum Administrator #50
Imperian seem to have released the XML file I used to generate the map publicly:

http://www.imperian.com/maps/map.xml

You may be able to deduce the URLs for their other games.

First, you may wish to rename any existing database you have created from scratch, just in case.

Now:

  1. Grab and install this plugin:

    http://github.com/nickgammon/plugins/blob/master/Create_ATCP_Map_Database.xml
  2. Type (ie. this is an alias): create map database
  3. Browse to the XML file you downloaded.
  4. A new mapper database will be generated (its name based on the current world name and port number). So for example it might be: imperian.com_23.db. This may take 10 seconds or so. The world will appear to lock up while that is happening, but the status bar should show its progress.


Note that, by design, user-entered bookmarks and zone colours are in a separate database, eg. imperian.com_23_bookmarks.db

Thus they will not be replaced or modified in any way by the database creation plugin.

However any custom exits or modifications you made to the original database will be lost, as it drops all existing tables and recreates them.

I note that the IRE MUD databases so far seem to omit some rooms, quite possibly by design.

The output from the mapper database creation should look something like this:


No tag found on line: ?xml version="1.0"?
found 81833 xml lines
found 180 areas
found 14503 rooms
found 14503 /rooms
found 14503 coordinates
found 38067 directions
found 69 environments


(Don't worry about the warning message about the ?xml line).

Amended on Fri 19 Mar 2010 11:23 PM by Nick Gammon
Australia Forum Administrator #51
Larkin said:

I wasn't suggesting that the mapper send MUD-specific commands, like SURVEY, automatically. Just that it should provide a mechanism by which we can set the area for a room, adding it to the database when necessary.


With the supplied database the requirement to add new areas should diminish somewhat.

Larkin said:

And, the map is drawn on-the-fly the first time you encounter a room, but then with a bit of user fiddling, they should be able to adjust the map to their own liking.


Not at all. It is drawn on-the-fly every time you encounter a room. The map is never stored as such. It is deduced by walking outwards from the current room, using known exits. In fact if you see the way sometimes an exit is drawn and sometimes a stub is there, you will appreciate that annotating virtually *any* exit as "I want a longer line here" may affect its ability to render that room correctly when you move around.
Australia Forum Administrator #52
Larkin said:

Those in-game maps also use the symbolic representation of the in/out/up/down exits, which is one reason I suggest that option.


I see no problem with someone making little triangles to indicate up/down (how do you indicate in/out?).

Note that when you zoom out the whole room box is only about 4 pixels wide, and once you draw a ne/nw/n line that only leaves about 1 pixel to draw your triangle in, so you may be struggling a bit.
#53
Nick Gammon said:

Not at all. It is drawn on-the-fly every time you encounter a room. The map is never stored as such. It is deduced by walking outwards from the current room, using known exits. In fact if you see the way sometimes an exit is drawn and sometimes a stub is there, you will appreciate that annotating virtually *any* exit as "I want a longer line here" may affect its ability to render that room correctly when you move around.


To clarify what I meant, it's drawn on-the-fly, but not created on-the-fly. That is, you have the room/exit/area data in memory and/or on disk, and you use that to generate the map. My mapper generates maps on demand, and it could do so every time you move to a new room, but those exit lengths get drawn to the length I set them every time.


I had thought about the up/down getting tiny when the map is zoomed out that far, which was one of the reasons I suggested changing the color of one or more sides might be more doable. You could change the west/left side for an in exit, the north/top side for an up exit, and vice versa.

The zMUD/CMUD mapper puts tiny markers just outside the room box, so that's another possibility.


In your mapping thus far, how do you get the area into a particular room? Do you have functions for this that aren't part of the public mapper module? Or am I still just completely missing what you're saying? I don't think there are ATCP messages for the area, unless that's supposed to be a part of the Room.Info message and hasn't been done for Lusternia yet.


Thanks again. Interesting discussion, I think. :)
USA #54
Larkin said:
In your mapping thus far, how do you get the area into a particular room? Do you have functions for this that aren't part of the public mapper module? Or am I still just completely missing what you're saying? I don't think there are ATCP messages for the area, unless that's supposed to be a part of the Room.Info message and hasn't been done for Lusternia yet.


I believe it's been added as part of the Room.Coordinates message, which has content like area,x,y,z[,building], where 'building' is optional.
Australia Forum Administrator #55
Larkin said:

I had thought about the up/down getting tiny when the map is zoomed out that far, which was one of the reasons I suggested changing the color of one or more sides might be more doable. You could change the west/left side for an in exit, the north/top side for an up exit, and vice versa.


My mapper does exactly that already. The up/down, and in/out lines are drawn in a different colour. And regardless of whether it draws the line or not (in case the line position is already in use) it draws a coloured line down one side of the box for each of those four directions.
#56
I downloaded the Lusternia XML map now and converted it to SQLite using your plugin. I set it to capitalize room and area names on the conversion, though. Shame the environments aren't included in the XML.

Testing it out, I am very disoriented by the layout of the map, to the point where I can't figure out the exits from my room or a path from point A to point B. I think I'll be working on the exit length thing, if I manage to figure out how to merge bits of my renderer with yours.
USA #57
Larkin said:
Testing it out, I am very disoriented by the layout of the map, to the point where I can't figure out the exits from my room or a path from point A to point B.


I have that problem in areas that are slightly illogical, too. The Western Ithmia is pretty hard to navigate with this at the moment. Keep us posted on your progress!
Australia Forum Administrator #58
Larkin said:

I can't figure out the exits from my room or a path from point A to point B. I think I'll be working on the exit length thing, if I manage to figure out how to merge bits of my renderer with yours.


Left- click on point B and it will path you there.
Australia Forum Administrator #59
Larkin said:

I downloaded the Lusternia XML map now and converted it to SQLite using your plugin. I set it to capitalize room and area names on the conversion, though. Shame the environments aren't included in the XML.


They are in some of them. Try copying and pasting from one that has it. You may not get all of them but you should get some (eg. Urban)
USA #60
Nick Gammon said:

Larkin said:

I can't figure out the exits from my room or a path from point A to point B. I think I'll be working on the exit length thing, if I manage to figure out how to merge bits of my renderer with yours.


Left- click on point B and it will path you there.


I think it's more an issue of figuring out which room to click on, honestly.
#61
Nick Gammon said:

Left- click on point B and it will path you there.


I was in/near a room with northwest, southeast, up, and down exits, which made finding the neighboring rooms a real challenge. That's part of what I'm getting at, I guess.

Maybe the coordinates, especially Z, can help with this. I haven't looked closely enough to see if the X and Y are simply relative or if they're absolute, as in constant exit length versus variable exit length.


I don't see a single environment anywhere in the Lusternia map, at least not the current version available on the site.
Australia Forum Administrator #62
Larkin said:

Testing it out, I am very disoriented by the layout of the map ...


Is it because you are used to a different layout, or is there a more fundamental problem?

I note with interest that earlier today when I was playing with the Aardwolf implementation, it *can* get confusing you have have "show all areas" turned on. This is because in their case the outside areas are a different scale to the inside ones, and thus things just illogically appear everywhere. However with only one area visible it looks a lot better.

Maybe we need to do the same with the Z axis? ie. Not show rooms where you have to go up or down to get to them.

This makes quite a bit of sense, because if you are in the middle of town, you can normally see far off to the distance north, south, east, and west, but you can't see the contents of a cellar which might be quite close to you, but underground.
USA #63
Nick Gammon said:
Maybe we need to do the same with the Z axis? ie. Not show rooms where you have to go up or down to get to them.


This is partly what I suggested before, about being able to change exits so they went up/down a "level" and weren't rendered. I'd be all for this.
Australia Forum Administrator #64
I have pushed the changes to mapper.lua and ATCP_Mapper.xml to GitHub. These let you choose whether or not to see other "levels" than your current one.
#65
I've had a chance to mess around with this a bit more recently, and though I'm not "done" with it yet, I thought I'd share a few comments.

The "find" functionality only searches for nearby rooms, which means you can't easily look up rooms in other areas and you can't find rooms while offline. I feel like there should be a 'mapper nearby (wildcard)' and a more general 'mapper find (wildcard)' to keep them separate and both useful at the same time.

The ATCP mapper updates when you see into rooms other than your own, such as a GLANCE, OBSERVE, SCRY, etc. Not a big deal, but thought it worth noting as it goofs up the map display and could affect someone actively mapping out an area.

That said, I've always found it very useful to be able to render the map for an arbitrary room, just to get a picture of where someone or something is located before I jump in. Maybe an alias for that?

It's also nice to have an alias that shows you the room info for an arbitrary room, listing the environment, exits to whichever rooms, and anything else that might be stored. I know the map does that with mouseover tooltips, but an alias might still be useful. Easy for someone like to me to implement, anyway, so not a big deal.

I've found it helpful to compute a path to a certain room without actually starting along that path right away. Sometimes you want to go at your own pace, but you'd like to know how to get from A to B.


I'm trying to convince IRE to add more details to their XML map format, so we can hopefully improve the map display with things like special exits and exit lengths.

When I get a larger chunk of free time, I also want to investigate drawing the rooms at the pre-determined coordinates given in that XML file, to see if the exit lengths are necessary at all or if they can be done more on-the-fly after the rooms are placed where they belong.
USA #66
Larkin said:
When I get a larger chunk of free time, I also want to investigate drawing the rooms at the pre-determined coordinates given in that XML file, to see if the exit lengths are necessary at all or if they can be done more on-the-fly after the rooms are placed where they belong.

The maps emitted from the MAP command are generated on the fly based on those coordinates, I believe. Testing in Eleusis shows that rooms right next to eachother, with one '-' between them, change the coordinate by 1, while rooms with three -'s between them change the coordinate by 2. For the record, as a cartographer I always found it immensely easier to always use odd numbers of exits. Even numbers throw it out of whack. So this makes total sense to me.
Australia Forum Administrator #67
Larkin said:

The "find" functionality only searches for nearby rooms, which means you can't easily look up rooms in other areas and you can't find rooms while offline. I feel like there should be a 'mapper nearby (wildcard)' and a more general 'mapper find (wildcard)' to keep them separate and both useful at the same time.


Well that is a straight database lookup. Already in the plugin is this:


  local rooms = {}
  local count = 0
  
  -- find matching rooms using FTS3
  for row in db:nrows(string.format ("SELECT uid, name FROM rooms_lookup WHERE rooms_lookup MATCH %s", 
             fixsql (wildcards [1]))) do
     rooms [row.uid] = true
     count = count + 1
  end   -- finding room


It uses that information to see if anything in the rooms array is nearby. To find things anywhere just display the resulting rooms and descriptions.

Larkin said:

The ATCP mapper updates when you see into rooms other than your own, such as a GLANCE, OBSERVE, SCRY, etc. Not a big deal, but thought it worth noting as it goofs up the map display and could affect someone actively mapping out an area.


Sounds like a bug if they are sending down room info without making it clear it isn't the room you are in.

Larkin said:

That said, I've always found it very useful to be able to render the map for an arbitrary room, just to get a picture of where someone or something is located before I jump in. Maybe an alias for that?


An alias that calls mapper.draw for any supplied room number would do that, certainly.

Larkin said:

It's also nice to have an alias that shows you the room info for an arbitrary room, listing the environment, exits to whichever rooms, and anything else that might be stored. I know the map does that with mouseover tooltips, but an alias might still be useful. Easy for someone like to me to implement, anyway, so not a big deal.


Again, a simple SELECT of the database would achieve that.

Larkin said:

I've found it helpful to compute a path to a certain room without actually starting along that path right away. Sometimes you want to go at your own pace, but you'd like to know how to get from A to B.


I initially displayed that, then took it out in favour of a hyperlink that "just does it". However if you call "build_speedwalk (path)" - that will return the speedwalk string.

Larkin said:

I'm trying to convince IRE to add more details to their XML map format, so we can hopefully improve the map display with things like special exits and exit lengths.


I think their current position is that the coordinates value (which is in the database) tells you how far rooms are from each other.
Amended on Wed 24 Mar 2010 08:42 PM by Nick Gammon
#68
Right! I figured it would all be simple enough to do, but I thought perhaps you'd want to update the base mapper with a few of this nice little things, too.

I'm going to work out the rendering of rooms at their designated coordinates eventually.

The special exits will still be a trick. I know plenty of MUDs have these sorts of exits (aka teleports), so it would be a general sort of thing, I think. My current mapper uses an alias to setup the next command as a special exit (to a room being created or a particular vnum), and that alias gets remembered and included in speedwalks.
Australia Forum Administrator #69
I admit my current mapper does not really address the issue of having to take special exits like teleports. I suppose I thought that was detail that could be worked out easily enough, once the base idea is bedded down.
USA Global Moderator #70
Hmm. You have the ability to set arbitrary border thickness on room boxes, but none of the windowline drawing accounts for that. And the rounded ends on the exit lines visually muck up intersections for any that are wider than 1 pixel.
Australia Forum Administrator #71
The exit lines I noticed - well spotted - you are the first to comment.

I wasn't troubled too much, it can be fixed, and I think the simplest way would be to defer drawing the boxes until later so they get plonked on top of the exit lines.

It didn't happen initially until I started drawing thicker lines to show where you had been.
USA Global Moderator #72
Also, what an odd close box. I think people might be more familiar with something like...

-- close box
WindowRectOp (win, 1, x + frame_width - box_size - GAP * 2, y + 1, x + frame_width - GAP * 2, y + 1 + box_size, 0x808080)
WindowLine (win, x + frame_width - box_size - GAP * 2 + 3, y+4, x + frame_width - GAP * 2 - 3, y - 2 + box_size, 0x808080, 0, 1)
WindowLine (win, x-4 + frame_width - GAP * 2, y+4, x-1 + frame_width - box_size - GAP * 2 + 3, y - 2 + box_size, 0x808080, 0, 1)
USA #73
Hmm. Suppose you could put a sort of sparkly in the center of a room that has a teleport, or special exit, then another in the destination room (by sparkly, I mean something animated, so it stands out), and color them each something fairly unique. If you clicked on the room, or what ever you do to get more information on one, you just light up both the one in that room, and the destination. That way you could use colors to designate "type" of exit, and only to linked ones will "light up" when checking against the map (mouse over maybe, to show them?). Mind, you might have multiple "special exits", in which case.... cycle the colors and light ups, or something? Hmm.
Australia Forum Administrator #74
Fiendish said:

Also, what an odd close box. I think people might be more familiar with something like...

-- close box
WindowRectOp (win, 1, x + frame_width - box_size - GAP * 2, y + 1, x + frame_width - GAP * 2, y + 1 + box_size, 0x808080)
WindowLine (win, x + frame_width - box_size - GAP * 2 + 3, y+4, x + frame_width - GAP * 2 - 3, y - 2 + box_size, 0x808080, 0, 1)
WindowLine (win, x-4 + frame_width - GAP * 2, y+4, x-1 + frame_width - box_size - GAP * 2 + 3, y - 2 + box_size, 0x808080, 0, 1)


Yes, that looks better. Thanks, Fiendish.
Denmark #75
Hi,

Is there any way to make this work with an lpmud-style mud like 3-Kingdoms, if anyone is familiar with that mud?

Theres no visible roomnumbers or otherwise uniqueness to the rooms visible to the player. Altho its mappable with for instance the zmud/cmud-mapper, setting it up to grab room exits/short description etc.

Any input/thought on this?

/kg
#76
is there any way to customize the connection between rooms?
for instance, enter a room needs a few actions or/and wait some reaction of NPC.
is it possible of implementing those "complex connection" with current lua mapper module?
Australia Forum Administrator #77
Killergate said:

Hi,

Is there any way to make this work with an lpmud-style mud like 3-Kingdoms, if anyone is familiar with that mud?

Theres no visible roomnumbers or otherwise uniqueness to the rooms visible to the player.


Well it won't be totally trivial. The mapper module itself will draw stuff when it knows the room identifier. If you can detect the room name/description in a trigger you might be able to hash that to give each room a unique hash id.

Then you need to detect exits (eg. if you go east you need to remember that, so that when going east from room 1234, and you find yourself in room 1235, you remember that so next time you can tell the mapper where the east exit from room 1234 goes).
Australia Forum Administrator #78
Stellit said:

is there any way to customize the connection between rooms?
for instance, enter a room needs a few actions or/and wait some reaction of NPC.
is it possible of implementing those "complex connection" with current lua mapper module?


There is no provision for that at present. Waiting for NPC interaction can be a bit tricky. That is more something you would do with a trigger, and then attempt to keep speedwalking from that point.
#79
I dream of one day having a map like this for Dark-Legacy haha :P Cept, I'd have to set it up a bit different. It has a world map and then areas and dungeons that you enter on the map itself. Would cool to have the entire world map mapped and every area mapped... *drools* or better yet every dungeon lol I should totally hire an experienced coder rofl
#80
Any chance of getting a render function that takes advantage of the pre-calculated X,Y[,Z] coordinates to properly space rooms and avoid the "broken" exit thing?


And, if I want to leverage this module/plugin, making my own customizations on top of the script, how would I best do that? I mean, I don't want to edit your code directly because I would like to include any future enhancements without having to merge yours and mine. So, I want to essentially wrap your mapper script, add a few things, override one or two things, and use that in my own plugin. Suggestions?
#81
Ok, so I'm looking at this mapper. And I'll be honest, I haven't a clue how it works. I'm hoping to puzzle that out later. As I learn some Lua maybe in a month or so. I think the first step is to get triggers to feed this thing the necessary raw room information (and I can worry about fixing it later). I have working triggers that can capture room info for another project I had started prior to seeing this mapper. So... how do I adapt them for this?


<triggers>
  <trigger
   enabled="y"
   lines_to_match="3"
   keep_evaluating="y"
   match="^([A-Za-z\'\,\- ]+)\n([^\n]*)\nThere are no obvious exits\.$"
   multi_line="y"
   regexp="y"
   script="ProcessRoom0"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="y"
   lines_to_match="3"
   keep_evaluating="y"
   match="^([A-Za-z\'\,\- ]+)\n([^\n]*)\nThere (is|are) (\w+) (obvious exit|exits)\: (.[^\.]+)\.$"
   multi_line="y"
   regexp="y"
   script="ProcessRoom1"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="y"
   lines_to_match="4"
   keep_evaluating="y"
   match="^([A-Za-z\'\,\- ]+)\n([^\n]*)\nThere (is|are) (\w+) (obvious exit|exits)\: (.[^\.]+)\n(.[^\.]+)\.$"
   multi_line="y"
   regexp="y"
   script="ProcessRoom2"
   sequence="100"
  >
  </trigger>
  <trigger
   enabled="y"
   lines_to_match="5"
   keep_evaluating="y"
   match="^([A-Za-z\'\,\- ]+)\n([^\n]*)\nThere (is|are) (\w+) (obvious exit|exits)\: (.[^\.]+)\n(.[^\.]+)\n(.[^\.]+)\.$"
   multi_line="y"
   regexp="y"
   script="ProcessRoom3"
   sequence="100"
  >
  </trigger>


The old version is written in python, and I'll have to convert the specifics later. But here are those functions:


def ProcessRoom0(TriggerName, trig_line, wildcards):
	ProcessRoom(str(wildcards[0]), str(wildcards[1]), 'There are no obvious exits.')

def ProcessRoom1(TriggerName, trig_line, wildcards):
	ProcessRoom(str(wildcards[0]), str(wildcards[1]), str(wildcards[5]))

def ProcessRoom2(TriggerName, trig_line, wildcards):
	ProcessRoom(str(wildcards[0]), str(wildcards[1]), str(wildcards[5])+str(wildcards[6]))

def ProcessRoom3(TriggerName, trig_line, wildcards):
	ProcessRoom(str(wildcards[0]), str(wildcards[1]), str(wildcards[5])+str(wildcards[6])+str(wildcards[7]))

def ProcessRoom(tName, tDesc, tExits):
	global gRoomName, gRoomDescription, gExitDescription
	
	world.Note('Debug Note: Room Trigger Fired')
	
	gRoomName = tName
	gRoomDescription = tDesc
	gExitDescription = tExits
	ProcessText()


As you can expect I have further code that does all sorts of things to get these to be the same every time you go to a room (i.e. extract information that is character dependent/time of day dependent/etc...)

For now, I'd be ecstatic if I can get that working, the rest is a matter of me figuring out Lua enough to rewrite my python code.
#82
You should give the ATCP mapper module a try first before you write too many unnecessary triggers.
#83
Well, I gave it a whirl for the hell of it--as suggested. Doesn't throw any errors, but also doesn't seem to work. Probably because the mud isn't ATCP, whatever that is. Or maybe because I can't figure out how to create a new database.
USA #84
If it's not an IRE, chances are extremely small that it uses ATCP (Achaea Telnet Client Protocol).
#85
I was 99% sure LupusFatalis was an IRE gamer, and those triggers look suspiciously like every IRE game I've seen so far. (Note: if it is an IRE game, you need to install the plugin before you connect or the ATCP won't be enabled.)



Okay, I've been looking at the room rendering code, and what should (in theory) be an easy change is giving me a small headache.

I want to draw the rooms are their game-supplied x,y coordinates instead of assuming standard exit lengths. I changed a couple of lines in draw_room to make this happen, but I'm terrible with coordinate systems...

local dist_x = room.x - rooms[current_room].x
local dist_y = room.y - rooms[current_room].y

local next_x = x + (ROOM_SIZE + DISTANCE_TO_NEXT_ROOM) * dist_x
local next_y = y + (ROOM_SIZE + DISTANCE_TO_NEXT_ROOM) * dist_y


Any clues on what I should be doing instead?
#86
nah, I believe the code is heavily modified LPmud. First came about in 1991, I think the ATCP thing came about after that, as the mud that bears its name says its ~9 years old.

Anyhow, assuming with triggers I can determine the appropriate room name, description, and exits how can I set it, etc...

I suppose a better question might be, has anyone modified the code to work for something other than ATCP? And if so, is it somewhere that I can take a peek at it?
#87
Larkin said:
Any clues on what I should be doing instead?


Sure, that is something I can figure out pretty easily if you can let me know what the variables you actually want are...

i.e. specifically what are:
dist_x := ?
next_x := ?
DISTANCE_TO_NEXT_ROOM := ?
ROOM_SIZE := ?

i.e. I'm assuming you have the current coordinates
(x,y) and new coordinates (x',y')

that for dist_x you want the distance between the points if they were both projected onto the x axis? dist_y similar.
if so... |x'-x| will do. y similar. But if your actually looking for the length of the line segment connecting:
(x',y') and (x,y) then you'll want:
length = sqrt( (x'-x)^2 + (y'-y)^2)

In short, what specifically do you know, and what do you want to find?
#88
Well, Nick isn't using the room coordinates to draw the rooms (IRE games now provide room coordinates for us, which implicitly defines the length of the exit connectors when drawing a map), instead assuming all exits are of "length 1," essentially.

I want to render the room boxes at the coordinates as they're known, relative to the box in the center. So, if you draw(1234), you have X and Y for room 1234 as your center on that map.

Nick picks up the X, Y, and even Z coordinates from the game, but they're not actually used to render the map. I'm just trying to fix that.
#89
Ah, I see. What your trying to do.

Ok, for simplicity, consider the center of the map to have pixel coordinates (0,0). Its simple enough to translate everything accordingly after you get the other part working (as this probably isn't the case).

So your current room A has coordinates (x,y) room B has coordinates (x',y').

Your location on the map for A is going to be (0,0). But its more than 1 pixel, so lets say its the square formed by: (-d,d), (-d,-d), (d,-d), (d,d)

Your 'local' coordinates for (x',y') are going to be Length*(x'-x,y'-y). I.E. whatever you want the spacing to be between the center of the squares. So your square for that will be drawn inside: (l(x'-x)-d,l(y'-y)+d), (l(x'-x)-d,l(y'-y)-d), (l(x'-x)+d,l(y'-y)-d), (l(x'-x)+d,l(y'-y)+d)

Hope that helps somewhat, I gotta run, but I'll peek back here later.
#90
To be clear above I have:
l := some constant that represents the smallest unit distance between 2 rooms
d := half the length of a side of a square representing a room. i.e. each room is 2d x 2d

Now, its likely that you actually start in a corner or something, in which case you calculate the center location and add that as a constant to the above formula.
#91
Alright folks, I've learned a little Lua and now have a plugin which will extract the following room information and remove all the variable components so that every time you visit the room it displays the same information.

room.name --string
room.desc --string
room.exit_desc --string
room.exit --array of strings

I also capture the direction when I'm attempting to move a valid direction.

So the question now is... How do I integrate this with the mapper and database?
Australia Forum Administrator #92
Right. I have done a simple plugin (below) which illustrates integrating the mapper into a MUD which does NOT use telnet negotiation.

Basically we need to do a few things:

  • Work out a unique ID (uid) for every room. In the plugin below I assume that if you concatenate the room name, room description, and room exits, this will be unique. This is then hashed to give an "id" like 1A3C0D23623EE643AB5D61B2C.
  • Initialize the mapper (done in OnPluginInstall).
  • Load previously-saved room and mapper config (also done in OnPluginInstall)
  • Save new room information (done in OnPluginSaveState)

    Note that this simple example just serializes the room data in the plugin state file. A better method would be to use the SQLite3 database, but I left that out to make the example simpler.
  • Detect when we have changed rooms and call mapper.draw to update the map.
  • The draw routine needs to know room information for each room, so we provide a callback function "get_room" which returns information for the requested room (if available) from the table of rooms.
  • Detect where exits lead. We do this by noticing when we move (in OnPluginSent) and remembering the direction. We also remember where we were when we moved. Then upon arriving at a new room we can calculate that if we (say) were in room 12345, and we went west, and we are now in room 12346 then the west exit in room 12345 must lead to 12346. This information is used to update the rooms table.

    Note that we are not sure the inverse applies so we need to go back to the original room for the reverse exit to be entered.


That's basically it. You should be able to use this on any MUD where you can detect room names, descriptions and exits. The trigger I used to detect room names is pretty simple (it just matches on the line colour). You can probably improve on that somewhat.

Template:saveplugin=Simple_Mapper
To save and install the Simple_Mapper plugin do this:
  1. Copy the code below (in the code box) to the Clipboard
  2. Open a text editor (such as Notepad) and paste the plugin code into it
  3. Save to disk on your PC, preferably in your plugins directory, as Simple_Mapper.xml
    • The "plugins" directory is usually under the "worlds" directory inside where you installed MUSHclient.
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Simple_Mapper.xml (which you just saved in step 3) as a plugin
  7. Click "Close"
  8. Save your world file, so that the plugin loads next time you open it.



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Monday, April 26, 2010, 7:21 AM -->
<!-- MuClient version 4.51 -->

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

<muclient>
<plugin
   name="Simple_Mapper"
   author="Nick Gammon"
   id="dd07d6dbe73fe0bd02ddb63d"
   language="Lua"
   purpose="Shows the mapper module in use"
   save_state="y"
   date_written="2010-04-26 07:21:01"
   requires="4.51"
   version="1.0"
   >

</plugin>


<!--  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"
   name="Name_Line"
   script="Name_Line"
   sequence="100"
   text_colour="11"
  >
  </trigger>
  
  <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"
   name="Name_Or_Exits"
   script="Name_Or_Exits"
   sequence="100"
   text_colour="15"
  >
  </trigger>
  
</triggers>

<!--  Script  -->


<script>
<![CDATA[

require "mapper"
require "serialize"
require "copytable"
  
rooms = {}

valid_direction = {
  n = "n",
  s = "s",
  e = "e",
  w = "w",
  u = "u",
  d = "d",
  ne = "ne",
  sw = "sw",
  nw = "nw",
  se = "se",
  north = "n",
  south = "s",
  east = "e",
  west = "w",
  up = "u",
  down = "d",
  northeast = "ne",
  northwest = "nw",
  southeast = "se",
  southwest = "sw",
  ['in'] = "in",
  out = "out",
  }  -- end of valid_direction
  
-- -----------------------------------------------------------------
-- Here on "Exits:" line ----- we have changed rooms
-- -----------------------------------------------------------------

function process_exits (exits_str)
  
  -- genereate a "room ID" by hashing the room name, description and exits
  uid = utils.tohex (utils.md5 (roomname .. roomdesc .. exits_str))
  uid = uid:sub (1, 25)  

  -- break up exits into individual directions
  exits = {}
  
  for exit in string.gmatch (exits_str, "%w+") do
    local ex = valid_direction [exit]
    if ex then
      exits [ex] = "0"  -- don't know where it goes yet
    end -- if
  end -- for
  
  -- add to table if not known
  if not rooms [uid] then
    rooms [uid] = { name = roomname, desc = roomdesc, exits = exits }
  end -- if

  -- save so we know current room later on  
  current_room = uid
  
  -- call mapper to draw this rom
  mapper.draw (uid)

  -- try to work out where previous room's exit led  
  if expected_exit == "0" and from_room then
    fix_up_exit ()
  end -- exit was wrong
    
end -- process_exits

-- -----------------------------------------------------------------
-- Here on white coloured line - this is a room name or room exits
-- -----------------------------------------------------------------

function Name_Or_Exits (name, line, wildcards)

  exits = string.match (line, "^Exits: (.*)")
  
  if exits then
    process_exits (exits)
  end -- if

  roomname = line
  roomdesc = nil
  
end -- Name_Or_Exits

-- -----------------------------------------------------------------
-- Here on yellow line - part of room description
-- -----------------------------------------------------------------

function Name_Line (name, line, wildcards)
  roomdesc = (roomdesc or "" ) .. line .. "\n"
end -- Name_Or_Exits

-- -----------------------------------------------------------------
-- mapper 'get_room' callback - it wants to know about room uid
-- -----------------------------------------------------------------

function get_room (uid)
  
  if not rooms [uid] then 
   return nil
  end -- if
 
  local room = copytable.deep (rooms [uid])
 
  local texits = {}
  for dir in pairs (room.exits) do
    table.insert (texits, dir)
  end -- for
  table.sort (texits)
  
  room.hovermessage = string.format (
      "%s\tExits: %s\nRoom: %s",
      room.name, 
      table.concat (texits, ", "),
      uid
      )
      
  if uid == current_room then
    room.bordercolour = config.OUR_ROOM_COLOUR.colour
    room.borderpenwidth = 2
  end -- not in this area
      
  return room
  
end -- get_room

-- -----------------------------------------------------------------
-- We have changed rooms - work out where the previous room led to 
-- -----------------------------------------------------------------

function fix_up_exit ()

  -- where we were before
  local room = rooms [from_room]
  
  -- leads to here
  room.exits [last_direction_moved] = current_room
    
  -- clear for next time
  last_direction_moved = nil
  from_room = nil
  
end -- fix_up_exit

-- -----------------------------------------------------------------
-- try to detect when we send a movement command
-- -----------------------------------------------------------------

function OnPluginSent (sText)
  if valid_direction [sText] then
    last_direction_moved = valid_direction [sText]
    -- print ("Just moved", last_direction_moved)
    if current_room and rooms [current_room] then
      expected_exit = rooms [current_room].exits [last_direction_moved]
      if expected_exit then
        from_room = current_room
      end -- if
    -- print ("expected exit for this direction is to room", expected_exit)
    end -- if
  end -- if 
end -- function

-- -----------------------------------------------------------------
-- Plugin Install
-- -----------------------------------------------------------------

function OnPluginInstall ()
  
  config = {}  -- in case not found

  -- get saved configuration
  assert (loadstring (GetVariable ("config") or "")) ()

  -- and rooms
  assert (loadstring (GetVariable ("rooms") or "")) ()
  
  -- initialize mapper
  
  mapper.init { config = config, get_room = get_room  } 
  mapper.mapprint (string.format ("MUSHclient mapper installed, version %0.1f", mapper.VERSION))

end -- OnPluginInstall

-- -----------------------------------------------------------------
-- Plugin Save State
-- -----------------------------------------------------------------

function OnPluginSaveState ()
  mapper.save_state ()
  SetVariable ("config", "config = " .. serialize.save_simple (config))
  SetVariable ("rooms", "rooms = " .. serialize.save_simple (rooms))
end -- OnPluginSaveState

]]>
</script>


</muclient>
#93
Awesome, thanks a bunch for the example Nick! I'm adapting it to my needs as we speak, I think I'm finally done for the short term, have some testing to do later.

I'm getting the strangest little error that is more of nuisance then anything. I included the following, so the mapper doesn't automatically start up when I log in.
function OnPluginConnect()
	EnablePlugin (GetPluginID (), false)
end -- OnPluginConnect
However, its the strangest thing the mapper starts off and just kicks itself back on. I only noticed because I have it attached to the icon_bar plugin and after all the other boxes grey out it lights back up.

Anyhow, when I actually start out doing some mapping I'm sure I'll have some more in-depth questions. But, it looks great, I'll let you know how the adaptation goes once I test drive it!
Australia Forum Administrator #94
LupusFatalis said:


	EnablePlugin (GetPluginID (), false)



Just put that line at the end of OnPluginInstall. That should work.
#95
Worked, thanks. How odd.
#96
Alright, finally got to do a test run! And it works beautifully. I've got a few things to work out on my end, most of which I've got a plan of attack. However, I'm not quite sure how to deal with the following...

When I graph two rooms that are supposedly occupying the same spot is there an easy way to have the mapper offset them? I.E the database distinguishes between the rooms, but visually there is no indication.
Australia Forum Administrator #97
It shouldn't be drawing two rooms on top of each other. There is quite a bit of code to stop that happening. It isn't easy to offset them either, because, for example, it may have already drawn a north-south set of rooms before it realizes the whole lot have to move west a bit to accommodate another room somewhere else.

I think one of the more recent commits changed the way that worked.
#98
What about the databases that have valid X,Y coordinates already, though? It should be much easier to draw those in the "right" places.
Australia Forum Administrator #99
It wouldn't be too bad, I think someone is working on it. However it basically is a rewrite of the inner loop because you no longer need to deduce room positions. Although it may become problematic if lines happen to cross (or a line happens to go straight through another room, could be messy).
Amended on Wed 28 Apr 2010 10:04 PM by Nick Gammon
#100
Ah, well, it does. Is there anything I could have coded to somehow screw up that system of checks and balances? Also, if you like I can get a picture. You can tell they are distinct because of an outline that is drawn when you actually go to one of the rooms in the stack.
#101
Another thing, that is more a curiosity then anything... Often times the mapper draws that a room has exits but does not draw the unexplored rooms. Any ideas?
#102
Why would it draw rooms you haven't yet explored? Personally, I like a map that shows where I need to go yet, so I make sure I've fully discovered everything in an area.
#103
Actually, in my case, offsetting it an entire level would probably do just as well. Basically the problem here is I'm in a 3d area where I don't necessarily know if I'm going up or down anyway--(nor do I really care entirely)--i.e. my north might bring me +1 north +1 up... but to me the path is all that matters, graphics are just a way to move around easily.
#104
Well, for me its drawing 1 room with a dashed line to represent a possible room to explore. I'm not sure if I like it or not. But I'm asking if its supposed to be drawing all of those possibles, or if this is possibly indicative of a deeper error.
Australia Forum Administrator #105
Which version of mapper.lua are you using? The one that came with version 4.51, or the one you downloaded from Github?
#106
I'm not sure, I opened the file and found the following though:

Date: 11th March 2010
Version: 1.7
#107
It does work nicely though. Looks like a mess with all the rooms overlapping as they do, but I'm able to get around by changing the depth as necessary.
Australia Forum Administrator #108
I think I fixed the overlapping problem.

See: http://github.com/nickgammon/mushclient/commit/b43e6699d6

New version at: http://github.com/nickgammon/mushclient/blob/master/lua/mapper.lua

(RH click on the "raw" link on that page and grab the raw code, replacing your copy of mapper.lua with that).

Or, just merge in the diffs from the first link, there aren't that many changes.
#109
Looks great, Just did a quick run--didn't get to fully test the new version out. I'll let you know the results! Here is a question for you though. Is it feasible to code in something that draws your 'bookmarked' rooms and the paths to them first--and then fills in the rest?

Just thought that option in that vein might be desirable, since often times people are often running along the same route. It would also allow for individuals to write an alias to quickly change bookmarks to those rooms which are unexplored--giving them a kind of 'exploration mode.'
#110
I play on a version of ghostmud. I'm trying to figure out how to get your mapper working for this mud.


 The Wandering Soul 
  You are standing in the bar.  The bar is set against the northern wall, old
archaic writing, carvings and symbols cover its top.  A fireplace is built into
the western wall, and through the southeastern windows you can see the temple
square.  This place makes you feel like home.
A small sign with big letters is fastened to the bar.

[Exits: west]
      A neon-lit juke box sits in the corner of the bar.
A bartender watches you calmly, while he skillfully mixes a drink.


The room name is always on the first line, followed by the desc, a blank line, exits, with room items/mobs below that.
I know it's more than likely not hard, but I can't figure this out.
Australia Forum Administrator #111
If you can detect the room name and description, then a variation of the plugin on page 7 of this thread should work. You would basically need to change the trigger part so you can detect these things.
#112
  <trigger
   enabled="y"
   lines_to_match="5"
   keep_evaluating="y"
   match="^([^\n]*)\n([^\n]*)\n([^\n]*)\n\n[Exits\: ([^\n]*)].$"
   multi_line="y"
   regexp="y"
   script="YourFunctionHere"
   sequence="100"
  >
  </trigger>


Give something like this a whirl...
#113
Ok, I tried using the HASH, and it really does demonstrate the power of the mapper, works beautifully. Unfortunately, the hash value technique isn't strong enough for me. I've run into a couple rooms in the brief time I've been testing this that have the same hashed value--even after appending the coordinates to the hash value!

Now, I came up with a solution, path equivalence, as I mentioned earlier. Only I haven't the faintest idea as to how to begin coding it. I don't suppose there are any suggestions?
Australia Forum Administrator #114
Are you saying two rooms have the same descriptions, and co-ordinates, but are not the same room? How does that work?
USA #115
Nick Gammon said:

Are you saying two rooms have the same descriptions, and co-ordinates, but are not the same room? How does that work?


It's quite possible, if exceedingly strange. A MUD might give each zone its own coordinate space (as Achaea does), so if two rooms in separate zones have the same descriptions, you'll have a collision.

If you can easily grab the zone name, and zone names are unique, you can use that with the hash key as well. Of course, this is all theoretical and making a lot of assumptions. Still, it is possible to occur.
#116
Well, whats happening is the room is in a 3d area. I can only keep track of (x,y) coordinates. (rarely z, as I'll rarely go up/down) ... But, if I move northeast, I may actually be moving northeast and down. As I have no way of knowing this. I can't check the z coordinate--which would likely reveal this.

Now, the idea of path equivalence I proposed earlier is probably the cleanest and most general way to make accurate maps. Basically, you enter a room A. It seems to match room B. Since you have to have visited room B before to know this, you know a path from room B to room C (a guaranteed unique room). So if room A=B then the path from B to C should hold.

i.e. I'm assuming paths are all two-way (here they are) and that a unique room can be found (here it can).

Problem is, I've no idea how to integrate this.
#117
Alright, I think I've gotten my head around how to do this. Most of what I need is probably already somewhere accessible in the mapper module! So basically, how do I give the mapper 2 uid's and get the shortest path between them? i.e. I think you'll see what I'm driving at in the following...
--[[ generates a list of matching rooms, their nearest unique room
	 and a corresponding path to that unique room, returns the 
	 next viable observation number ]]--
function match_check(temp_uid)

	local unique_rooms = {}
	local count = 0
  
	-- build table of unique rooms
	for k,v in pairs(rooms) do
		if rooms[k].unique == 1 then
			unique_rooms [k] = rooms [k]
			count = count + 1
		end
	end

	local i = 1
	while rooms[temp_uid .. "," .. tostring(i)] do
		--unique_room_id = the nearest room on the unique room list
		--path = path from room "temp_uid .. ',' .. tostring(i)" to unique_room_id
		matchlist[temp_uid .. "," .. tostring(i)] = {rooms[temp_uid .. "," .. tostring(i)], unique_room_id, path}
		i = i + 1
	end
	
	return i
	
end -- match_check


As you can see, every room is being assigned a baseline "tempid" which is its hash value, followed by "," and then then the instance of that hash value.
Amended on Fri 07 May 2010 05:31 AM by LupusFatalis
#118
I am trying to use this but for some reason the plugin just will not grab the area or environment and populate it into the map. I have no idea of how to check if it is going into the database itself either. I can not separate areas or anything. The rooms will not let me color code as they are all showing as unknown when it comes to the color.

Do you think you know what could be causing this? I downloaded the latest version of the plugin that you have posted here.

I have tried to use this with both Achaea and Midkemiaonline.
Amended on Fri 07 May 2010 10:42 PM by Jakaiya
Australia Forum Administrator #119
Try downloading their XML file which lists amongst other things their area codes. A couple of pages back in this thread, I think, is how to do it. There is a plugin you download from the Git site, and you download the Achaea mapper xml file from their site.
#120
Nick Gammon said:

Try downloading their XML file which lists amongst other things their area codes. A couple of pages back in this thread, I think, is how to do it. There is a plugin you download from the Git site, and you download the Achaea mapper xml file from their site.


When importing the xml file for Midkemiaonline I get the following error

Run-time error
World: Midkemia
Function/Sub: create_map_database called by alias
Reason: processing alias ""
[string "Plugin"]:289: Function 'io.lines' disabled in Lua sandbox - see MUSHclient global preferences
stack traceback:
[C]: in function 'error'
[string "Sandbox"]:39: in function 'lines'
[string "Plugin"]:289: in function <[string "Plugin"]:208>


EDIT: ok so I figured out the issue. If anyone is going to use this make sure you go into your global properties and trust the game id and plugin ID in your LUA tab.
Amended on Sat 08 May 2010 12:39 AM by Jakaiya
#121
Here's a fun feature!

When standing at room 4932, if I do MAPPER GOTO 4932, I walk out of the room and walk back in. Needs a simple check to see if you're already in the room, for anyone who might be trying to walk to people and/or spamming the goto command. :)
Australia Forum Administrator #122
Hmm. I tested for walking to the same room when doing a find, but not a goto. In fact the goto is simply a normal find where the condition is the target room is found.

However a change before mapper.find is even called will handle that, I added that to:

http://github.com/nickgammon/plugins/blob/master/ATCP_Mapper.xml

In particular in this:

http://github.com/nickgammon/plugins/commit/e4b1d2884

See around line 1659.
#123
Hey, I've been using the serialization thing that you gave an example of to do my database for the mapper. I've got one area that is up to ~4500 rooms. The file is up to about 2500KB. I'm just curious how much this method can really handle--i.e. should I invest some time into figuring out how to database with sql or something, and further how to script some sort of transfer. For reference, I'll probably have another dozen or so areas equally large.
Australia Forum Administrator #124
Hmm, yes well the serialization was really to keep the example simple. My main mapper plugin uses the SQLite database. Check this out:

http://github.com/nickgammon/plugins/blob/master/ATCP_Mapper.xml

Adding to the database, and querying it, are quite straightforward, and you just need to create the tables initially if they don't exist (all this is in the plugin).

The database will save memory eventually because you only need some rooms in memory at once rather than all of them. In my plugin once a room is accessed I keep it in memory for speed, but I assume that in one session you won't visit every possible room.

The serialization will eventually introduce a lag spike when the plugin is first loaded (as it reads in megabytes of data) and when the world is saved (as it is all written out again).
#125
Alright, I think I'm going to do that. I'll probably try to get this done over next week.

I think I'll try to incorporate all the maps into one map at the same time. As it is, I manually switch the databases, which isn't a huge problem since the "areas" are so large--just a bit of a pain. Not yet sure how I'll do that yet, but I figure this transitional phase is probably as good a time as any to puzzle that out and make that change as well.

I shall post my results after I finish or hit a wall! Thanks again.
USA #126
I dunno if you have forgot to added a function for this variable in init:

show_area_exits


I have noticed that it does exist ATCP_Mapper.xml but not in mapper.lua. So, I wonder if you are going to implement it eventually?

inquisitively,
~maxhrk


EDIT:

nevermind, i found a updated version of mapper.lua that now has it. Excuse me. :3
Amended on Thu 20 May 2010 11:04 PM by Maxhrk
USA #127
I have scanned throughout the recent ATCP_mapper.xml and noticed there is no function to change the areas.. so i go ahead and then voluntarily add the functionality for it.

Append to the local handler table to this:

 { name = "Move the room to a different area", func = change_room_area}


And adds new 'change_room_area' function to the script:

function change_room_area(room, uid)
	 
	 if next(areas) == nil then
		mapper.maperror("There is no available areas to choose from.")
		return
	end
	
	 local chosen_area = utils.listbox ("Choose area to alter the room's area", "Areas ...", areas)
	 
	 if not chosen_area then
		return
	end
	
	rooms[uid].area = chosen_area
	mapper.draw (current_room)
	
	dbcheck (db:execute (string.format ([[
    UPDATE rooms SET area = %s WHERE uid = %s;
  ]], fixsql  (chosen_area),  -- area (e.g. "1" for "western ithmia")
      fixsql  (uid)  -- from current room
      )))
end


I hope it help people who want to change the area of the room more easier. :p Now i dont know if auto-surveying is relevant to 'atcp_mapper.xml' :p
Amended on Fri 21 May 2010 01:08 AM by Maxhrk
Australia Forum Administrator #128
I've added that to the standard distribution, without testing I admit, but it looks OK.
Australia Forum Administrator #129
Tested it now, seems to work OK. I pushed some changes (commit e57b06f) to make the style a bit more consistent, and to fix the grammar of "There is no available areas to choose from".
#130
Hey, I was just thinking about it. And one feature that might be cool is an "offline" feature where you can use the mapper to simulate exploration.
#131
Has anyone worked out a way to use the X,Y,Z values?
#132
I did figure out a way, though it looks a little screwy in some places because the exits are drawn halfway from each side and don't always meet in the middle, like when a room is southeasterly but it goes over one and down two. I haven't had the time to come up with a way to correct the exit lines yet.
#133
how can i modify the mapper to not draw unexplored rooms but just a stub
Australia Forum Administrator #134

Do you mean instead of the dashed border in this screenshot?

Australia Forum Administrator #135
If so, in mapper.lua at around line 763 is the code to draw the rooms, like this:



 if room.unknown then
    WindowCircleOp (win, 2, left, top, right, bottom, 
                    config.UNKNOWN_ROOM_COLOUR.colour, 2, 1,  --  dotted single pixel pen
                    -1, 1)  -- no brush
  else
    WindowCircleOp (win, 2, left, top, right, bottom, 
                    0, 5, 0,  -- no pen
                    room.fillcolour, room.fillbrush)  -- brush
  
    WindowCircleOp (win, 2, left, top, right, bottom, 
                    room.bordercolour, room.borderpen, room.borderpenwidth,  -- pen
                    -1, 1)  -- no brush
  end -- if 


Just comment-out that first one (room.unknown) so it draws nothing:



 if room.unknown then
--    WindowCircleOp (win, 2, left, top, right, bottom, 
--                    config.UNKNOWN_ROOM_COLOUR.colour, 2, 1,  --  dotted single pixel pen
--                    -1, 1)  -- no brush
  else
    WindowCircleOp (win, 2, left, top, right, bottom, 
                    0, 5, 0,  -- no pen
                    room.fillcolour, room.fillbrush)  -- brush
  
    WindowCircleOp (win, 2, left, top, right, bottom, 
                    room.bordercolour, room.borderpen, room.borderpenwidth,  -- pen
                    -1, 1)  -- no brush
  end -- if 


#136
I re-read the draw_room function and noticed I wasn't passing a value for 'unknown' in my GetRoom function. it's fixed now. I wasn't getting dotted boxes at all just full ones before.
USA #137
I tried both of the ATCP_Mapper and Simple_Mapper xml files and loaded them as plugins.

I got the map popup to work but it wont map any of the rooms.

I am trying to get this working on Ansalon but I am at a loss as I am just heading back to a mud after years away from it and only used to zmapper in zmud.

Edit: It has been so long since I have done any coding I really wouldn't know where to start with this. I included below the typical output below. Any help to get this to work on Ansalon would be wonderful. Thanks.


Imperial Square
  A finely crafted platinum dragon stands in the center of a large
fountain.  It dwarfs everyone and everything in sight.  The dragons
outstretched wings provide shelter from the elements.  The statue spits long
blasts of water into a large obsidian bowl.  Every half hour the bowl tips
and spills its contents into the fountain.  Righting its self just in time
to receive the next blast of water.  

[Exits:  north east south west]
     A signpost is here.
     A platinum dragon statue spits water into a fountain here.
     A tall lamp post stands here.
(Charmed) A young pseudodragon flits about here.
A citizen of Palanthas walks by on the way to the store.
A young cadet is here learning the ropes of the Palanthian guard.
A royal alchemist is here selling refreshing potions.
Amended on Thu 03 Jun 2010 05:31 PM by Arcath
#138
It's still not working right. What am I supposed to return for unknown rooms, currently I return nil. I don't get any dashed boxes or lines at all. Here's my getroom function for reference.


function GetRoom (uid)
	if(tonumber(uid) == 0 or tonumber(uid) >= 200000) then
		Note("room id out of range")
		return nil
	end
	local record = {}
	local cur = db:execute("SELECT * FROM Rooms WHERE room_id = '" .. uid .. "'")
	cur:fetch(record, "a")
	room = {
		unknown = false,
		name = record["name"],
		hovermessage = uid .. ":" .. (record["name"] or ""),
		area = record["area"],
		bordercolour = ColourNameToRGB(record["color"] or "cyan"),
		borderpen = 0,
		borderpenwidth = 1,
		fillcolour = 0x000000,
		fillbrush = 1,
		exits = { n = record["north"], e = record["east"], s = record["south"], w = record["west"], u = record["up"], d = record["down"] }
		}
	if(currentarea == nil) then
		currentarea = record["area"]
	end
	--DumpRoom(room)
	return room
end
Amended on Thu 03 Jun 2010 10:13 PM by Nick Gammon
Australia Forum Administrator #139
Tripphippy said:

It's still not working right. What am I supposed to return for unknown rooms, currently I return nil. I don't get any dashed boxes or lines at all. Here's my getroom function for reference.



If you return nil, which sounds right, internally the mapper module creates a dummy room with the unknown flag set.
Australia Forum Administrator #140
Arcath said:

I tried both of the ATCP_Mapper and Simple_Mapper xml files and loaded them as plugins.

I got the map popup to work but it wont map any of the rooms.



Ansalon doesn't look like it is an IRE game, so the ATCP_Mapper won't work. May as well remove that. As for the other mapper, I used the colouring of the room name to detect that. For the simple mapper to work you need to be able to detect different rooms so it can generate a room number (unless you can get that from the game somehow).
Amended on Mon 07 Jun 2010 10:53 AM by Nick Gammon
USA #141
I've been using Mush for a number of years now on a small mud called legendmud, and sadly in the last week only adding plugins. One thing that I have been trying to do is to do is to get the simple mapper to work on game. All I seem to get is the first screen as posted here: http://i983.photobucket.com/albums/ae320/saross0219/screenshot.png. My coding is well... lacking as any of my teachers will admit. yet I can program a router. Anyways just looking for a bit of guidance on what is lacking for this to work. From what I can tell there isn't any UID that the mud gives that I can use and I know there isnt a map file sent out that I can utilize to automatically build a map from so the file has to be built from the ground up basically. To throw in a new twist to the feat this game has 3 different eras that one can "transfer" to, so in essence the code would need to be a bit smarter and be able to differentiate the eras by an indication or a drop down of a sort that it can be used to link that room to a certain era and find it self on the map when that trans is used.
Australia Forum Administrator #142
Unfortunately it goes beyond the scope of what I can offer here, to go into each of the 1000 or so MUD games, and adapt the mapper to work with each one.

As mentioned earlier, for the mapper to have any hope of working you need to be able to uniquely identify rooms, otherwise it won't know if you have gone back into the same room, or entered a new one.

A simple method is if the MUD in question sends some sort of room number (currently the IRE games do, and Aardwolf). Also PennMUSH variants had some sort of "database number" which could uniquely identify rooms. Given this, you could adapt the simple mapper I presented earlier fairly simply.

Without a room number you have to try to build one by doing what I did with Smaug, and hash up the room description and exits, hoping that is different for each room.

A little while back I was participating in a "MUD standards" forum, in an attempt to standardize the way MUDs sent out things like room numbers, to make mapping easier. Unfortunately, to say the least, consensus was not easily reached. There were a considerable number of objections to the proposals to make things work in a more standard way, including that older clients would not be able to use them, some MUDs did not want to, or could not, adapt to them, some MUDs don't have rooms and thus couldn't supply room numbers, and so on and so on.

If you can convince your MUD admins to follow some of the tentative proposals (dubbed ATCP, ATCP2, or GMCP) there might be some hope of having a standard mapper work with them. Indeed, Aardwolf have started sending something along those lines, making the mapper work for them quite nicely.

Some MUD admins are certainly open to new ideas, and if yours are amongst them, you might be able to get them to add the appropriate codes (via telnet sequences, it isn't too hard) and then the mapper will just jump into life. :)
#143
I don't suppose anyone knows how to make a "GoTo" command for the mapper, i.e. I have the id of the room I want to go to... I just want it to walk there.

And the second question is... the hyperlinks are lovely, but is there an easy way to use the mapper to make a "Directions" command. i.e. I input the room id I want to reach, and it returns directions from the current room?
Australia Forum Administrator #144
LupusFatalis said:

I don't suppose anyone knows how to make a "GoTo" command for the mapper, i.e. I have the id of the room I want to go to... I just want it to walk there.


The existing mapper does that. From the help:

Quote:

MOVING

mapper goto <room> --> walk to a room by its room number





LupusFatalis said:

is there an easy way to use the mapper to make a "Directions" command. i.e. I input the room id I want to reach, and it returns directions from the current room?


Well, fairly easy. This one isn't built in right now.

I think I would take the current find function, and copy the first bit. Basically the line:


  local paths, count, depth = find_paths (current_room, f)



... gives you a table "paths" which is the paths of all the found rooms. If only one, then that entry has item "path" in it, which itself has all the room IDs and the way to get to them.

So a bit of work and you could display that. There is a function build_speedwalk that takes a path table, and converts it into a speedwalk. So yeah, in a few lines of code you could do it.
Amended on Sun 15 Aug 2010 01:35 AM by Nick Gammon
Australia Forum Administrator #145
I added the "mapper where" command to the mapper. See:

http://github.com/nickgammon/plugins/blob/master/ATCP_Mapper.xml

You also need a slightly modified mapper.lua file:

http://github.com/nickgammon/mushclient/blob/master/lua/mapper.lua
#146
Sorry in advance, I am a newbie at MUDs and coding. I have never really played a MUD before, but I am giving it a honest try. But a lot of these MUDs do not have an in game map.

Right now I am playing (Lord of the Rings) The Two Towers. I was stuck in the Prancing Pony for three days! That is not fun to me. I get lost in real land nav, much less in a game where every thing is text based.

Regardless, I was directed to use this mud client many times, but every one told me there was no auto mapper. So I was directed to go some where else which I wont name so I wont be promoting. But needless to say, however, you have to pay for it after 30 days, so it isn't free anyway.

I am having trouble using it and if I try to go north, even though there is no exit north, from then on it goes west instead of north, east in stead of west etc.on the map screen, until I redo the recalibration and erase all the rooms.

Long story short for why I am here. After being told you did not have an auto mapper some one else said you did so I downloaded the client. Come to find out pressing CTRL, ALT, M isn't an auto mapper it just tells me where I have been or came from, but not graphically, that doesn't help me at all. I saw this thread and what I thought was a downloadable plug in. But all I see is some thing made in word pad or some thing like it. How do I even add that into MUSHclient? Do I just simply copy and past it some where or do I have to manually type it into it?

Any help would be appreciated, but it would have to be put into laymen terms other wise I wont understand it. I am pretty much at my wits end. I have went to different mud sites, asked off the game I play and even searched for free auto mappers and I am pretty much about to just stop playing MUDs altogether. No matter how big a game is, if I can not navigate it, there is no point in playing it. Again, I got lost in an INN that had probably only 13 rooms max... I would hate to see what happens when I travel the wilderness or in a dungeon.

Thank you for your time and patience and thank you for making a free mud client.
USA #147
The mapper developed here needs some configuration to work with any given MUD. It only provides the machinery to displaying a map, but it doesn't handle how the rooms are actually mapped or how to get the information. A plugin needs to be created that manages this. Unless someone else steps forward who's done the legwork for your LotR MUD, you probably won't have much luck.

If you're willing to try configuring it yourself, I'm sure we'd be glad to lend you a hand. You'd need to be fairly familiar with scripting and/or your MUD, though, and from the sound of it you're neither. :(

*sigh* People like you make me want to work even harder on my own client. It really needs to be a lot easier to just play. ([EDIT] Sorry, this isn't a jab at MUSHclient! MUSH is totally awesome, but my client will actually give a lot of power to the admins too. The admins would have the ability to create something like this themselves, so nobody else needs to deal with the hassle.)
Amended on Sun 29 Aug 2010 07:21 AM by Twisol
#148
I would have assumed, people like me would make you want to slap people like me. I know this probably wasn't the first time some one has asked this question and it probably wont be the last...

No... I have no idea how to script or code at all and generally speaking, have no desire to. My extent of scripting or coding has been in Everquest when I would press a button or macro and say "TRAIN!!!".

In any case, I really like the idea of being able to go into a world and have at the start 30 different races, dozens of classes, 1,000s of items and equipment, many gods etc, with like 1,000s upon 1,000s of rooms.

But as I said I get lost way too easily. Heck, I would get lost in EQ and that was fully graphical. Regardless, thank you for your answer. I saw other threads, but I was assuming that those plug ins were for those games they were made for only.

I think some one is making an in game map for The Two Towers, but it wont be ready for a while. I do not care if it was straight plain boxes or stick figures, just some thing with a simple auto mapper is all that I ask for. I would figure with as many mud clients that are out there or were at one time some one would have done it for free... but then again perhaps for other people there are other priorities in the games, I just need to navigate. Hahahaha.

Anyway, my next solution is to either continue playing the one game I am now with the 30 day free auto mapper and not go into a direction that is not there so it does not screw it up and hope that the game then has it's own mapper by the time the client I am using is no longer free or I will just have to find another MUD that has an automapper. I really want to find a D&D one with an automapper. Any one know of any?.

Unless some one can give me more help here directly about the automapper for MUSHclient I will not reply here any more unless for a simple thank you in case some one provides me with info, because I do not want to hijack the thread. Thank you for your time and patience.
USA #149
Jerrid said:
I would have assumed, people like me would make you want to slap people like me. I know this probably wasn't the first time some one has asked this question and it probably wont be the last...

Not at all! You're polite, have clearly tried a lot of things, and have given a great explanation of your problem. No support person could ask for more.

Don't worry about hijacking the thread. Comments can always be pruned and moved to a separate topic, and this is as good a place as any to ask about the mapper.

Put simply, every automapper needs, at the very least, two things from a room. One: It needs to be able to identify it uniquely. Two: It needs to be able to get its exits. Anything beyond those two points is fluff.

Does your MUD have a public forum of some kind, where you can ask gameplay questions? That would be a great place to ask for help, since most people there would be familiar with the game. You only need one MUSHclient power-user who's willing to help. :)
Australia Forum Administrator #150
Jerrid said:

Right now I am playing (Lord of the Rings) The Two Towers. I was stuck in the Prancing Pony for three days! That is not fun to me. I get lost in real land nav, much less in a game where every thing is text based.


I totally know where you are coming from with this, and is part of my motivation for writing the mapper module. The problem is, with lots of MUDs which output stuff in different ways, it is hard to make a generic mapper that "just works", although I understand most players would want exactly that.

However it isn't really feasible as the client developer to sit there modifying the mapper for the 1000+ MUDs out there, so the best I can do is show the technique and hope someone from the MUD will do it.

Twisol said:

Put simply, every automapper needs, at the very least, two things from a room. One: It needs to be able to identify it uniquely. Two: It needs to be able to get its exits.


Well actually, uniquely identifying the room is all you really need. After all, you can manually read the exits and take each one, and the mapper is designed to detect you went west (eg. the last thing you typed was "west") and if you end up in a new room it can assume that the previous room has a west exit, and taking it leads you to the current room.

I don't know how the "other client" just handles all this, but from what I saw a while back you at least have to train or teach it what room descriptions look like. And I don't know for sure if it works out the fastest path from one room to another, or if you have to assist it in its map building. Maybe it does, maybe not.

I would take up Twisol's suggestion and ask in-game, or on their forums. Nowadays MUSHclient is pretty well known, and I would be surprised if someone isn't tackling the problem.
Australia Forum Administrator #151
I found some maps here:

http://t2tmud.org/projects/maps/

These aren't in-game, but are so detailed it would seem that there must be way of getting the necessary information to make the mapper work.
USA #152
Nick Gammon said:

I found some maps here:

http://t2tmud.org/projects/maps/

These aren't in-game, but are so detailed it would seem that there must be way of getting the necessary information to make the mapper work.


It's actually not too far-fetched that those are hand-crafted. Delphinus of Achaea has a truly massive hand-made map of Achaea's wilderness grid. And those maps you linked to seem to imply that the world is strictly grid-based, not a rather loose undirected graph like Achaea's [non-wilderness] world is.

Actually, a grid-based world would make a mapper somewhat easier to do. Give one room a coordinate (i.e 0,0), and base all others off of that one.
Australia Forum Administrator #153
I made a character on Twin Towers to see what we are up against here. ;)

First obvious thing, it supports MXP. That is usually a good sign, as I hoped you would get room numbers or something.

However so far I only see exits, eg.


<x>north</x>, <x>east</x>


So that's a start, you can work out what the exits are.

Unfortunately, the room descriptions themselves don't seem to be tagged (unless it is an option), so it will be hard to generate unique room codes. Also, rather unfortunately, a fierce weasel is blocking my path. :P

According to their website, most players use MUSHclient or zMUD, so there should be someone you can ask if they got a mapper to work somehow.

I can't see in their help how to get a prompt/MXP tag or other way of identifying rooms. Without that, it is hard for a mapper to work.

After all, if you don't know where you are, it is hard to say how to get somewhere else. Maybe it can be done like this... Example room:


    You are outside of the east gate of Willowvale.  Civilization 
diminishes out here, being replaced by a peaceful, rural landscape.
The road continues off to the east.  Down the road a piece and on  
the south side you see a wagon. 
    The only obvious exits are southeast and west.


The final line is identifying ("The only obvious exits ...") so we could backtrack until an indented line ("You are outside ...") and therefore generate a room description.

That could be enough to get it to work. But I would ask around to see if someone has done it.
Australia Forum Administrator #154
Template:post=10536
Please see the forum thread: http://gammon.com.au/forum/?id=10536.
#155
You have really done an amazing job with this!! Are in room commands linking rooms (like entering portals) planned?

The MUD I play (Aardwolf) makes extensive use of those.

Would also be great to able to link an alias and a specific room UID. Could use that to make an alias that wears and enters a portal in my inventory or casts a spell that leads to my home or clan, and the mapper could use it in its pathfinding.

Regardless, you have done an amazing job with this!
Australia Forum Administrator #156
Mendaloth said:

You have really done an amazing job with this!! Are in room commands linking rooms (like entering portals) planned?


Well not exactly by me, but I believe Lasher is working on a version adapted for Aardwolf. Perhaps an in-game query (using their bulletin board or whatever) would find out the progress on that.

Mendaloth said:

Would also be great to able to link an alias and a specific room UID. Could use that to make an alias that wears and enters a portal in my inventory or casts a spell that leads to my home or clan, and the mapper could use it in its pathfinding.


There is currently (in the latest version) an alias:


mapper goto <room>


You could adapt that to do what you want, I think.

Mendaloth said:

Regardless, you have done an amazing job with this!


Thanks!
#157
I was wondering. With the mapper goto, could there be a mapper runto which puts the string into a runto format?
Australia Forum Administrator #158
I did that already for use on Aardwolf. If you set the speedwalk_prefix value (in the ENTITY for ATCP_Mapper.xml) to something (eg. "runto ") then it just sends "runto xxx" where xxx is the speedwalk string.


<!ENTITY speedwalk_prefix "" > 
#159
Thank you for point that out.

I have another question about the Mapper Plugin. Does it have the ability to open directionally or doors, enter portals, and enter special exits? If it does, how do you set it up to do this?
Australia Forum Administrator #160
It doesn't have that right now. It could be tricky detecting if a door was open or not.

However when testing on the IRE Muds (like Achaea) I made some triggers that assisted in opening doors, for example:


 <trigger
   enabled="y"
   regexp="y"
   match="^There is a door in the way"
   send_to="12"
   sequence="100"
  >
  <send>
    if last_direction_moved then
      Send ("open door " .. last_direction_moved)
    end -- if
  </send>
  </trigger>


This worked by detecting which way you last tried to move (last_direction_moved) which was done in the plugin in the OnPluginSent function, like this:


valid_direction = {
  n = "n",
  s = "s",
  e = "e",
  w = "w",
  u = "u",
  d = "d",
  ne = "ne",
  sw = "sw",
  nw = "nw",
  se = "se",
  north = "n",
  south = "s",
  east = "e",
  west = "w",
  up = "u",
  down = "d",
  northeast = "ne",
  northwest = "nw",
  southeast = "se",
  southwest = "sw",
  ['in'] = "in",
  out = "out",
  }  -- end of valid_direction
  
-- try to detect when we send a movement command
function OnPluginSent (sText)
  if valid_direction [sText] then
    last_direction_moved = valid_direction [sText]
  end -- if 
end -- function


So what happens is, the plugin is speedwalking you somewhere, the last thing it sends is (say) "west", and then it gets the message:


There is a door in the way ...


The trigger then fires, and sends "open door west".

I'm not sure about whether the speedwalk resumes at the point but sending the alias "mapper resume" could get it going again if necessary.

It doesn't handle portals or special exits at present, the closest you could probably go is to speedwalk to the portal and manually go through it.
USA #161
How high are things like those special exits, resuming speedwalks, mixing the .xml data with your own data, etc. on your guesstimated project list? (So I can think about my own project list according to whether those are on a near horizon or a very far one.)
Australia Forum Administrator #162
Resuming speedwalks is already there (mapper resume).

The XML data loading is in a plugin I described further back (in this thread I think), and after that it justs adds more things to the database. That's assuming IRE haven't changed the format of the XML too much, but in any case you should be able to work it out.

The special exits: I have that as low priority so if you want to tackle it, that would be great.
#163
If I'm reading my Zmud map database properly, Zmud stores portals in another table separate from the exits table.

For implementing portals, I'd suggest adding a Portal table, with Portal Name (I'm assuming you use portals by entering them, ie "enter gate"), fromID, and toID. Then copy/paste and adjust the portion of the existing code that reads and adds exits to the map to read and add the new portals database.

As for door exits...I think we'd have to add an extra pair of fields to the exits database (ExitType, 1 = normal, 2 = door, 3 = locked door; and Name for the doorname), then adjust the speedwalk portion of the code to react to those fields (a nice addition would be to set a config option to avoid locked doors, or a threshold of movements that you'd have to take to avoid them...like if going through that locked door to get to the point is 25 moves, but avoiding the door is only 30, take the 30 moves, but if avoiding the locked door is 75 moves, then that's too far out of your way).

Also might want to add PortalType to the portal field, in case the portal can also be closed/locked, or there's different commands to go through different portals (touch stone vs enter warpgate)?

Well, that's my solution(s)...probably more complex than it sounds, but I'm working on a few other things at the moment and can't make it work yet.
Amended on Mon 11 Oct 2010 06:03 AM by LezChap
#164
Hello :)

Trying to make a plugin for Materia Magica, based on the Two Towers plugin by Nick.

I'm not an expert, so I'm having some problems.

* First, got it to parse room names and exits OK, but it's only drawing/showing the current room.

* Second, it's recognizing some rooms OK, but not others (problem you already have covered with some MUDs using the same room name + same description for different places).

Any help would be appreciated. As I said, I'm no expert. But if we can make it work, it would make things so much easier...
Australia Forum Administrator #165
Sounds like it isn't realizing you changed rooms and adding the exit to the room's exits list.

Try adding some debugging to fix_up_exit and OnPluginSent:


-- -----------------------------------------------------------------
-- We have changed rooms - work out where the previous room led to 
-- -----------------------------------------------------------------

function fix_up_exit ()

  -- where we were before
  local room = rooms [from_room]
  
  -- leads to here
  room.exits [last_direction_moved] = current_room
    
  print ("Fixing exit for", from_room, "to go to", current_room)

  -- clear for next time
  last_direction_moved = nil
  from_room = nil
  
end -- fix_up_exit

-- -----------------------------------------------------------------
-- try to detect when we send a movement command
-- -----------------------------------------------------------------

function OnPluginSent (sText)
  if valid_direction [sText] then
    last_direction_moved = valid_direction [sText]
    print ("Just moved", last_direction_moved)
    if current_room and rooms [current_room] then
      expected_exit = rooms [current_room].exits [last_direction_moved]
      if expected_exit then
        from_room = current_room
      end -- if
    -- print ("expected exit for this direction is to room", expected_exit)
    end -- if
  end -- if 
end -- function


Basically in order to draw interconnecting rooms, it has to know that room A has an exit (eg. east) that leads to room B.

Try with the debug lines in bold, and see if it is detecting your moving, and detecting the need to add an exit.
Amended on Tue 12 Oct 2010 01:56 AM by Nick Gammon
USA #166
Nick,

Would you be able to elaborate as to how someone can customize this mapper to fit their particular MUD? For instance my full output of a room description, and prompt is:


The Dracon's Den                                       -      -      -
(-------------------------------------------------)     - <---(M)---> -
                                                        #      -      -

  As you enter this room, a warm breeze flows over you from the
fireplace.  You notice an enormous statue of Beyonder, the Dracon Guardian
of the Source on the mantelpiece.  Dark velvet drapes cover all the
windows, and a blood-red rug is draped across the stone floor.  A large
desk is positioned in the middle of the room, strewn with papers and various
artifacts.  Mounted heads can be seen above each window and the door,
leading you to believe the owner of this home is not someone to be trifled with.

[SAFE]<3087hp 2500sp 1730st> [AWAY][SAFE]<3087hp 2500sp 1730st> 



although obviously the compass is a bit distored with the copying/pasting.

How can I customize the mapper for this particular output? And how would I go about handling dizzy rooms, repeating rooms, teleport rooms, etc?

Thanks!!
Forral
Amended on Tue 12 Oct 2010 02:26 AM by Nick Gammon
Australia Forum Administrator #167
You need to make a trigger that can detect the room description. That is the hard bit. Once made the room description can be hashed into a unique (hopefully) room code, which the mapper can then use.

It's hard to guess what yours might be without more room descriptions to look at, but the hyphens in brackets might help - are they always the same length?
Australia Forum Administrator #168
Is this Materia Magica? If so, Rebecca Madison earlier in this thread said she had worked out how to parse the room names. Perhaps you two should work together? It looks like the room names might be in yellow, that could help detect them.
USA #169
Nick Gammon said:

Is this Materia Magica? If so, Rebecca Madison earlier in this thread said she had worked out how to parse the room names. Perhaps you two should work together? It looks like the room names might be in yellow, that could help detect them.


Yes this is materia magica, and I don't know what her character name is so I wouldn't know who to contact.

Yes the (------------------) part of the description is always the same, that and the exits that are drawn in the virtual compass (there is one for up and down right next to that M in the middle)

Australia Forum Administrator #170
See new thread:

http://www.gammon.com.au/forum/?id=10667
USA #171
Nick Gammon said:
The special exits: I have that as low priority so if you want to tackle it, that would be great.

Perhaps it's just because I don't know Lua or MUSHclient's plugin system yet, but I'm hazy on the question of which of these things on my "must have" list are things I could potentially do.

I can certainly see how I can add triggers that call the MAPPER command. When it comes to slightly more intrusive things, like adding a MAPPER WALK <bookmark> command, I can see (vaguely) how I could do it, but only by editing ATCP_Mapper -- and thus potentially making my version of it separate from yours, meaning I can no longer benefit from any changes you make or bugs you fix.

And when it comes to the biggies on my list, like special exits and splitting the database, I can't see how I can even begin to approach those without completely diverging from what you're doing. The biggest concern here: the XML map I can download from Lusternia has an incredible amount of useful information, is semi-regularly updated, and is invaluable; but as there are a few essential things not in it, I can't work from having nothing but it. I need a way to map other rooms, set room costs, and add special exits, and not have these overwritten every time I import an updated map, or the mapper is *useless* to me: I can't rely on something likely to take me into enemy territory, something that can't find the most useful paths or the rooms most important to my character.

Even assuming I could put in the time to learn Lua and MUSHclient well enough to handle things that big, is there really a way I could be making changes this deep without breaking off from the development stream?
Australia Forum Administrator #172
In the current ATCP mapper I have two databases, one which is created from the XML, and one which is the "bookmarks" database which contains stuff you add (like bookmark a room because it has a quest in it). The idea of this was to keep your notes without losing them when you update the XML.

So if you added extra things you simply add them to the bookmark database (examples already in the code) and don't lose anything in the main database.

One way of adding extra features might be to have the main mapper load an "extras.lua" file which you could incorporate your extra code in, and then if the main mapper is updated it still loads your extras. Even if the official one doesn't have that in it (which it doesn't at present) that would be a way of keeping your changes in a separate file.

So you might put near the bottom of the mapper:


require "my_extras"


And then add that line back when a new version is released.

This doesn't totally address how extra aliases might be added, but that can be done with the XML "include" line which plugins support.
USA #173
It seems unlikely to me that superceding existing code is really a viable way of dealing with issues as fundamental as "rooms are in two databases, not one" or "path choosing depends on room/exit costs" because even if you could address those it seems you'd be replacing a lot of the core of the stuff you'd be trying to use.

I feel like I'm not really expressing my concern here, though, and I'm sure that's my fault, so I think I'll drop it until such time as I either decide to delve deeply enough into this to figure out the answer myself, or decide to go a different way entirely.
Australia Forum Administrator #174
I have placed the mapper module and mapper plugins "out there" to inspire others to improve on them. For example recently I did a mapper for Materia Magica which was dissimilar enough to the ATCP one that I copied and pasted rather than trying to make one big, ugly one that did everything.

If you are addressing a particular MUD you may want to just try that - I'm a bit unlikely to make huge improvements in the future, especially as MUDs tend to be different. For example, some give room numbers, some don't. Some give coordinates, some don't. Trying to make an all-purpose mapper could just be ugly and convoluted.

A recent change I made (snippets in the full-text search) were minor enough that you just just retro-add them into your copy, if you wanted to.
USA #175
Nick Gammon said:
I have placed the mapper module and mapper plugins "out there" to inspire others to improve on them.

I suppose that's the real answer I was looking for, at least the unspoken part.
#176
Has anyone gotten this to work for Ateraan? Was curious before I tried getting it to work.
#177
Hi...

I am an ordinary user, very new to MUDs, and the like, and I am not a coder.

I am attempting to play RPIs, which are not necessarily map-inclusive. BEing that I am visually and mentally challenged finding my way around even in the real world, I was looking for a way to use this. There is CMUD, but I'm also hoping to not pay. So I'm attempted to figure this out, but I am not succeeding.

I need a mapper that auto-maps a world as I walk it, assigning unique numbers that I may type a command like 'WALK <number>' and it'll go there. Or double-click on the map and it'd speedwalk me there. I thought this might fit the bill.

Please help. If anyone has this already converted as a generic plugin that'd be great. I have 30 days with CMUD to enjoy my games without worrying about my mapping needs, and then I have to decide whether to pay or -hopefully- go with MushClient.

I'd rather really go with MushClient.
#178
To explain, I've really tried looking at making the plugin. The plugin wizard sounds easy enough, but then I wondered on how to take the lua file and include it within the wizard, etc.

><
Australia Forum Administrator #179
The tricky bit with any mapper is working out the current room ID or number. The mapper has to have some way of knowing when you have changed rooms, and assign some sort of identifier to each room, so it knows if you have been here before. If you have been there before it can then "remember" how you got there (eg. west from Main Street leads to Baker Shop).

Recently the mapper was adapted to run on Materia Magica, a MUD that doesn't have any obvious room numbers:

http://www.gammon.com.au/forum/?id=10667

Basically there I hashed together the room name, description and compass (ie. exits) to get a unique room code.

It's hard to be more helpful without seeing the MUD in question. Perhaps if you give a link to its IP/port we could see how easy it would be to adapt the mapper?
#180
Ah so this still needs to be adapted per game?

*Ponders*


Hehe was hoping this would do for all games I have, at once, as I play 4-5 that do not have maps readily available and are the ones I want to play heavily.

Maybe Geas? www.geas.de

I don't want to take a lot of your time though:(....I would like to learn how to do it.

I got stuck at trying to figure out what to do with the Lua. And how do I download the raw source? Heh.

#181
Has anyone ever tried to adapt this to the MUD Xyllomer?

The biggest problem I see for this MUD is, that the exits aren't very consistent. Additionally to the normal directions (north, west, east, south, up, down, nw, ne, se, sw) there are sometimes non-standard ones (e.g. in, out, northup, northwestdown, northright, etc.).

Is it possible at all to adapt this mapper to Xyllomer? Would try it myself, but I am absolutely lost when it comes to programming. The IP of the MUD is mud.xyllomer.de Port 3000.
Would be awesome if someone capable could take a look.

Cheers,

Crular
Australia Forum Administrator #182
I had a look at Geas. Unfortunately it isn't easy to see the difference between room names / descriptions and other information (it's almost all white and indented the same way).

If there is some option you can turn on in-game (eg. compass, minimap, room number) that would help. It needs to be something you can detect fairly easily in a trigger or two.

As for Xyllomer and Ateraan (further back) it would help to post an example of what you see when you walk around. Of course, someone may have done it already and that would be great. But if not, it might make it easier to advise how simple it would be to do.

I don't see a huge issue with non-standard exits. Sure they might not show up on the map, but the bulk would, which would be better than nothing.
#183
No problem, here is an example:

From this large room, twisting passages lead into odd directions. Walls, floor
and ceiling are made of smooth black rock and covered with engravings. It is
apparent that special care has been taken to decorate this room. Still, the
walls appear to be crooked, and none of the corners are properly orthagonal.
Archways lead north, south, east and west.
A chalk circle has been drawn on the ground.
There are four obvious exits: north, east, south, west.
There are four additional exits: northeastup, northwestdown, southeastup,
southwestdown.
Australia Forum Administrator #184
OK, well here's the problem. How do I know this is the start of a room description? Take as an example from Geas:

Not a room description:


The wilderness is often a good source of food. Keep your eyes open for
edible mushrooms, bushes with berries, fruit trees, and other likely snacks.
Meanwhile, trees like this one carry fruit which can provide a tasty snack.
However, as you can see with <look at apple>, the fruit is dangling too
high to reach. To get it, first you must <climb tree>.
look at apple


A room description:


 The Golden Dragon Inn is famous all over the continent of Forostar, for it
 is the most popular meeting point of adventurers and traders alike. Members
 of nearly all cultures, races and professions can be found among the
 customers, but the omnipresent patrols of the cityguard prevent serious
 fighting and ensure the relative safety of the visitors. The entire room is
 covered with tables and chairs and provides the guests with a possibility
 to sit down and relax over an ale and a card game. One of the corners is
 dominated by a large fireplace and to the northern wall, behind the wooden
 bar, someone has fixed a sign with the prices listed on it. A flight of
 stairs leads up to the guest rooms.
There are two obvious exits: south, up.


Now I'll grant that in this case the room description is indented one space. But so is this:


 The apple tree is gnarled with age. Its thick trunk attests to long years
 undisturbed in this clearing. You notice a deep hole has been bored into
 the trunk, perhaps by animals. Several ripe red apples dangle from its
 boughs.
The tree isn't damaged at all.


To be able to auto-detect rooms, and tell room A from room B, we need to be able to interpret incoming text and decide that we have changed rooms, and what the new room is.

Now if you can devise a trigger (or set of triggers) that can tell the difference between general chat/information and rooms, well you have the problem solved.
#185
Well, the room description ends, when the line with the exits
begins. That line always begins with "There is/are one/two obvious exit(s): directions."

Or isn't that how it works?
USA #186
The issue at hand is that you get the exits line after the description. It's certainly possible to solve, but most (all?) triggering to date has been from top to bottom. Basically to do this, you need to buffer up all of the lines until the prompt, then travel backwards and see if anything matches.
Australia Forum Administrator #187
Crular said:

Well, the room description ends, when the line with the exits begins.


Yes, but where does it start?

Given that there are likely to be, from time to time, words starting in capitals, at the start of a line, it isn't obvious where the room description starts.
#188
Ah ok, now I get the problem. I copied a quick run through three rooms, maybe with that it is easier to see, if it is easily doable or not at all.

This is a small, cubic room, only dimly lit. The room's only feature is a
window on the south wall, through which you can see several rows of shelves
that hold an assortment of items. A thin man briefly looks up at you from
behind the window, but quickly returns to a book that he reads by
candlelight. You can get a ritual blade here. Somehow, you find it odd that
he doesn't worry about his shop being stolen from... An archway leads north.
There are two obvious exits: north, east.
A group of four skeletons arrives.
A group of seven ghouls arrives.
A group of six zombies arrives.
Grahil[neuter imp] flaps in.
H:80%/M:20%/F:0%/B:>
n
From this large room, twisting passages lead into odd directions. Walls, floor
and ceiling are made of smooth black rock and covered with engravings. It is
apparent that special care has been taken to decorate this room. Still, the
walls appear to be crooked, and none of the corners are properly orthagonal.
Archways lead north, south, east and west.
A chalk circle has been drawn on the ground.
There are four obvious exits: north, east, south, west.
There are four additional exits: northeastup, northwestdown, southeastup,
southwestdown.
Two waterskins, some waterskins and a chalk circle.
A group of four skeletons arrives.


A group of seven ghouls arrives.
A group of six zombies arrives.
Grahil[neuter imp] flaps in.
H:80%/M:20%/F:1%/B:>
n
You are standing at the bottom of a stairwell, looking into a torchlit
chamber. This appears to be apart of the passages one expects to find
beneath a century-old graveyard. Eerie echoes haunt this place, and you do
not think that you are the one who caused them. On the floor in front of you
is a strange symbol in black. It looks as if somebody burned it into the
floor. An archway leads south.
There are two obvious exits: south, up.
A group of four skeletons arrives.
A group of seven ghouls arrives.
A group of six zombies arrives.
Grahil[neuter imp] flaps in.
H:80%/M:20%/F:1%/B:>
#189
Nice thread. The issue at hand is that you get the exits line after the description.
#190
Ok, after reading tons of helpfiles with what has changed over the last years in the MUD, I stumbled upon the possibility to enable room headers. Do you think it is now possible, that the mapper works in Xyllomer?

[Tilverton Graveyard][Exits: n, s][COORDS: 41.7n, 28.7w]
You are on the old graveyard of Tilverton. The path leads north and south
through an area that once probably reserved for the richer families of the
town. The graves are large and the destruction even more thorough than in
the other areas. I seems that special care was taken to soil the gravestones
because they once were particularly beautiful.
There are two obvious exits: north, south.
A southeastern grave and a dark mist.
Grahil[neuter imp] flaps in.
A group of twelve ghouls arrives.
A horned grey-skinned neuter demon arrives.
A group of nine skeletons arrives.
A group of six zombies arrives.
A disc hovers in.
H:100%/M:70%/F:2%/B:>
n
H:100%/M:70%/F:2%/B:>[Graveyard][Exits: n, s][COORDS: 41.8n, 28.7w]
You are on the old graveyard of Tilverton. This area seems to be the graveyard
of the rich. The graves are large, but the once beautiful gravestones were
given even worse treatment than those in other parts of the graveyard.
There are two obvious exits: north, south.
A northeastern grave and a dark mist.
Two skeletons.
Grahil[neuter imp] flaps in.
A group of twelve ghouls arrives.
A horned grey-skinned neuter demon arrives.
A group of nine skeletons arrives.
A group of six zombies arrives.
A disc hovers in.
n
H:100%/M:70%/F:3%/B:>[Graveyard][Exits: e, s][COORDS: 41.9n, 28.7w]
You are on the old graveyard of Tilverton. This is the northwestern corner,
the path continues east and south. In the other directions you can see the
fence behind the nearest graves. You see that the graves here have been
violated.
There are two obvious exits: east, south.
A southwestern grave and a dark mist.
Grahil[neuter imp] flaps in.
A group of twelve ghouls arrives.
A horned grey-skinned neuter demon arrives.
A group of nine skeletons arrives.
A group of six zombies arrives.
A disc hovers in.
H:100%/M:70%/F:3%/B:>Wafts of mist float around you.
e
H:100%/M:70%/F:3%/B:>[Tilverton Graveyard][Exits: e, w][COORDS: 41.9n, 28.6w]
You are on the old graveyard of Tilverton, the path leading east onto a
crossing. North of you is the fence, and northeast the remains of the
chapel. The graves here have been violated with maniacal fervour.
There are two obvious exits: east, west.
A southeastern grave and a dark mist.
Two bad smelling neuter ghouls.
Grahil[neuter imp] flaps in.
A group of twelve ghouls arrives.
A horned grey-skinned neuter demon arrives.
A group of nine skeletons arrives.
A group of six zombies arrives.
A disc hovers in.
You can hear some scratching noises out of one of the nearest graves.
e
H:100%/M:70%/F:4%/B:>You feel the a spectral male child staring into your soul!
[Tilverton Graveyard][Exits: e, n, s, w][COORDS: 41.9n, 28.5w]
You are just south of the ruined chapel. You have just crossed through huge
imposing stone gates that lead here to a dark, evil-smelling graveyard.
Dark, gnarled trees are the only thing breaking the monotony of the lines
and rows of mouldering grave stones. A slight breeze brings the smell of
something that you would rather not see. All about you, dead grass creates
large patches of brown and black, broken only by green areas of mold. Fear
rises in the pit of your stomach, and the depth of your soul! Do you dare
continue?
There are four obvious exits: east, north, south, west.
A northeastern grave and a dark mist.
A spectral male child.
A hunchbacked dirty male human.
Grahil[neuter imp] flaps in.
A group of twelve ghouls arrives.
A horned grey-skinned neuter demon arrives.
A group of nine skeletons arrives.
A group of six zombies arrives.
A disc hovers in.
The hunchbacked dirty male human grins crookedly.
n
H:100%/M:70%/F:4%/B:>[Ruin][Exits: d, n, s][COORDS: 42n, 28w]
This seems once have been a small chapel of Rokoon. All the mystic items, the
altar and the shrine have been horribly desacrated. Some stairs lead down
into a crypt. To the south is a graveyard.
There are three obvious exits: down, north, south.
Grahil[neuter imp] flaps in.
A group of twelve ghouls arrives.
A horned grey-skinned neuter demon arrives.
A group of nine skeletons arrives.
A group of six zombies arrives.
A disc hovers in.
USA #191
Crular said:
Ok, after reading tons of helpfiles with what has changed over the last years in the MUD, I stumbled upon the possibility to enable room headers. Do you think it is now possible, that the mapper works in Xyllomer?

Yes! :D

([EDIT]: Looking at the bigger picture, you could just use the coordinates in the header line to identify a room. That would be much easier and probably more reliable anyways. So you can use the first regex, but add parentheses around the stuff after COORDS but before the final \] so you can pull the coordinates out.)

^\[[^\]]+\]\[Exits: [^\]]+\]\[COORDS: [^\]]+\]$
Here's a regex trigger that should match that first line. When it matches, you should enable two more triggers:

^.*$
This one will match every line in the room description. Give it a lower priority (i.e. higher sequence number) than the one below.

^There are two obvious exits:
This one finds the exits line, and this is where you should disable this and the description trigger, because you know that there's no more actual description past here. It should have a higher priority (lower sequence number) than the one above because you want to shut the grab-all trigger off before it can get this line.
Amended on Fri 04 Nov 2011 05:10 PM by Twisol
Australia Forum Administrator #192
I agree. Once you iron out the regexp to match the coordinates (which should take about 5 minutes) you could use them alone as the room "id".
#193
Ok, sounds good. How difficult would it be for someone like me without any programming knowledge to make the necessary changes to the mapper plugin? No chance, or as simple as changing the lines with the mentioned triggers?
Amended on Sun 06 Nov 2011 01:02 AM by Crular
Australia Forum Administrator #194
Let me take a quick look. What is Xyllomer's details? Port and IP?

And for a novice to the MUD, how do you enable the room coordinates?
#195
Xyllomer IP: mud.xyllomer.de Port 3000
Enable room headers: @options room 1
After enabling the headers enter "save".

I have to add, that I saw rooms in the MUD which all had 0, 0 as coordinates. Maybe this was intentional, as this was some kind of maze. Just wanted to inform you, so maybe using the coordinates isn't the best idea, don't know. But then, there are also room which have the same description in the header.

Really appreciate you looking into it, very kind of you.

Thanks,

Crular
Australia Forum Administrator #196
Crular said:


I have to add, that I saw rooms in the MUD which all had 0, 0 as coordinates. Maybe this was intentional, as this was some kind of maze.


This is a bit of a deal-breaker.

<sigh> With MMORPG games giving players all sorts of mini-maps, maps and other info, to make their life less confusing, it seems that MUDs that deliberately withhold, or make confusing, information are trying to deliberately become unpopular.
#197
Well, there were not many of those rooms around. Would it break the whole mapping, or would those rooms just not get mapped? I could live with that, as I said, those rooms aren't that common.
Australia Forum Administrator #198
Well, I made a start on it.

I modified the Materia Magica one and added an extra couple of triggers to match both:


[Inside the Wanderer's Tavern.
][Exits: n, out, s, u][COORDS: 52.5n, 6e]


(two lines)

and:


[A large courtyard behind the Adventurer's Guild][Exits: w][COORDS: 52.5n, 6.5e]


(one line)

The modified version can be downloaded from GitHub here:

https://github.com/nickgammon/plugins/blob/xyllomer/Materia_Magica_Mapper.xml

RH-click on the "Raw" button near the top to get a raw copy (and do a "save as").

These are the sort of results I got so far:



It's not perfect, the use of lots of exits like this:


You can leave: east, west, post,stable.


... make it hard for a mapper designed for n, s, e, w and so on.

Also you have to walk back and forwards a bit to "link" rooms to each other. But it can be done, as you see.

[EDIT] I left some debugging "prints" in there. You may want to delete or comment them out if they are annoying you. They basically show when the mapper is "doing stuff".
Amended on Mon 07 Nov 2011 04:21 AM by Nick Gammon
#199
Thank you so much for looking into it and for adjusting the mapper to Xyllomer. I downloaded the raw version, renamed it to Xyllomer_Mapper, put it in \worlds\plugins and loaded it in MUSHclient.

When I start MUSHclient now I get the following error:

Error number: 0
Event: Run-time error
Description: [string "Plugin"]:729: table rooms has no column named description

stack traceback:

[C]: in function 'error'

[string "Plugin"]:664: in function 'dbcheck'

[string "Plugin"]:729: in function 'save_room_to_database'

[string "Plugin"]:240: in function <[string "Plugin"]:215>
Called by: Function/Sub: Xyllomer_Line called by trigger

Reason: processing trigger ""

Could you advise me what I missed and how I can fix it?

Thanks,

Crular
Australia Forum Administrator #200
Template:version
Please help us by advising the version of MUSHclient you are using. Use the Help menu -> About MUSHclient.
Australia Forum Administrator #201
I don't see why that is happening. I just deleted the database file and started again and it worked OK. Please make sure you have the latest version of MUSHclient. That is currently 4.79:

http://www.gammon.com.au/forum/?bbtopic_id=1

I deleted some stuff not relevant to Xyllomer and uploaded the changes to GitHub. Just re-download from:

https://github.com/nickgammon/plugins/blob/xyllomer/Materia_Magica_Mapper.xml

#202
Ok, I installed the latest version, before I had 4.73 installed and downloaded the newest version of the plugin.
I have only this one plugin installed, but it still does not work. I have to add, using the standard mapper plugin doesn't produce the error message, though the mapping of course does not work. The mapper also works in the Achaea MUD for example. This is the error I get now:
Run-time error
Plugin: Xyllomer_Mapper (called from world: Xyllomer)
Function/Sub: OnPluginInstall called by Plugin Xyllomer_Mapper
Reason: Executing plugin Xyllomer_Mapper sub OnPluginInstall
[string "Plugin"]:604: table rooms has no column named shop
stack traceback:
[C]: in function 'error'
[string "Plugin"]:492: in function 'dbcheck'
[string "Plugin"]:604: in function 'create_tables'
[string "Plugin"]:374: in function <[string "Plugin"]:344>
Error context in script:
600 :
601 :
602 : function create_tables ()
603 : -- create rooms table
604*: dbcheck (db:execute[[
605 :
606 : PRAGMA foreign_keys = ON;
607 : PRAGMA journal_mode = WAL;
608 :
#203
Ok, I took your hint to delete the database files. So I tried and deleted the mud.xyllomer.de_3000.db file in the MUSHclient directory. And now the error is gone, the mapper seems to work, will test it in detail.

Thanks for all your work and help, much appreciated.

EDIT:
Some rooms don't get mapped, but that isn't the fault of the plugin, but due to bad coding of the MUD, i.e. multiple rooms with the same name and coordinates. I can live with that.

Walking with the mapper plugin seems to be much slower than without, i.e. the output seems to be slower, feels like lag. Is this normal, or can something be done about it?
Amended on Mon 07 Nov 2011 08:08 PM by Crular
Australia Forum Administrator #204
Probably by testing with another mapper you created a different database. I initially called the field "description" just "desc" but had to modify that because DESC is a SQL keyword.

Deleting and recreating appears to have done the trick.

As for speed, I noticed that too but wasn't sure. SQLite3 should be fast, I'll investigate that a bit more.
Australia Forum Administrator #205
Well for timing I disabled the plugin, and then did 5 x "north" to see how long that took without the mapper:



Sent  packet: 110 (7 bytes) at Tuesday, November 08, 2011, 6:51:05 AM

north..            6e 6f 72 74 68 0d 0a

Sent  packet: 111 (7 bytes) at Tuesday, November 08, 2011, 6:51:05 AM

north..            6e 6f 72 74 68 0d 0a

Incoming packet: 234 (2 bytes) at Tuesday, November 08, 2011, 6:51:05 AM

>                  3e 20

Sent  packet: 112 (7 bytes) at Tuesday, November 08, 2011, 6:51:05 AM

north..            6e 6f 72 74 68 0d 0a

Sent  packet: 113 (7 bytes) at Tuesday, November 08, 2011, 6:51:06 AM

north..            6e 6f 72 74 68 0d 0a

Incoming packet: 235 (2 bytes) at Tuesday, November 08, 2011, 6:51:06 AM

>                  3e 20

Sent  packet: 114 (7 bytes) at Tuesday, November 08, 2011, 6:51:06 AM

north..            6e 6f 72 74 68 0d 0a

Incoming packet: 236 (2 bytes) at Tuesday, November 08, 2011, 6:51:06 AM

>                  3e 20

Incoming packet: 237 (4 bytes) at Tuesday, November 08, 2011, 6:51:06 AM

> >                3e 20 3e 20

Incoming packet: 238 (535 bytes) at Tuesday, November 08, 2011, 6:51:08 AM

<<description>>

Incoming packet: 239 (310 bytes) at Tuesday, November 08, 2011, 6:51:11 AM

<<description>>

Incoming packet: 240 (643 bytes) at Tuesday, November 08, 2011, 6:51:14 AM

<<description>>

Incoming packet: 241 (318 bytes) at Tuesday, November 08, 2011, 6:51:17 AM

<<description>>

Incoming packet: 242 (615 bytes) at Tuesday, November 08, 2011, 6:51:20 AM

<<description>>



Using packet debug we see 5 x "north" being sent at 6:51:05. Also the MUD seems to respond with 5 x "prompt" (the > symbol) by 6:51:06, one second later.

But then the descriptions trickle down at the rate of one every 3 seconds. So it looks like the MUD is "throttling" the rate of processing commands (which would be pretty normal).

With the mapper enabled again, I seem to get similar results.
#206
Yes, the MUD indeed throttles direction commands to simulate the "speed" of normal walking. But by entering multiple direction commands in quick succession should put you in run mode, meaning the throttling will be disabled. By running you will of course use more energy.

But I checked without the plugin and with the plugin and you are right, speed is the same. Must be a coincidence, that running doesn't work anymore. Maybe something in the MUD is messed up, will investigate this.
#207
Ok i play a game called dartmud.
dartmud.com 2525
we don't have coordinates to help us determine where we are. but the description portion is farily simple. how would i adjust to work with out coordinates.

a brief look
The Souk: The center of the bazaar.
< n e s w ne se sw nw >.
a cedar trash barrel, and a bronze cresset.
a bulletin board.

a normal look
The Souk
This is an open area in the center of the Souk. The chaos of the bazaar is somewhat subdued here, the calm eye at the center of the storm. In the center of the area is a stone fountain. Brightly colored tiles are inlaid in the ground just in front of the fountain to form some sort of map. Vendors sell their wares from booths and tents scattered through the bazaar or even from blankets spread on the ground. The crowds are thinning as the sun sets and some of the vendors have closed up their booths. It is extremely bright here.
There are many exits: north, east, south, west, northeast, southeast,
southwest, and northwest.
a cedar trash barrel, and a bronze cresset.
a bulletin board.
Amended on Mon 07 Nov 2011 10:02 PM by Mm1mark
Australia Forum Administrator #208
I just don't have time personally to adjust the mapper for every MUD around. But I hope that the examples here will inspire others to do something similar. From what you describe, an adapation of the Materia Magica one should work:

http://www.gammon.com.au/forum/?id=10667

That works by just hashing up the room description to get a "room ID".

#209
thanks. i knew i'd seen one that was close, but couldn't remember where.
#210
Hello everyone,

I am a long time mudder, long time mush-client user, but trying for the first time to implement this mapper. I don't seem to be having much luck. It might be due to the fact that the first post of this thread I am unable to understand. I.e. how do I exactly get the plug in working and installed? I see a download button on the first post but it is a block of code and so I imagine I have to put it somewhere (but where and how? then how do I load it on???).

I will tell you the steps I did to get to my current state:
-Install mushclient 4.73
-Open mushclient 4.73
-Open premade world (in my case mud.merentha.com 10000
-Click on File --> Plugins --> Add --> ATCP_Mapper & ATCP_NJG
(both are made by Nick Gammon, Lua language, in Mushclient\worlds\plugin\ both enabled and mapper version 1.6, NJG at version 1.0
-Once installed I get the message on mush client saying:

"MUSHclient mapper installed, version 2.5
Added plugin I:\MUSHclient\worlds\plugins\ATCP_Mapper.xml
Plugin 'ATCP_NJG' not installed. Attempting to install it...
Success!"

I can then see a green box with the words in the middle that read:

"Mushclient mapper version 2.5 written by Nick Gammon Merentha"

-I move north/south from my starting location but that green box/screen does not change.

I am not sure if I am missing something (meant to tinker with the code, add certain things or what not?) but I am stuck at this point. Note that those plugins were already in my mushclient folder (i.e. I deleted mushclient from my computer, started a fresh install and they were there from the beginning).

Also not sure if the mud is even compatible with this mapper (not sure how I can figure out if it is compatible or not).

Sorry for all the basic questions, unable to find a solution anywhere. :(

Hope anyone can help.

Kind regards,
Gorion.
Germany #211
Gorion said:
-Click on File --> Plugins --> Add --> ATCP_Mapper & ATCP_NJG

Your mud doesn't support ATCP.

I know other people have got a version of the mapper working without ATCP, using alternative methods to uniquely identify rooms, but from the names of the above plugins I'd guess they were specifically designed to use ATCP.
#212
KaVir said:

Gorion said:
-Click on File --> Plugins --> Add --> ATCP_Mapper & ATCP_NJG

Your mud doesn't support ATCP.

I know other people have got a version of the mapper working without ATCP, using alternative methods to uniquely identify rooms, but from the names of the above plugins I'd guess they were specifically designed to use ATCP.


Ahh fair enough. Thanks for the explanation. :)

But is the ATCP plug in mapper the same as the one in this thread (I ask because I am not sure if mushclient comes in with this mapper or it is a different one from the one described here).

Cheers!
USA Global Moderator #213
Gorion said:

But is the ATCP plug in mapper the same as the one in this thread

You want the Materia Magica mapper thread. That one's modified for games that don't support ATCP/GMCP. You'll want to search around the forums a bit to find threads where people get help modifying it for their MUD.

http://www.gammon.com.au/forum/?id=10667
Amended on Wed 23 Nov 2011 03:21 PM by Fiendish
#214
Fiendish said:

Gorion said:

But is the ATCP plug in mapper the same as the one in this thread

You want the Materia Magica mapper thread. That one's modified for games that don't support ATCP/GMCP. You'll want to search around the forums a bit to find threads where people get help modifying it for their MUD.

http://www.gammon.com.au/forum/?id=10667


Ah sadly I tried installing that plug in as well but still no luck. I will post more info on that link though, thanks for showing it to me (will need to investigate other parts of the forum as you said though). :)
#215
Is there any possible way to make a trigger that captures the search string information?


For example I type "mapper find imperial dining room"

Quote:
Found 1 target matching '%imperial dining room%'.
+------------------------------ START OF SEARCH -------------------------------+
Imperial Dining Room (Hotel Orlando) (30335) - 2 rooms away
+-------------------------------- END OF SEARCH -------------------------------+





Quote:
Imperial Dining Room (Hotel Orlando) (30335) - 2 rooms away

I want to make a trigger to recognize that line , how can this be done? More specifically I want to make a trigger that runs to that room when it sees that text.
Amended on Mon 26 Dec 2011 10:58 PM by Music48384
USA Global Moderator #216
What do you expect to happen if there is more than one found result?

In any case, since it looks like you're asking about the Aardwolf mapper and not the generic graphical module, just use 'mapper next' to go to the next found result.
Australia Forum Administrator #217
Something like this:


<aliases>
  <alias
   match="goto *"
   enabled="y"
   send_to="10"
   sequence="100"
  >
  <send>mapper find %1
mapper next</send>
  </alias>
</aliases>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


That does a "mapper find <wherever>" followed by a "mapper next".
#218
Where do I get ATCP_NJG?
Australia Forum Administrator #219
It's part of the MUSHclient install.
#220
Nick Gammon said:

Right. I have done a simple plugin (below) which illustrates integrating the mapper into a MUD which does NOT use telnet negotiation....


Hello,

I am trying to get this mapper to work with a MUD I am helping to develop, currently I'm trying to get it to work in our beta environment.

I think I just need to adjust the triggers, but I don't know how to identify what I need to change, and what I need it to trigger on. Any help that could be provided would be invaluable.

Here is a screenshot of what we have to work with

http://i21.photobucket.com/albums/b261/Nylian/mudhelp.png

Here's the code for triggers only:



<!--  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"
   name="Name_Line"
   script="Name_Line"
   sequence="100"
   text_colour="11"
  >
  </trigger>
  
  <trigger
   back_colour="8"
   bold="y"
   enabled="y"
   match="Obvious exits are:*"
   match_back_colour="y"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   name="Name_Or_Exits"
   script="Name_Or_Exits"
   sequence="100"
   text_colour="15"
  >
  </trigger>
  
</triggers>
Amended on Wed 13 Jun 2012 10:08 PM by Nylian
USA Global Moderator #221
Nylian said:
I am trying to get this mapper to work with a MUD I am helping to develop

If you're developing a new MUD, why not add in GMCP support?
#222
Fiendish said:

If you're developing a new MUD, why not add in GMCP support?


Thanks for the suggestion (I have already mentioned this to the chief).

I am not doing that level of coding, or any coding at the moment for that matter, that's up to the head code monkey. I'm doing things at a much simpler level.

Regardless of what becomes of the MUD, I would still like to know how to adapt this to the screenshot provided.
Australia Forum Administrator #223
If you are developing the MUD, you an either do it the very easy way, or the very tedious and unreliable way. Guess which one I would recommend?

The easy way, as Fiendish suggested, is to add some extra protocol (it could be GMCP) which sends down, at the very least, what room you are in (as in, internal room number). Uniquely identifying each room is the most important thing for a mapper. More simply than GMCP, just use telnet subnegotiation to send down a simple sequence (eg. "room=1234").

But really, just send GMCP. Then you have mappers "off the shelf" already written, or if you want to look different, customize one that is already written.

If you don't, then you have to try to detect unique rooms by finding the room description (which is prone to errors) and then handle multiple rooms with exactly the same description (like "a forest path") which will make the mapper act weirdly. And look crappy.
#224
Nick Gammon said:

If you are developing the MUD, you an either do it the very easy way, or the very tedious and unreliable way. Guess which one I would recommend?

The easy way, as Fiendish suggested, is to add some extra protocol (it could be GMCP) which sends down, at the very least, what room you are in (as in, internal room number). Uniquely identifying each room is the most important thing for a mapper. More simply than GMCP, just use telnet subnegotiation to send down a simple sequence (eg. "room=1234").

But really, just send GMCP. Then you have mappers "off the shelf" already written, or if you want to look different, customize one that is already written.

If you don't, then you have to try to detect unique rooms by finding the room description (which is prone to errors) and then handle multiple rooms with exactly the same description (like "a forest path") which will make the mapper act weirdly. And look crappy.


Truly I appreciate the response Nick, however my response to him would be the same to you.

Nylian said:


Thanks for the suggestion (I have already mentioned this to the chief).

I am not doing that level of coding, or any coding at the moment for that matter, that's up to the head code monkey. I'm doing things at a much simpler level.

Regardless of what becomes of the MUD, I would still like to know how to adapt this to the screenshot provided.


I would have to figure this out the crappy way and just need help customizing the triggers =/
Netherlands #225
I wasn't planning on posting, since nobody needs to be told the same thing twice. However, I do want to make a comparison.

You have a button. You press the button, the light works. How is this implemented? The accepted way is to simply close the electrical circuit and voila, done.

The other way is to make a Ruby Goldberg machine. Your button nudges a domino, que 100 more, then something turns and a ball rolls, etc etc, and eventually a little robotic hand screws in a lightbulb.

Ridiculous? Probably, but I'm exaggurating with a reason. The latter way has so many fault points and unnecessary complexity that it is bound to cause trouble. A domino might no fall, the turny thing doesn't have enough momentum, the robot hand slips on the lightbulb, etc.

In comparison, the button is proven technology. It works with tons of different lightbulbs. It is simple. If one breaks, you can easily fix it. In the same way, using GMCP will not only allow existing mappers to work with it, it will also be simple to maintain: there's no logic to start and stop the omitting of lines, no other user triggers that might fire first and possibly prevent your script from running, and no chance on 'it breaks and now my output is being eaten!' sort of problems.

GMCP is a very simple protocol. Any codebase worth its name will make it very simple. The amount of bugs and time the crappy method will involve is paid back a hundred times by biting he bullet on GMCP and doing it 'right' from the get-go. (Learning how to use a wheel beats inventing it based on a picture!)

If this sounds like an elitist lecture, I apologize for coming across that way. But I see this happen far too often: people choose the 'crappy' methods because it is all they know, and other thing are the things of wizards and dragons. Ruby Goldberg machines are what come out of such situations almost every single time, and they'll never be 'replaced' by those in charge because it always 'almost works'. In the meanwhile, everyone (coders and players both) suffer the consequences. :)

Good luck with whatever method you go with. :-)
#226
Worstje said:

I wasn't planning on posting, since nobody needs to be told the same thing twice. However, I do want to make a comparison.

You have a button. You press the button, the light works. How is this implemented? The accepted way is to simply close the electrical circuit and voila, done.

The other way is to make a Ruby Goldberg machine. Your button nudges a domino, que 100 more, then something turns and a ball rolls, etc etc, and eventually a little robotic hand screws in a lightbulb.

Ridiculous? Probably, but I'm exaggurating with a reason. The latter way has so many fault points and unnecessary complexity that it is bound to cause trouble. A domino might no fall, the turny thing doesn't have enough momentum, the robot hand slips on the lightbulb, etc.

In comparison, the button is proven technology. It works with tons of different lightbulbs. It is simple. If one breaks, you can easily fix it. In the same way, using GMCP will not only allow existing mappers to work with it, it will also be simple to maintain: there's no logic to start and stop the omitting of lines, no other user triggers that might fire first and possibly prevent your script from running, and no chance on 'it breaks and now my output is being eaten!' sort of problems.

GMCP is a very simple protocol. Any codebase worth its name will make it very simple. The amount of bugs and time the crappy method will involve is paid back a hundred times by biting he bullet on GMCP and doing it 'right' from the get-go. (Learning how to use a wheel beats inventing it based on a picture!)

If this sounds like an elitist lecture, I apologize for coming across that way. But I see this happen far too often: people choose the 'crappy' methods because it is all they know, and other thing are the things of wizards and dragons. Ruby Goldberg machines are what come out of such situations almost every single time, and they'll never be 'replaced' by those in charge because it always 'almost works'. In the meanwhile, everyone (coders and players both) suffer the consequences. :)

Good luck with whatever method you go with. :-)


I like your style and I appreciate the intent, but sometimes you go through making the Ruby Goldberg machine so you can see how it works. Not only does it make you appreciate the light switch more, but you can then learn the bits and pieces that make them go and apply that to other areas where a light switch hasn't been invented yet.

Do I want GMCP? Hell yeah.
Do I still want to learn how to make this trigger & consequently mapper work so I can learn more about XML plugins? Hell yeah.

The builtin mapper for CMUD seems to work fine for me for now. I personally like Mushclient more, but if this is too much work to get going I'm fine with just using this until we have GMCP implemented.

If anyone is willing to take a look and do the work, I'm more than willing to learn.
Amended on Fri 15 Jun 2012 09:10 PM by Nylian
Australia Forum Administrator #227
Personally I don't propose to convert yet another MUD's output for mapping, having done it a few times. But you may get tips from them. eg.

http://www.gammon.com.au/forum/?id=10536

http://www.gammon.com.au/forum/?id=10667

If CMUD can make it work, no doubt it can be done. I presume they also hit issues with rooms with the same name, hidden exits, that sort of stuff.
#228
Thank you Nick! I've seen all of your instructional videos thus far from youtube and am constantly checking the site.

I appreciate the direction and will do what I can to get her working. :)
#229
Hi, im new on the forums, i just downloaded the mapper
and I play on a SMAUG mud, in spanish, so mi question is:

It works for a SMAUG MUD translated in spanish?

thanks
USA Global Moderator #230
Martin4503 said:
It works for a SMAUG MUD translated in spanish?

I don't see why it wouldn't work in Spanish too.
#231
The City Square
A giant circle in the center of the city, this spot was long ago misnamed
as the City Square. In the center of the circle is a large fountain which
anyone can get water from. Usually a popular spot for gathering, the City
Square is often where friends meet to chat, do business, or rest. Mounted
on the oil lamp's post are a dull gleaming plaque and a sign.
[ obvious exits: E S W ]

I'm trying to get a regular expression in a trigger to pass to a the lua function Name_Line.

The regex is not matching as I'm trying to pass Multi-line.

^(.*\n)*\[

Any help?
#232
Hello all, wow page 16 of the thread, hope this doesn't get lost.

I am the head builder of Arctic MUD and I wanted to reach out to see if the generic graphical mapper could be modified to suit my temporary needs.

A little history for background: Our mud has been around since 1992 and is a heavily custom diku. Our telnet negotiation currently does not support GMCP, but it is on the project road map for later in the year. We are doing a lot of recoding and redevelopment to update the mud and bring it out of 1989 standards.

As a major part of the redevelopment, we are in need to redesign the world layout by moving zones and reconnecting them to a global road zone. In order for me to accomplish this task, I wanted to probe this community to see of the generic graphical mapper module to perform the duty.

We currently do not show the room numbers to mortals and I am in discussion with the head coder to see if we can just have this lifted to make this all a lot easier. Since I am a creator, I do see the room numbers and wanted to see if the mapper could parse a room and map it so that we can begin redesign of the world layout.

Below is a sample room description seen through the eyes of an immortal:

Solace Square [100] <City> POLICED
Solace Square is a large clearing that is surrounded on all sides by
huge vallenwood trees. These trees stretch far above the ground and their
limbs provide cover and shelter to the inhabitants of Solace. The clearing
here rises slightly towards the center of the square, providing a high spot
in the center. Small roads have been cut into the dense forest to the
north, south, east, and west. On one edge of the square, there is a huge
vallenwood which bough supports a collection of huts and buildings. A
small spiral staircase leads up around the trunk of the tree and into the
thick limbs which house the buildings.
A long torch functions as a street lamp here.
A large fountain sits in the middle of the road, taking up space.
976H 81V Exits:NESWU>

The number in the [] is the room number and should be able to be used as an unique identifier. The exits are listed in the prompt however we are not sure we would even have to parse those to get it to map. The mud uses ascii coloring as well, however I do not want to base a search match on it as most immortals turn off color.

Allowing the room numbers to be shown to any player is part of our plan, via GMCP, however I am in a pinch to get the world rebuilt while the coders are working on telnet sub negotiation and other tasks (CLIPS based mob AI) and I do not want to take up their time working this out.

Any thoughts? comments?
Australia Forum Administrator #233
As I have mentioned privately to Dougan, this should be pretty easy to do. Any MUD that is kind enough to provide the current (unique) room identifier has solved 90% of the problems in getting the mapper to work.

Basically I think I would modify the Materia Magica version which works with non-GMCP triggers. However I won't offer to do that unless the room numbers are visible to anyone, otherwise it would be a pain releasing a version, have you say "it doesn't work" and then trying to figure out why.
#234
I can completely see how that would be extremely difficult if you did not have the same game screen that I have while trying to troubleshoot and design it. I will see how hard it would be to display the rvnum to everyone as a stop gap until we move to GMCP.
Germany #235
Dougan said:

A little history for background: Our mud has been around since 1992 and is a heavily custom diku. Our telnet negotiation currently does not support GMCP, but it is on the project road map for later in the year. We are doing a lot of recoding and redevelopment to update the mud and bring it out of 1989 standards.

You might want to check out my protocol snippet, it can be added to most MUDs in a matter of minutes, and it supports a whole load range of modern features: http://www.mudbytes.net/file-2811

I've posted some examples of how I use the features here: http://godwars2.blogspot.co.uk/
#236
The coding team is going to take the GMCP into advisement, but will not be able to get anything in soon. I am kind of bummed as I don't really want to pen and paper out 20k rooms and then move them all. I will keep looking and see what I can do.
Australia Forum Administrator #237
It can't be too hard to make the display of the room vnums occur for everyone. It would be better if it was an option, otherwise existing players will ask what the heck those numbers mean.
#238
Oh, I completely agree but that decision is out of my hands for now. There were grumblings of zone reset abuse but I think it mainly is just having a mentality that is stuck in the past.
Australia Forum Administrator #239
Zone reset abuse? You lost me there.

When the zone resets the rooms don't change do they?

You would be hard pressed to find anyone (let alone me) who would put time into writing code they are unable to test. You will have to work this out with your admins. Sorry. I mean that in the nicest way. :)
#240
Recent posts in this topic prompted me to try adapting the mapper to work with a mud called Batmud. One of the problems that I've been facing is that rooms with identical names with identical exits and descriptions are far too common, which will cause mapping problems. Is there a good way of dealing with this? I'm wondering if its even possible to map muds reliably that do not have some way of letting players look at room numbers (e.g gmcp in materia magica and aardwolf).

If I manage to solve the above problem, the next mapping challenge for me will be to restrict automatic map movement e.g only to roads when moving in the outworld. Is it possible to control the mapper's pathfinding?
Amended on Mon 13 Jan 2014 01:58 AM by Victorious
Australia Forum Administrator #241
No there's not a particularly good way of dealing with it. It's like a city that has a lot of streets with the same name in it. It might be amusing to do, but isn't fun for its citizens.
Poland #242
Hello,
Simple mapper from page 7 does not work for me.


Schodki
Za jednym z gobelinow zdobiacych sciane katedry znajduja sie waziutkie, okragle
schody prowadzace coraz wyzej i wyzej. Nie ma tu pochodni, ani okienek, nie
mozesz wiec ocenic wysokosci chociazby po wysokosci schodow. Ale nogi Ci mowia,
ze jest to stanowczo za wysoko. Wyglada na to, ze ponad krzyzowo-zebrowym
sklepieniem darkhavenskiej katedry znajduje sie cos, czego normalnie z poziomu
ulicy zobaczyc nie sposob...
[Exits: up down]

<2201/2201hp 1008/1130mn {-11al 1000}>


I get this error:


Run-time error
Plugin: Simple_Mapper (called from world: cyg-kylan)
Function/Sub: Name_Or_Exits called by trigger
Reason: processing trigger "Name_Or_Exits"
[string "Plugin"]:39: attempt to concatenate global 'roomdesc' (a nil value)
stack traceback:
        [string "Plugin"]:39: in function 'process_exits'
        [string "Plugin"]:80: in function <[string "Plugin"]:74>
Error context in script:
  35 : 
  36 : function process_exits (exits_str)
  37 : 
  38 :   -- genereate a "room ID" by hashing the room name, description and exits
  39*:   uid = utils.tohex (utils.md5 (roomname .. roomdesc .. exits_str))
  40 :   uid = uid:sub (1, 25)
  41 : 
  42 :   -- break up exits into individual directions
  43 :   exits = {}


in the script simple mapper corrected function Name_Or_Exit:


    exits = string.match (line, "^%[Exits: (.*)%]")
Amended on Sun 23 Feb 2014 02:50 PM by Bzik
#243
Greetings.
I'm new in this and my question would be:
Can somebody explain me how it works... by how it works i want to ask how do you add that to You're mush client.
I wasn't able to understand what Nick Gammon wrote...
If somebody could help i would be really gratefull.

Gorertz