Coders, how would you implement a tool to automap as you play i-f?

About 10 years ago, I put together a GUI for developing TADS i-f. Here it is, on the Way Back Machine.

Alas, like so many, it hit 95% complete, then fell by the wayside.

However, I am thinking of using some of the same functionality in a new app.

Basically, I want to save paper. As you explore, the app will draw what you know of the map, and passages between rooms. As you see items, it will add them to the map, take them, it will move them to inventory, drop them, it will add them back to the map.

Question #1: would such an app be useful, or do we prefer to write on paper?

Question #2: if so, does it already exist? I searched for it, but can’t find it.

Question #3: the biggy - how would you implement it? I see three possibilities.

  1. fork the TADS code

  2. ask the TADS developer to add hooks for utilities or plugins

  3. just tune the interpreter as-is and parse its output. This has the advantage of working with other systems, not just TADS, and the disadvantage of having to guess every synonym for “look” , plus “drop/discard/throw/chuck/eject/etc”

In broad terms, is the idea worth it, and how would you go about it?

4 Likes

The most popular mapper for IF is trizbort. It doesn’t do any game interaction like you describe, but it works with pretty much any IF interpreter because it gets its mapping data from the transcript files.

It comes in two flavors.
Offline: https://www.trizbort.com/
Online: http://trizbort.io/

5 Likes

The problem with Trizbort is that it’s written in C# and therefore only works on Windows. I have been using a tool called IFmapper, but that one is buggy and not really maintained any more. I would really love to see a reliable automapping tool that I could use on Linux.

5 Likes

You may want to check Strandgame’s Interactive Fiction Interface. It’s a GUI that can communicate with a backend engine through json messages. I’ve used it with XVAN to create a graphical user interface for XVAN. It also does draw the map, based on json messages sent after every turn. It’s available on Windows Linux and MacOS.

You do need to build json capabilities in your interpreter, though. I wrote mine in C.

4 Likes

Has anyone tried porting it with mono? I haven’t messed with mono too much, so I’m not sure how much extra work that would entail, but isn’t that the reason mono exists?

2 Likes

I have been successfully running trizbort on macos using wine, so it should work as well on linux.
It works only after installing dotnet with “winetricks dotnet46”

5 Likes

Woah, I just got Trizbort (1.5.9.9) running in Linux for the first time since about 2017. (That’s Linux Mint 20, for me.)

Previously, installing dotnet 4.x failed, even through Winetricks. Now it seems to be working again.

1 Like

I have never used it, and it isn’t for TADS, but https://github.com/dschwen/jszip has “automapping” support, see https://github.com/dschwen/jszip#automapping

2 Likes

Effectively, that is what I am thinking of - plus much, much more, as I don’t want to have to code an interpreter.

I can see how one could use a mapping tool to replace paper, as the others have mentioned, but that misses the “auto” part of auto-mapping, which I think would be a fun coding exercise.

If no one else has a TADS/cross language suggestion, then I might well go with suggestion #3 in my original question and intercept the output of command line interpreters, although I can foresee problems with that.

2 Likes

trizbort.io is implemented in JavaScript, but it doesn’t have the transcript parsing feature.

1 Like

A decade ago, I wrote a TADS authoring tool. Part of that was a map drawer. I have recently had the desire to create an auto mapper.

In my opinion, parsing game output is not the way to do it.

It’s easy to parse"go north", but there are limitless ways to move location. If you are lucky, the interpreter will always output the name of your location first. And the first time that it doesn’t, your automapper is fritzed.

Similarly, items can pop in and out of existence and inventory in limitless ways.

Also, both locations, objects and NPCs can be renamed mid game.

My idea is to make minimal mods to the interpreter code. If it is modular, there will be core routines to create, destroy, move and rename (CRUD, in database terms). Mod those to broadcast info to a socket and let plugins decide what to do with it, including automapping.

What do you think? I would really like to discuss this with someone.

I first thought of parsing transcripts, as it wouldn’t matter which interpreter is used, but, as I said, there are too many problems.

A core update to the heart of the popular interpreters would allow plugins to be interpreter agnostic.

1 Like

Z-code/Glulx interpreters are not structured on that level. There are such routines, but each game implements them separately. Moving and checking map connections can work differently from game to game; the interpreter doesn’t know what routines do what.

4 Likes

Thanks, Andrew. So, my idea of a plugin system, where the interpreter would inform plugins over raw sockets of changes to items, locations, etc is anon-starter?

1 Like

If the community could agree on some sort of standard file with minimal information about the map, such a map file could be included in for instance a blorb-file or zip-file. Should definitely be possible and a huge step for the community.

2 Likes

Especially when you have freaks like me who enjoy really messing with room and connection models, lol.

2 Likes

Alas, some maps change dynamically at run time, which would complicate things greatly

3 Likes

Is that different from including an image file called “map.png” and letting the player look at it?

3 Likes

I think so but my post could perhaps be misunderstood. I was thinking something like a text file specifying a grid, and the size and position of each location specified with coordinates and connections which the map-display uses to display only visited locations. It should also allow for more advanced details.

I know that auto-mapping is a feature of Trizbort but when I tried it on a slightly complicated map, I constantly had to modify the map to make it decent or make sense. By supplying a map-file, the map-display knows where to put locations relative to each other once the player has visited them etc. It may not be realistic that the map-display communicates with the interpreter but if the map-display combines the transcript and map-file it should be possible to have a really good auto-map quality compared to transcript only.

Auto-mapping may be regarded as a luxury but on the other hand, it should be possible to have something better than the auto-map feature in Trizbort and for all platforms including browser plays. I think there are some excellent auto-mapping in both Adrift and Quest but a standard could also be based on Trizbort, just more advanced when it comes to auto-mapping.

I know it would take a lot of work and there might be more important challenges for IF but I wouldn’t be surprised if mapping sometimes scares potential new parser players away from the medium if they bumped into a complicated map. Some love mapping games where others regard it as tedious but necessary.

I saw you started an interesting thread with plugins and it might be the way to go - I don’t know if it is realistic as I am not so much into programming. That was why I saw a map-file combined with reading a transcript as a strong possibility.

I am envisioning a tool for the author who decides on how the map will look. Then the tool can create the map file.

Theoretically, a map-file could consider “almost everything” but even if the specification does not account for all situations, the author decides completely how the map will look as they are supplying the map-file. So even if we can’t print a connection between two locations, the locations can be close to each other on the map if wanted and the map-display will show which location you are in, even if there are no lines connecting the locations. This would account for e.g. saying XYZZY and so on.

So if the specification of the map-file is not so advanced, you can just leave out connections in those special cases.

1 Like

In answer to the original question, I wouldn’t bother. However, I am an old-school adventure player and I enjoy drawing my own maps. It’s part of the adventure experience.

I know that modern players are downright lazy and they want everything presented to them on a plate. So how would you do that? I have no idea. If you were to build tools that allowed a map to be drawn as you go, then that would force authors to draw maps that make sense. How would it draw the mazes from ADVENT for example? It couldn’t.

I’m all for maps that are drawn in a geographically coherent manner, but authors are still producing maps that are damn near impossible to draw. In fact, just yesterday, I was drawing the map for ‘Sea Coral’ from the recent PunyJam #3. How would you automatically draw this? Note the combination of nautical directions, normal compass directions, enter/exit/board, up, down and twisty directions all over the place.

4 Likes