Disambiguation Woes

Okay, so this is driving me nuts.

In my game I’ve got code similar to the below:

The church is a room.

A red candle and a blue candle are in the church.
A candlestick is a container in the church.

Does the player mean inserting the red candle into something: it is very unlikely.
Does the player mean inserting the blue candle into something: it is very likely.

Now, if I post the code I’ve used into a new game, it compiles and works as it should. Typing “put candle in candlestick” produces:

>put candle in candlestick
(the blue candle in the candlestick)
(first taking the blue candle)
You put the blue candle into the candlestick.

However, in my 48819-word IFComp game, the disambiguation code does nothing, and you get the equivalent of:

Which do you mean, the red candle or the blue candle?

Obviously I can’t post all 48819 words into this forum, so my question is, what should I be looking for in my source text that throws off the the “does the player mean” code? Are there any known factors? Has anyone else had this problem and solved it and can remember what they did?

Thanks! I don’t have any hair to tear out, but if I did, I’d be doing it.

1 Like

Okay, this gets weirder.

If I add another object into the game, let’s say a trashcan, and include the line:

Instead of inserting something into the trashcan:
	try inserting the noun into the candlestick instead.

Now I get the following:

>put candle in candlestick
Which do you mean, the red candle or the blue candle?

>put candle in trashcan
(the blue candle in the trashcan)
You put the blue candle into the candlestick.

Why is the disambiguation working when the instead rule fires, but not when the player specifies the candlestick? This makes no sense to me.

Disambiguation happens when:

  1. the command text matches multiple objects
  2. the inference scoring for each of those objects is the same

The DTPM rules you mentioned should be keeping #2 from being true.

You can turn on heavy tracing with >TRACE 4 and see how the parser comes to the conclusion that disambiguation is necessary.

2 Likes

I keep this post by @Draconis bookmarked. Maybe something here will be useful…

4 Likes

Possibly a different DTPM rule which produces a “very likely” or “very unlikely” outcome for both actions?

1 Like

Thanks to both of you.

The inference scoring for both objects is close but not exactly the same. Looking at @Draconis’s post, it looks as though whether the object is held is a big factor, so I’m tempted to have the player discard the incorrect object as soon as they have the other one. It’s actually not candles but cutting a small piece off of something, so this would kind of make sense.

Oddly I commented out the “instead” rule above, ran the game, uncommented it and ran it again, and the disambiguation no longer works for “put candle in trashcan”. AFIAK I made no other changes to the game, which is baffling.

1 Like

I do have another set of DTPM rules for the same set of two objects, different verb, but commenting those out makes no difference. I’ll go through the game and comment out all the DTPM rules except for the insertion ones and see if I can track it down…

EDIT: I commented out all of the DTPM rules except for the insertion ones, and it made no difference. So it’s not that. :face_with_spiral_eyes:

Thanks all. I couldn’t get the disambiguation to favour the object I wanted, but I have come up with a solution that works in storytelling terms and removes the problem. :slight_smile:

3 Likes

You may feel you don’t want to waste any more time on this, but I have an enhanced parser tracing module I could send you if you wished to investigate further what’s going on.

1 Like

I’d be grateful for any help Peter, thank you! That sounds interesting.

I doubt greatly there’s any direct relation, but this resembles the inverse of the bug described in:

This code:

Shrine is a room. A blue pedestal is in Shrine. A bust of Venus is on the blue pedestal. A red pedestal is in Shrine. A bust of Cupid is on the red pedestal.

test basic with "take cupid from pedestal/take venus from pedestal/red/take venus from pedestal/blue".

test bust with "take bust from pedestal/red/i".

test me with "test basic/put venus on blue pedestal/test bust/put cupid on red pedestal/test basic/put venus on blue pedestal/test bust".

produces

lengthy output

(Testing.)

[1] test basic
(Testing.)

[2] take cupid from pedestal
You can’t see any such thing.

[3] take venus from pedestal
Which do you mean, the blue pedestal or the red pedestal?

[4] red
You can’t see any such thing.

[5] take venus from pedestal
Which do you mean, the blue pedestal or the red pedestal?

[6] blue
Taken.

[7] put venus on blue pedestal
You put the bust of Venus on the blue pedestal.

[8] test bust
(Testing.)

[9] take bust from pedestal
Which do you mean, the blue pedestal or the red pedestal?

[10] red
Taken.

[11] i
You are carrying:
a bust of Cupid

[12] put cupid on red pedestal
You put the bust of Cupid on the red pedestal.

[13] test basic
(Testing.)

[14] take cupid from pedestal
You can’t see any such thing.

[15] take venus from pedestal
Which do you mean, the blue pedestal or the red pedestal?

[16] red
You can’t see any such thing.

[17] take venus from pedestal
Which do you mean, the blue pedestal or the red pedestal?

[18] blue
Taken.

[19] put venus on blue pedestal
You put the bust of Venus on the blue pedestal.

[20] test bust
(Testing.)

[21] take bust from pedestal
Which do you mean, the blue pedestal or the red pedestal?

[22] red
Taken.

[23] i
You are carrying:
a bust of Cupid

(It’s I7-1944.)

1 Like