Page 1 of 1

Dev seeks elementary advice on generic mapper

Posted: Mon Mar 08, 2021 4:25 pm
by brennanyoung
Hey there,
Just started using mudlet, and I am attempting to make sense of the generic mapping script. Need some very basic assistance.

First of all, I should point out that although I am a (self-taught) software developer with medium-length teeth, and a few decades coding experience, this is my first time using lua, and my first time using mudlet. I confess to finding the scripting/triggers/aliases mudlet UI extremely messy and confusing, and still haven't worked out some very, very basic features, but I am getting used to it gradually.

So... I understand that the generic mapper simply does not work "out of the box", and requires a little MUD-specific hacking to get up and running. This was not at all obvious from the docs.

Code: Select all

seems to be broken by design. By my perusal of the code it wont work unless it's already working. Quite a catch-22. The "help" for find prompt and map prompt make no sense to me at all, except to ask for help here, so that is what I am doing.

Next: I am attempting to map a very, very old MUD. Actually, the very first commercial MUD, called "Shades", from the late 1980s, if you're into retrogaming and MUD history, you may know it already. The game was heavily featured in the (superb) book "Cybergypsies" by Indra Sinha.

I assume that the primitive output of this ancient game is not working in my favour when using the generic mapper. It's plain ascii, with no color codes or anything like that. There is no obvious way of matching room names, or fishing exits out of descriptions, but I have a kind of plan for mapping Shades which I'd like to run by you guys:

The "look" command reliably returns the room name at the next line in the prompt. GOOD.
The "exits" command reliably returns all the exits from the room (multiline), with the exact name of the room they lead to.

I built a primitive alias which calls "look" followed by "exits" and gathers the name into a string, and the exit map into a Lua table. I made a tiny state machine to choreograph all this, and to prevent the triggers firing under "normal" play. So far, so good.

I've also been successful calling the built in mapper API to create a couple of rooms "manually", with hardcoded values in tiny lua scripts, but of course, this does not actually do any speedwalk tricks, which is kind of the point of building the map in mudlet.

What I am missing now is how to connect all these fragments together.

How do I call

Code: Select all

from my script so that it actually ... starts mapping? Should I be calling some other function?

Code: Select all

is local, so I can't access it from my alias. And in any case, I'd like the benefit of the automatic coordinate generation, because entering those by hand is not a nice prospect.

What is the point/purpose of the onNewLine trigger in the generic mapper? Should I be using this to build the map? How?

My plan is to wander around Shades calling my special alias in every room, and thereby build the map room by room, rather than try to work out how to trigger a map building script automatically. I think this should work ok, though it is a little tedious. Please advise about the wisdom of this approach.

Editing the map in the mudlet GUI is pretty horrible, tbh, but I know my way around regex in a text editor. Is it viable to build a rough map in mudlet, export it, then tweak the XML to tidy it? Then reimport? Wisdom of this?

Once my map is built, can I share it in a 'read-only' fashion with other Shades players?

Final question: Some of the rooms in Shades have duplicate names. This is very likely to screw up any automatic exit linking that looks up rooms by name. Is there a smart way to anticipate or handle this? I know they can have unique IDs and all that, so I am confident that mudlet can handle the finished result, I'm just wondering how to get there. I've seen a room merge call, but is there a 'room split'?

Thanks in advance for any assistance.

Re: Dev seeks elementary advice on generic mapper

Posted: Tue Mar 09, 2021 12:29 pm
by Vadi
Could you do `map debug` and show an output of how walking around the game looks like? With some triggers we can get it up and running for you.

Re: Dev seeks elementary advice on generic mapper

Posted: Tue Apr 06, 2021 7:36 pm
by SlySven
Also as a hand-editing tool we have recently added a (complete) JSON map exporter/importer to the Mudlet core functionality - it is certainly already present in the latest release version 4.11.2 so you can use it to hand edit a map if you need to...

(The XML importer by comparison is limited and there is not built-in {in the C++ core} exporter of that format - there might be some independently built Lua packages that will do it but I do not recall who has done one or how complete they might be.)