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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  ASCII Map Help
Home  |  Users  |  Search  |  FAQ
Register forum user name
Forgotten password?

ASCII Map Help

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

Posted by Sediket   (4 posts)  [Biography] bio
Date Fri 04 Mar 2016 05:24 AM (UTC)

Amended on Fri 04 Mar 2016 06:02 AM (UTC) by Sediket

MushClient Community,

So I'm playing ZombieMUD and this MUD implements an ASCII map system when not in specific areas. I would like to capture all of it with color in HTML to create a complete map of the MUD, but I've not been able to figure out a method to do that.

The best I could come up with was to just log in a trigger the left side of the map, but appending following lines onto it in HTML I'm clueless.



Also the @ is me so that would need to be omitted from the end result.

I know this is accomplished before, but I haven't found any method to do this yet.

Please advise, thanks!
[Go to top] top

Posted by Fiendish   USA  (1,744 posts)  [Biography] bio   Global Moderator
Date Reply #1 on Fri 04 Mar 2016 11:01 AM (UTC)

Amended on Fri 04 Mar 2016 11:08 AM (UTC) by Fiendish

I'm not going to implement it here, because the actual implementation of such a thing is quite involved. But I'll try to help speed you along with an explanation at least of what it seems to me that you need to do to solve this in the general case and then in the specific case. I'm going to ignore any discussion of color here, because it's not important.

Description of the problem: You have two images of the world. Image A is just the bit around you at the moment, and image B is the accumulated total world seen so far. Every time you move, image A becomes slightly changed (the whole image slides e.g. left, losing the leftmost elements and gaining new rightmost elements). The goal then is to find the location in image B that best matches image A, and then, if the match is very strong, add the missing elements to image B to fill in the gaps in overlap.

The general case says that maybe you can get teleported around or not map all at once or that there could be another reason why you wouldn't always have a known continuous trail. Let's start with that case and then simplify.

The first time you get an image A, copy it to image B.
Every time you get a new image A:
   1) Create an image C where image C is like image B but has empty padding on all sides of the image equal to the size of image A.
   2) Look at every possible A-sized subsection of image C. For every such subsection:
      1) Compare all of the elements in image A with all of the elements in the subsection. 
         If they are different only around the perimeter of A and the elements in C are blank, not some other different symbols, then you have a very strong match and should fill in the missing elements in B. 
         If it doesn't match well enough, discard image A. It's better to be safe than to fill in the wrong elements.

Now if you think about this for a bit, you will realize that this unconstrained image correspondence problem will become very slow very quickly. You also get an unavoidable ambiguity problem, where if two sections of image B look mostly identical but not completely identical, then you could match image A to the wrong location.

Luckily, if you keep track of where you go when mapping and always resume in the same spot as you stopped it becomes much simpler.

Start with an empty image B. It can be really really big, or it can start off the same size as image A and then expand as you get more data. It doesn't matter to me.
The first time you get an image A, copy it to somewhere in image B. Let's say the middle. We'll call that location x0,y0.
Record the coordinate location in image B associated with where you've placed the copy of image A. Let's set this coordinate record as pos={x=x0, y=y0}
Every time you get a new image A:
   1) Make an image C that is like image B except with at least 1 move's worth of empty padding on all sides.
   2) You know that you have moved only one step from the previous image A.
   3) So you can take all the elements from image A and write them to image C in the A-sized window around pos[x-1],pos[y] or around pos[x],pos[y-1] etc.
   4) Update pos with the new coordinate.
   5) Make image C the new image B.

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


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.


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 FutureQuest]