[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  MUSHclient generic graphical mapper module

MUSHclient generic graphical mapper module

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


Pages: 1  2 3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #15 on Fri 12 Mar 2010 09:05 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #16 on Fri 12 Mar 2010 09:08 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #17 on Fri 12 Mar 2010 09:18 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #18 on Fri 12 Mar 2010 09:43 PM (UTC)
Message
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.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #19 on Fri 12 Mar 2010 09:53 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #20 on Fri 12 Mar 2010 09:59 PM (UTC)
Message
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?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #21 on Fri 12 Mar 2010 10:43 PM (UTC)
Message
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.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #22 on Fri 12 Mar 2010 10:57 PM (UTC)
Message
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)
[Go to top] top

Posted by Garrion   (21 posts)  [Biography] bio
Date Reply #23 on Fri 12 Mar 2010 11:28 PM (UTC)

Amended on Sat 13 Mar 2010 12:12 AM (UTC) by Nick Gammon

Message
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.
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #24 on Sat 13 Mar 2010 12:12 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #25 on Sat 13 Mar 2010 12:35 AM (UTC)

Amended on Sat 13 Mar 2010 12:36 AM (UTC) by Nick Gammon

Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #26 on Sun 14 Mar 2010 04:05 AM (UTC)

Amended on Sun 14 Mar 2010 04:06 AM (UTC) by Nick Gammon

Message

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


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,989 posts)  [Biography] bio   Forum Administrator
Date Reply #27 on Sun 14 Mar 2010 05:18 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Techno Samurai   (5 posts)  [Biography] bio
Date Reply #28 on Wed 17 Mar 2010 04:16 PM (UTC)
Message
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.
[Go to top] top

Posted by Larkin   (278 posts)  [Biography] bio
Date Reply #29 on Wed 17 Mar 2010 04:17 PM (UTC)
Message
Yes, you create a plugin and put that (or something similar, configured for your MUD) into it.
[Go to top] top

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

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


688,823 views.

This is page 2, subject is 17 pages long:  [Previous page]  1  2 3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  [Next page]

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]