Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ Plugins ➜ 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 page


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

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #45 on Fri 19 Mar 2010 05:58 PM (UTC)

Amended on Fri 19 Mar 2010 05:59 PM (UTC) by Twisol

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

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #46 on Fri 19 Mar 2010 06:03 PM (UTC)
Message
(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.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #47 on Fri 19 Mar 2010 09:34 PM (UTC)
Message
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.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #48 on Fri 19 Mar 2010 09:37 PM (UTC)
Message
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

- Nick Gammon

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

Posted by Larkin   (278 posts)  Bio
Date Reply #49 on Fri 19 Mar 2010 09:39 PM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #50 on Fri 19 Mar 2010 09:43 PM (UTC)

Amended on Fri 19 Mar 2010 11:23 PM (UTC) by Nick Gammon

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


- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #51 on Fri 19 Mar 2010 09:48 PM (UTC)
Message
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.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #52 on Fri 19 Mar 2010 09:50 PM (UTC)
Message
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.

- Nick Gammon

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

Posted by Larkin   (278 posts)  Bio
Date Reply #53 on Sat 20 Mar 2010 12:41 AM (UTC)
Message
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. :)
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #54 on Sat 20 Mar 2010 12:46 AM (UTC)
Message
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.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #55 on Sat 20 Mar 2010 01:14 AM (UTC)
Message
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.

- Nick Gammon

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

Posted by Larkin   (278 posts)  Bio
Date Reply #56 on Sat 20 Mar 2010 01:18 AM (UTC)
Message
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.
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #57 on Sat 20 Mar 2010 01:27 AM (UTC)
Message
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!

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #58 on Sat 20 Mar 2010 01:33 AM (UTC)
Message
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.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #59 on Sat 20 Mar 2010 01:36 AM (UTC)
Message
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)

- Nick Gammon

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

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

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


754,377 views.

This is page 4, 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 page

Go to topic:           Search the forum


[Go to top] top

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