Fighting the map indexer…

It’s annoyingly difficult to make the map index do something that seems like it should be simple – move a room to a different “level”.

First of all, there are contradictory error messages. If you write something totally invalid like:

Index map with Harbour mapped around from Customs Office.

(Though in practice it’s more likely to come from a type, eg sout of.)
Then you get the following error:

Problem. You gave as a hint in map-making: ‘Harbour mapped around from Customs Office’. The map placement hint should either have the form ‘Index map with X mapped east of Y’ or ‘Index map with X mapped above/below Y’.

This clearly suggests that mapping “above” and “below” is supported. But if you write:

Index map with Harbour mapped below Customs Office.

You get the following error:

Problem. You gave as a hint in map-making: ‘Harbour mapped below Customs Office’. The direction given as a hint for map placement must be a lateral direction (not up, down, above, below, inside or outside).

Okay then! Why can’t you map below? I could understand not supporting inside, outside, or custom directions, but the index map is clearly 3-dimensional. Surely it should be able to handle requests to map one room above or below another. How is it any different from if you just wrote that Harbour is below Customs Office?

But it’s fine, I have some unreachable rooms needed for internal purposes, so I figured why not just add real map connections to them just to make the map index happy.

Up from Vault is Customs Office. Down from Customs Office is nowhere.
Index map with Harbour mapped east of Vault.

Well… this minimal case does actually work, but in my real project it insisted on putting the Vault on the same level as the room it was supposedly below, until I added an additional pair of assertions:

Down from Vault is Transitional Location. Up from Transitional Location is nowhere.

But whatever, one way or another at least it did manage to put the room on a separate level. Mind you, I do wish I could just write something like these instead (just a couple possible ways of wording it):

Index map with Harbour mapped in a separate area.
Index map with Harbour mapped apart from Customs Office.

And for that matter, exclude internal-use rooms from the map entirely:

Index map with Vault mapped nowhere.
Index map with Transitional Location mapped nowhere.

Or specify more complicated relations:

Index map with Blurr Avenue mapped south and southeast of Radio Tower.
Index map with Pierside Road mapped north and northeast and east of Radio Tower.

which I would expect to have an effect equivalent to:

temp-room1 is a room. temp-room2 is a room. temp-room3 is a room.
Index map with temp-room1 mapped south of Blurr Avenue.
Index map with Radio Tower mapped southeast of temp-room1.
Index map with temp-room2 mapped north of Radio Tower.
Index map with temp-room3 mapped northeast of temp-room2.
Index map with Pierside Road mapped east of temp-room3.

only without creating the extra temp-rooms. Or maybe even absolute positioning (this would create the same layout as the above example – the coordinates are based on the numbers you can see along the left and right sides of the map):

Index map with Blurr Avenue mapped on level 3 with coordinates 3&3.
Index map with Radio Tower mapped on level 3 with coordinates 2&1.
Index map with Pierside Road mapped on level 3 with coordinates 4&3.

And there could even be situations where it would be nice to be able to map the same room in multiple locations. I won’t provide a sample syntax for that though.

But again, I can deal with the layout even without the addition of those features. Anyway, the really fun part starts now. Since it’s a separate area but not technically “above” or “below” the main area, of course I’d want to change the subtitle.

Index map with subtitle of level -1 set to "A distant area".

According to the documentation, that’s supposed to make the index identify the level as “A distant area” instead of “Lower level” or “First level down”. Instead…

Problem. An internal error has occurred: can’t handle a null alias. The current sentence is ‘Understand “notify off” as switching score notification off’; the error was detected at line 204 of “inform7/runtime-module/Chapter 2/Emit.w”. This should never happen, and I am now halting in abject failure.

…the compiler gets really confused. Note that the specific sentence called out doesn’t seem to mean much – I had essentially the same problem in another old project when I updated to Inform 10. In that case (after commenting out gads of code) I identified the offending line as this:

Index map with title set to "Pinehurst Lodge" and subtitle of level -1 set to "Main floor" and subtitle of level 0 set to "Upper floor".

And the resulting error message was as follows (I just uncommented the above line and compiled again):

Problem. An internal error has occurred: can’t handle a null alias. The current sentence is ‘Understand “twelfth” as twelve’; the error was detected at line 204 of “inform7/runtime-module/Chapter 2/Emit.w”. This should never happen, and I am now halting in abject failure.

It does appear to be specific to the subtitle though… if I replace that assertion with:

Index map with title set to "Pinehurst Lodge".

then there’s no issue.

So I guess setting certain map index settings just doesn’t work in Inform 10.

3 Likes

Index map with subtitle of level -1 set to “A distant area”.

I would definitely report this as an error. I very briefly helped Graham Nelson sort through bugs a few years ago and this kind of bug was one of the higher priorities (weird, incorrect messages for a line of code that’s directly in the manuals).

I think the index mapping hasn’t been updated much over time because it’s very complex and still not very good at its job; it doesn’t even have an option to export to ready-to-use image formats. Other tools have arisen over time that people use much more. One of the most popular is trizbort:

Here’s an example of a (intentionally zoomed out and blurry) screenshot of a trizbort file someone sent me for one of my games:

(a zoom in detail):

Of course you’re right that more functionality would be nice, and you can submit that as well, but new feature requests were lower priority at the time I was helping, and few people use the index now anyway.

2 Likes

Mathbrush, no need to hide what game is… :wink:
(hiding spoilers, yes, but hiding what game is, and a major IF work, is somewhat unrealistic…)

Best regards from Italy,
dott. Piergiorgio.

Maybe if the goal were to create a map for release, that would be worth checking out, though I would greatly prefer a downloadable tool rather than a website.

I just want to the map to look roughly accurate for my debugging purposes though. I get that the creation of the index map is pretty complicated, but a statement to tell the indexer not to do its work for a specific room and just place it in a particular position (either absolute, or relative to something else) doesn’t seem like it would be all that complicated. (Mind you, that’s assuming the statements don’t add up to something physically impossible.)

And of course, there’s also a clear bug here where something that the docs claim should work not only doesn’t work but also gives an extremely unhelpful error message.

2 Likes