Generic Mapping Script

All and any discussion and development of the Mudlet Mapper.
kalrykh
Posts: 13
Joined: Fri Sep 17, 2021 7:09 pm

Re: Generic Mapping Script

Post by kalrykh »

Anyone else have any issues with this following when moving through large areas where the room names and exits are all the same? It seems to get lost and jump me around randomly. I play in brief mode, so all I see is a room name an exit list.

Mirkwood(e, n, w and s)
(HP:190 EP:190): s
Mirkwood(e, n, w and s)
(HP:190 EP:190): s
Mirkwood(e, n, w and s)
(HP:190 EP:190): s
Mirkwood(e, n, w and s)
(HP:190 EP:190): s

It maps the area just fine, it just jumps around when moving through it (the area is a couple thousand rooms).

kalrykh
Posts: 13
Joined: Fri Sep 17, 2021 7:09 pm

Re: Generic Mapping Script

Post by kalrykh »

Editing and removing the original content of this post to discourage anyone else from doing what I did. It creates other problems. These are the issues that I ran into while using the mapper. These are all issues dealing with the map following you after the map has been created. I had no issues creating rooms with the stock setup. Maybe my solutions will help someone else. After significant number of changes to the generic map script, I discovered that a simple settings change that solved one problem ended up solving others as well. The following issues and solutions seem to work for T2T, The Two Towers mud.

1) In one zone/area, rooms sometimes change names, messing with the mapper's room recognition and stopping its ability to follow you.
2) As the mapper followed you through rooms that shared room name/exit combinations with other rooms anywhere else on the map, it would jump your position back and forth between them, confusing where you actually were.
3) Sometimes even moving in a straight line, the mapper position would jump back a room, leaving me constantly off by one room and messing with my ability to speedwalk anywhere without getting lost.
4) The mapper will follow me through chains of rooms that have only special exits if i move between them manually, but will not follow me through them if I speedwalk through them.
5) The mapper would almost always get stuck somewhere on speedwalk paths.

I'll go through the solutions in a different order, as in some cases the fixes for one change the circumstances of another.

3) Turns out the the mapper was adding rooms to the move_queue but not always clearing them out with move_map when I moved between rooms. Took a while to figure this one out. I type "look" obsessively while I'm playing, without realizing it, and every time I did, it caused my move_queue to not clear on subsequent movements. There's an option you can set to true or false in the mapper, search_on_look, which uses the results from the look command to verify your position. I do not have the triggers for the room description setup to verify position based on "look" results, so this was never clearing from the move queue and was causing backup. There are two options to fix this: turn off search_on_look or setup the trigger correctly for look to verify your position. Ereane pointed out the search_on_look option to me on discord and setting this to false solved the problem. Then I noticed it would sometimes happen again if i was careless and ran against barriers carelessly, adding moves to the queue and not clearing them. I had forgotten to add "You can't go that way" to the English Failed Move Trigger. Once I did both of these, I stopped having move queue problems.

2) I originally solved this by removing all references to the find_me function in the map script so that it wouldn't try to auto locate you. Turns out the backed up move_queue was causing this problem as well. Since the room name and exits didn't always match the expected room that was next in the move queue, the mapper tried to recalculate my position and was unable to, and would put me in various parts of the map. With the move_queue problem solved, the mapper no longer jumped me around and I can leave the find_me stuff alone, allowing the mapper to find me correctly, if for some reason it ever bugs out.

1) The fix for this was all about triggers. I added the information to https://wiki.mudlet.org/w/Generic_Mapper_Additions



4 & 5) I have not found a way to solve these actual problems, but I did create a work around. in my speedwalk alias, I added a send("blahblah") command after the actual function for walking, so it would send a command to the mud that was not actually recognized. When you send an unrecognized command, the mud responds with "What?" So what I have done is, in my speedwalk alias, i have added enableTrigger("What Trigger") to enable a trigger and added the send("blahblah") after the speedwalk function. I created "What Trigger" that fires on "What?" that teleports me (sets the room ID and centers the view) to the room I originally told it to speedwalk to. If I had not found a way to make it fire at the end of the speedwalk alias, rather than at the beginning, it would immediately set me at the intended location and then the map would move as I moved through some rooms and get off again. Then once that is done, it disables itself, so that it doesn't mess with me if I typo something on accident later, and clears moves (just in case). Now, the map always ends up at the intended room after a speedwalk, even if it craps out somewhere along the path. For the most part, it no longer gets stuck in the middle of speedwalks, thanks to the earlier fixes, unless I'm moving through back to back rooms with only special exits, so this is rarely needed, but I needed 100% reliability.

Jor'Mox
Posts: 1105
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

wolfgoesmoo wrote:
Fri Apr 03, 2020 6:06 pm
Hi Jor'Mox,

I'm trying to set up the script for Legends of Terris (Server: 45.8.103.242, Port: 31000, have to turn off TLS to connect). If that IP doesn't work it's because the connection info is DNS rather than IP-based and the IP changed. The editor wouldn't let me submit a post with the address in it.

In Terris, there are rooms like this:
Northern Gate of Devardec
The large gates leading out of Devardec loom overhead. Made from white
stone with brass armament points, the walls and top of the gate have a
few nicks in them. The domes of the gate are coated in gold leaf.
Several guards stand in a group, conferring with each other while
watching the gate.
There is a shimmering portal to the northwest
Obvious Exits: North South SouthEast
There is a sign here

Shimmering portals are essentially normal exits except that they are level-limited (so if you are too low or too high level, you won't be able to pass through). I think I figured out that I needed to set an exit string like this:

Code: Select all

^There is a shimmering portal to the (.*)
But sometimes if I head to the Northwest and then return to the southeast it keeps adding a series of rooms to in that nw/se stretch endlessly. Is this because it's capturing the exits twice? Any help understanding this would be appreciated!
Sorry that I'm WAY behind on this, I lost track of all this stuff after the pandemic hit, honestly. But, the reason is that there is an exit mismatch between the existing room and what it detects, which tells me that your triggers are missing something. And of course moving to the NW will create an exit in that direction, regardless of if it was detected, and that is why you are getting a duplicate room.

Jor'Mox
Posts: 1105
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

davidwiththenicehat wrote:
Fri May 29, 2020 5:23 pm
Do you happen to know why the generic mapper stores portals as userdata?
Specifically how those exits would not have already been backed up as special exits?
At the time I was developing the script, there wasn't a good way to retrieve special exits, so I had to make a work around. From what I understand, the relevant function is now a thing, but that is what you get when you are working with older code in an active codebase.

Jor'Mox
Posts: 1105
Joined: Wed Apr 03, 2013 2:19 am

Re: Generic Mapping Script

Post by Jor'Mox »

kalrykh wrote:
Sat Sep 25, 2021 12:04 pm
1) In one zone/area, rooms sometimes change names, messing with the mapper's room recognition and stopping its ability to follow you.
2) As the mapper followed you through rooms that shared room name/exit combinations with other rooms anywhere else on the map, it would jump your position back and forth between them, confusing where you actually were.
3) Sometimes even moving in a straight line, the mapper position would jump back a room, leaving me constantly off by one room and messing with my ability to speedwalk anywhere without getting lost.
4) The mapper will follow me through chains of rooms that have only special exits if i move between them manually, but will not follow me through them if I speedwalk through them.
5) The mapper would almost always get stuck somewhere on speedwalk paths.

4 & 5) I have not found a way to solve these actual problems, but I did create a work around. in my speedwalk alias, I added a send("blahblah") command after the actual function for walking, so it would send a command to the mud that was not actually recognized. When you send an unrecognized command, the mud responds with "What?" So what I have done is, in my speedwalk alias, i have added enableTrigger("What Trigger") to enable a trigger and added the send("blahblah") after the speedwalk function. I created "What Trigger" that fires on "What?" that teleports me (sets the room ID and centers the view) to the room I originally told it to speedwalk to. If I had not found a way to make it fire at the end of the speedwalk alias, rather than at the beginning, it would immediately set me at the intended location and then the map would move as I moved through some rooms and get off again. Then once that is done, it disables itself, so that it doesn't mess with me if I typo something on accident later, and clears moves (just in case). Now, the map always ends up at the intended room after a speedwalk, even if it craps out somewhere along the path. For the most part, it no longer gets stuck in the middle of speedwalks, thanks to the earlier fixes, unless I'm moving through back to back rooms with only special exits, so this is rarely needed, but I needed 100% reliability.
I considered ways to handle changing room names when I built this script, but honestly I couldn't figure anything out that would work in the generic case. In a game that had zero methods for being randomly moved around, you could always just ignore room names, and go strictly off of movement. But many games have some way by which you could legitimately not know where you are, and so it needs to figure it out based on what it sees. And since rooms with identical exits but different names are everywhere, you would at a minimum need a specifically tailored script for that particular game and that particular area so that it took whatever into account to handle the room name changes properly. Likely an impossible task for a general case though, and far beyond the scope of the existing script.

The function to find you when the mapper gets lost is because the game I originally built it for allows for relatively random teleportation and movement, and particularly when you end up in an area with a lot of mostly identical rooms, it needs to keep tabs on things to see if it made a good guess as to your location, and adjust as necessary.

Following you through special exits via speed walking is, I believe, a problem because of how it captures commands to store in its movement queue. It checks the room you are currently in to see if the command sent is a command to use a special exit for that room, and if not it ignores it. So when you speedwalk, you aren't in the room with the special exit yet, so it doesn't get added to the queue. In theory this could be fixed by overhauling how it handles the command queue, basically storing every command, and each time it detects that you have moved to a new room, remove entries from the queue until it finds one that would be a valid exit command for the room you just left.

kalrykh
Posts: 13
Joined: Fri Sep 17, 2021 7:09 pm

Re: Generic Mapping Script

Post by kalrykh »

Jor'Mox wrote:
Fri Mar 04, 2022 11:42 pm
kalrykh wrote:
Sat Sep 25, 2021 12:04 pm
1) In one zone/area, rooms sometimes change names, messing with the mapper's room recognition and stopping its ability to follow you.
2) As the mapper followed you through rooms that shared room name/exit combinations with other rooms anywhere else on the map, it would jump your position back and forth between them, confusing where you actually were.
3) Sometimes even moving in a straight line, the mapper position would jump back a room, leaving me constantly off by one room and messing with my ability to speedwalk anywhere without getting lost.
4) The mapper will follow me through chains of rooms that have only special exits if i move between them manually, but will not follow me through them if I speedwalk through them.
5) The mapper would almost always get stuck somewhere on speedwalk paths.

4 & 5) I have not found a way to solve these actual problems, but I did create a work around. in my speedwalk alias, I added a send("blahblah") command after the actual function for walking, so it would send a command to the mud that was not actually recognized. When you send an unrecognized command, the mud responds with "What?" So what I have done is, in my speedwalk alias, i have added enableTrigger("What Trigger") to enable a trigger and added the send("blahblah") after the speedwalk function. I created "What Trigger" that fires on "What?" that teleports me (sets the room ID and centers the view) to the room I originally told it to speedwalk to. If I had not found a way to make it fire at the end of the speedwalk alias, rather than at the beginning, it would immediately set me at the intended location and then the map would move as I moved through some rooms and get off again. Then once that is done, it disables itself, so that it doesn't mess with me if I typo something on accident later, and clears moves (just in case). Now, the map always ends up at the intended room after a speedwalk, even if it craps out somewhere along the path. For the most part, it no longer gets stuck in the middle of speedwalks, thanks to the earlier fixes, unless I'm moving through back to back rooms with only special exits, so this is rarely needed, but I needed 100% reliability.
I considered ways to handle changing room names when I built this script, but honestly I couldn't figure anything out that would work in the generic case. In a game that had zero methods for being randomly moved around, you could always just ignore room names, and go strictly off of movement. But many games have some way by which you could legitimately not know where you are, and so it needs to figure it out based on what it sees. And since rooms with identical exits but different names are everywhere, you would at a minimum need a specifically tailored script for that particular game and that particular area so that it took whatever into account to handle the room name changes properly. Likely an impossible task for a general case though, and far beyond the scope of the existing script.

The function to find you when the mapper gets lost is because the game I originally built it for allows for relatively random teleportation and movement, and particularly when you end up in an area with a lot of mostly identical rooms, it needs to keep tabs on things to see if it made a good guess as to your location, and adjust as necessary.

Following you through special exits via speed walking is, I believe, a problem because of how it captures commands to store in its movement queue. It checks the room you are currently in to see if the command sent is a command to use a special exit for that room, and if not it ignores it. So when you speedwalk, you aren't in the room with the special exit yet, so it doesn't get added to the queue. In theory this could be fixed by overhauling how it handles the command queue, basically storing every command, and each time it detects that you have moved to a new room, remove entries from the queue until it finds one that would be a valid exit command for the room you just left.

Glad to see you're still alive and well. After many months of trial and error, I ended up putting something together that works. I've made it available to other users from my MUD, but it has a steep learning curve. Regardless, I would never have been able to get it working without your original code and the help you've given others here, so thank you very much.

Post Reply