Monday, November 18, 2013

Inform 7 Headaches

I love inform 7. But sometimes I want to bash its head in.

I'm writing a demo game for my new layered clothing extension where there's a shirt and pants rack, and I want the player to appropriately put the right piece of clothing on the right rack by being able to type in "put X on rack" without typing "put X on the pants rack".

This appears to be a simple enough with a "does the player mean" rule...

DOES THE PLAYER MEAN PUTTING SOME PANTS ON THE PANT RACK: IT IS LIKELY.
DOES THE PLAYER MEAN PUTTING A SHIRT ON THE SHIRT RACK: IT IS LIKELY.

Normally, you'd think that would solve the problem, but oh no. No matter how much I manipulated the rules, the parser popping up with a disambiguation error, unable to know the appropriate place to put clothes. It took me about half an hour to figure out what was going on.

What I found out later was -- the putting it on action actually parses backwards, and in order to disambiguate the second noun, it couldn't refer to the first noun (which hasn't been clarified yet). So, it's literally impossible to make Inform understand PUT PANTS ON RACK if there are more than two racks in the room. However, you can make Inform understand PUT PANTS ON PANTS, which is nice but something I very much doubt my players will try.

So, I've tried many things to solve this issue... a supply a missing second noun activity, new understand rules, other, more obscure solutions, but it just seems to be impossible without deep knowledge of I6's parser, something which I don't have. The only real solution at this point is to consolidate my two racks into one.

It almost makes me wish I was using TADS 3. TADS 3 has an amazing parser that is extremely good at discerning the player's meaning through the verify routine. The verify routine checks if it is logical to do something, and discerns disambiguation by whatever the verify routine returns. This means that TADS 3 has essentially integrated its check and disambiguation systems together... its rather elegant and I am envious of it. Inform 7 would do well to borrow this concept from TADS just as TADS borrowed scenes from Inform 7.

No comments:

Post a Comment