Numbered Disambiguation Choices (strikes) again (2025)

You’re right. I’ve done this and now it’s possible to do something like

GOTO BEDROOM (game presents a choice of 3)
1 (picks red. We go there)
GOTO 2 (Game now goes to whatever the second choice was.)

However, until choices are cleared (player types a sentence without a number), doing other things with numbers can produce weird results. When I say other things, I mean like

GET 2
or TOUCH 1
or even just 1

Now I do understand that we may say ‘The player is potentially being annoying typing commands like this, and so if they get a clunky error message, they deserve it.’ I agree.

Unfortunately, when the player does it, what can happen is the game tries to act on a random-seeming object as a result (sounds related to the thing Draconis was talking about e.g. GET 2 can try to take 2 of something, though in my WIP, the game never acts like that except in these post-disambiguation circumstances. Normally my game would say ‘I can’t see any such thing.’) and it will both name the object and print a silly-sounding clarification message. Here’s an example transcript from my WIP:

goto tracks

[ Which do you mean, (1) the tracks by the wedge, (2) the tracks on the highest ridge or (3) the tracks on the ridge?

1

(the tracks, last seen by the wedge)

By the wedge

1

[ What do you want to do something to the compass? ]

The player has a compass, but as you can see, it wasn’t mentioned by the player or the game prior to this clarification message.

Also unfortunately, I haven’t found an easy way to replicate this phenomenon outside my game. I mean I haven’t been able to work out the minimum circumstances needed in the demo project. I did do

The reset values when out of scope rule does nothing.

to make the demo more mimic my WIP.

I suppose a safe thing to do in my WIP would be to reset the disambiguation choices every single turn. The problem does really only seem to be with ‘1’. Doing a raw 2+ at such moments gives ‘You can’t use multiple objects with that verb’, which at least isn’t naming an object. But I’ll see if you @climbingstars have any other ideas. Thanks.

-Wade

I suspect there might be scope stuff going on there. Also, even when disambiguation is active, it doesn’t always do the disambiguation. This is so that actions with number tokens will work fine, while disambiguation is active. Also, are you using noun alone grammar lines? It might explain why just 1 on its own is causing issues. Are you getting scope issues for the other two?

Are you using any custom parser clarification rules and printing the name rules here? If you’re getting the clarification message when choosing the number 1, then disambiguation may be inactive at that point. Disambiguation is also reset when the I6 function Identical is called. This is so that identical items are not treated as if they are different. You can check when this happens by uncommenting the “Values Reset!“ line in the reset disambiguation values rule.

The extension doesn’t actually use raw numbers for that understanding of the numbers as I’ve come across the issues with 1 before and built the extension to handle this. So I suspect disambiguation may not be active here either. I could create a debug version of the extension that can print out key information about what’s going on underneath if that could help.

2 Likes

Thanks for all the analysis.

I think you’re probably right. When you said this, I looked at the scope rules in that chapter, and there are half a dozen of them with conditions (which add far things to scope). And, for instance, one of them places something in scope which was one of the things the game would ‘randomly’ (not really random, but you know what I mean :slight_smile: ) grab when producing these funny outputs.

I couldn’t find a noun-alone line, but I haven’t been exhaustive. There are close to 600k words of source and 33 extensions in play. I global-searched for text like ‘Understand "[’.. , and checked likely culprits like Small Kindnesses, but couldn’t see one.

Yeah, that particular issue is only happening with 1.

Thanks, that would be great. It’ll probably help me, and hopefully it can help you because this extension’s being tested in a complex project with lots of circumstances.

-Wade

I suspect you most likely will’ve a noun alone line if you’re using Aaron Reed’s extensions. I know one of them has it, but I can’t remember which one. The easiest way to check for this would be to compile it and type in a single noun in the game but without any verb. If you don’t get an error, then you’ve got a noun alone line somewhere! :smiley:

Here you go!

Custom Disambiguation Debug.i7x (25.9 KB)

It works best alongside the trace commands. Let me know if you need me to add any more debugging commands to it!:smiley:

Also, have you got a list of all the extension that you’re using? I can run them together and see it there’s any interference between custom disambiguation and the other extension.

One of the main differences between numbered disambiguation choices and custom disambiguation is that numbered disambiguation choices primarily tries to do everything at I7 level, using only I7 hooks to do what it needs to do, while custom disambiguation has no quibble dipping into I6 to get the job done! About half of custom disambiguation is done at the I6 level.

1 Like

The debugging has cleared up some things.

I do have a noun-alone action:

Understand "[thing]" as noun-naming when implicit-action is not the waiting action.

When I type ‘1’ on its own after some disambiguation options have been offered, the ‘1’ is being carried out as noun-naming. This can be seen with the debugging extension and TRACE on. Here’s the transcript I shared before but with the extra info on the lone ‘1’:

goto tracks

[ Which do you mean, (1) the tracks by the wedge, (2) the tracks on
the highest ridge or
(3) the tracks on the ridge?

>1

(the tracks, last seen by the wedge)

By the wedge

>1

>1
THERE WERE DISAMBIGS.

[Parsing for the verb 'no.verb' (1 lines)]
[line 0 * Routine(846054) noun=Routine(1274783) -> A169_noun_naming]
[line 1 * <illegal token number 2711620> noun -> <invalid action 768>]
[1]
[1]
[1]
[1]
[ What do you want to do something to the compass? ]

The ‘THERE WERE DISAMBIGS’ is my own debug message which tells us the disambiguation options are still known at this point.

As far as any subsequent ‘You can’t use multiple objects with that verb’ happening, they’re the result of my anwering the silly ‘What do you want to do something to the compass?’ question with another number (e.g. 2) and the result being the command ‘1 2’, parsed by noun-naming.

If I comment out noun-naming, the first 1 entered alone in the situation just says ‘I don’t know that verb’, as does ‘2’ or any bigger number.

The noun-naming doesn’t do anything 99% of the time, but is needed for some extra disambiguation code/situation-handling given me by otistdog.

I note the restricting clause on the noun-naming action (‘when implicit-action is not the waiting action’) isn’t stopping the action collecting the input. i.e. The noun-naming is catching these '1’s even though the implicit-action IS and has been the waiting action through all this.

-Wade

I’m noticing that there’s three “>1”s there. Only the first one would be part of the disambiguation process, unless these are debug outputs and not actual parser inputs. Although the last one looks like you’re entering a plain “1” as normal input.

That’s the normal behaviour for entering a plain number as normal input, assuming that “I don’t know that verb“ is your custom message for “That’s not a verb I recognise“.

Something is definitely going on here as the first “>1” should’ve output from custom disambiguation.

I’ve add some extra debug commands the extension that might help out.

Custom Disambiguation Debug.i7x (26.3 KB)

Can you run “actions on / rules on / trace 6 / goto tracks / 1 / trace 0 / rules off / actions off“ and see what output it gives? There will be a lot of output but hopefully it will help out. The two bits to look out for are “token resulted in re-parse request“ and the value of indef mode in “Scoring match list: indef mode 0 type 0, satisfying 0 requirements“.

1 Like

Yeah sorry, the middle 1 is a copy-paste error. I enter ‘1’ to pick the tracks, then I enter one more ‘1’ after getting there to see what happens.

I’ve run the situation with your updated debugger and recorded the output of the sequence:

GOTO TRACKS
1
1

To keep this output private, I’ve sent it to you as a PM.

-Wade

The output has given me a few ideas as to what’s going on here, but I should be able to address it using only what you’ve posted here.

Are the tracks implemented as duplicates with changing properties to make them different? It looks like the rule for this (the line directly above this in the output) is printing the name incorrectly. Also, is there some sort of epistemology going on here for the parser clarification messages? That would be what’s causing the last bit.

I believe the issue here is this line.

This should technically never happen. Do you still get this when you comment out the noun alone grammar line? Something’s definitely not right here. Might need more looking into.

1 Like

Heh, there’s a lot going on with the tracks, but the name is being printed correctly here.

The tracks are duplicate items of type player-tracks, distinguished by properties.

A player-tracks can be n-track.[means player tracks in this room can be seen north.]
A player-tracks can be s-track.[means player tracks in this room can be seen south, etc.]

Manually, I make sure there can never be more than one player-tracks in any room.

There’s an after printing the name of rule which adds a tracks’s location after the printout, but only while asking which do you mean.

The other thing is, I have a type of namedness called ‘preposition-named’. This means if the room is called ‘by the wedge’, it will say ‘the tracks by the wedge’, rather than ‘the tracks in by the wedge’.

Epistemology is used to determine whether the player can attempt to GO TO (THING). So if THING is known (seen or familiar), the player can try to go to it:

Understand "go to [any known thing]" as thing-approaching.

If I remove noun-naming, the illegal token does not happen. Instead, the final try of ‘the dark area’ goes to ‘That’s not a verb I recognise,’ like this:

[DSA on the dark area with reason = 0 p1 = 2286298 p2 = 2286330]
    Trying the dark area (2293626) at word 1
Parse_name called
Pass 1: 0 Pass 2: 0 Pass 3: 0
   [ND made 0 matches]
[ That's not a verb I recognise. ]

-Wade

Ooh, yeah, that’s not good. I have no idea where that illegal token would come from.

Perversely, as a non-mad-scientist, when I see this I pump my fist and say, ‘Yes! See, I didn’t drive the car into the wall! The car drove itself into the wall!’

-Wade

1 Like

Oh no—this goes beyond “something’s wrong at the I6 level” to “the I6 compiler shouldn’t be able to generate this”. Something is messed up in one of the parser’s internal data tables in a way that should never happen.

I have no idea at all how this would come about, except via a compiler bug or changing the tables at runtime! The “obvious” explanation is that the parser is looking at the wrong table (or the right table with the wrong offset), but the parser shouldn’t be capable of doing that.

Slight correction. My answer to this one should say, “No, these two are essentially the same check. I use the latter more as I believe it’s a faster check.“.

So, is this line working correctly in that case? I thought it wasn’t when you said this bit.

I’m guessing that was in reference to this line.

Are you able to isolate this line with a minimal test code such that you can post this here?

The best way to start with this would be to create a new project with all the extensions that you have in your WIP but with just the minimal tracks code that works fine without the extensions to see if this replicates the issue. That way we can see if the issue is coming from an extension or your source code or maybe even both. If this does replicate the issue, then we take out the extensions one by one to see whether the issue is there or not each time. If is doesn’t, then we’ll need to test out the source code. If you can a demo working such that you can post its source here, I should be able to figure out exactly what’s going on here.

This is normal behaviour. However, I suspect there’s more going on here than just this line.

Is there a way to SHOWVERB no.verb? I’m curious what’s going wrong in the grammar tables, but I don’t know any way to display them the way Inform is interpreting them.

EDIT: I started building a minimal example to try to reproduce the ‘illegal token’ error. But I found the presence of the three lines of noun-naming code will crash the project as soon as any unrecognised command is typed, so I didn’t reach the illegal token. This includes typing any raw numbers at moments when the game is not expecting a disambiguation value. The crash error is:

** Programming error: tried to write to -->38 in the array "line_ttype",
which has entries 0 up to 31 **
Glulxe fatal error: Memory access out of range (9A101)
Summary
"Crashtest"

Include 6M62 Patches by Friends of I7.
Include Custom Disambiguation Debug by Brent Worthington 6M62.

The implicit-action is initially the waiting action.
noun-naming is an action applying to one thing.
Understand "[thing]" as noun-naming when implicit-action is not the waiting action.

lab is a room.
lab2 is east of lab.
lab3 is east of lab2.
lab4 is east of lab3.

a player-tracks is a kind of thing.
one player-tracks is in lab.
one player-tracks is in lab2.
one player-tracks is in lab3.
one player-tracks is in lab4.
Understand "tracks" as a player-tracks.

a player-tracks can be aaa. Understand "aaa" as aaa.
a player-tracks can be bbb. Understand "bbb" as bbb.
a player-tracks can be ccc. Understand "ccc" as ccc.

Understand the aaa property as referring to a player-tracks.
Understand the bbb property as referring to a player-tracks.
Understand the ccc property as referring to a player-tracks.


When play begins:
	now a random player-tracks in lab is aaa;
	now a random player-tracks in lab2 is aaa;
	now a random player-tracks in lab2 is bbb;
	now a random player-tracks in lab3 is bbb;
	now a random player-tracks in lab3 is ccc;

approaching is an action applying to one visible thing.
Understand "go [any room]" as approaching.

thing-approaching is an action applying to one visible thing.
understand "go [any thing]" as thing-approaching.

Does the player mean thing-approaching something enclosed by the location:
	it is very unlikely;

Carry out approaching:
	say "You approach (GO TO) [the noun].";
	move player to the noun;

Carry out thing-approaching:
	say "You thing-approach [the noun].";
	move player to the location of the noun;

Test me with "go tracks/1/go tracks/2/2".

-Wade

1 Like