Epistemology

I am trying Eric Eve’s Epistemology in one of my games, along with the following definitions–

[code]Thinking about is an action applying to one visible thing.

Understand “think about [any thing]” as thinking about.
Understand “think about [any known thing]” as thinking about.

Report thinking about something unknown:
say “[no thoughts]”

Report thinking about something known:
say “[the thought of the noun][paragraph break]”

A thing has a text called thought. The thought of a thing is usually “You have no helpful thoughts about that right now.”

Pondering is an action applying to one topic.

Understand “think about [text]” as pondering.

Report pondering:
say “[no thoughts]”

To say no thoughts:
say “You have no helpful thoughts on that subject right now.”[/code]

I notice an oddity–if the player says something like–

think about clothing [while looking in his own closet]

The response might be something like–

think about clothing
(the pile of ladies’ wear)
You have no helpful thoughts on that subject right now.

That noun–the pile of ladies’ wear–does exist in the game–so I understand that it falls into the category of [any thing] in the Understand line above. But I can see that the player, whose character is male, might wonder if there actually is a pile of ladies’ wear in the closet.

I notice some other odd things also happen–if the player says something like –

think about tree

The response might be something like–

Which do you mean, the bunch of trees, the old oak tree, the few pine trees, the bunch of hedges, the huge old oak tree, the forest of trees, or the lone fir tree?

I note that I am adding the extension to an already-made game of over 150,000 words, that is probably part of my problem–so would you suggest that I do some major editing of my noun definitions (synonyms, etc), perhaps using a lot of ‘Does the player mean thinking about’ rules…?? And/or should I eliminate the ‘thinking about’ rules above (taken from the tutorial) and write my own??

Thanks a lot for any suggestions.

The only suggestion I might offer is that per Epistemology, I believe items are marked ‘known’ if the item has been in scope. It’s automatic. If I spent one turn in the kitchen where the breadbox is open, the loaf of bread inside is marked known whether the player examined it or even noticed it.

What you might want to do is write conditional text for the thought of items based on whether the item is ‘touchable’ and immediately interactable (or ‘carried’ or ‘worn’ as applicable) that reflects the message you want to convey.

The thought of the pile of ladies wear is "[if the pile of ladies wear is touchable]Wow, there's girly underpants in here, yo![otherwise]You wonder if you should steal one of Lisa's bras from that closet you were in earlier because you could probably MacGyver a wicked slingshot out of it.[end if]"
1 Like

Thanks, Hanon.

Question-- could [any known thing] be subsumed under [any thing], and if so, why would we need both Understand lines??

Thanks.

Both of those Understand phrases were included in the Epistemology example, so I’d assume they both need to be there. I don’t know the reasoning.

Having two understand lines will (I think) resolve only using known items if possible. That is, it will prefer known items to unknown ones. And, if more than one known item matches the player’s input, it will not list unknown ones in the disambiguation list. Disambiguation never crosses grammar lines.

(You can get the first effect with a DTPM rule, but not the second effect.)

Thanks guys.

So, the one with [any known thing], being the more specific, takes priority, and if there aren’t any known items that match, it defaults to the [any thing] line? I see.

Test that before you believe me.

Zarf–I’m sure you’re right. All of the items in the disamb lists above were ‘unknown’ at that point–the very beginning of the game, and the player had not been ‘outdoors’, also the ladies’ wear was the only thing which had ‘clothes’ as a synonym. And every time I tested ‘thinking’ on known items, it either zeroed-in on the correct item or less often there was a disamb of only known items.

I think what I might do is alter the disamb list, for the ‘thinking’ action–if it shows only unknown items, I may replace it with ‘Can you be more specific?’. Is this do-able??

Thanks for your help, guys!

How can I access the items on a disamb list, to determine whether they are all known or unknown?? In the latter case, I want to instead print ‘Can you be more specific?’ or to nix the activity and say ‘You don’t know anything helpful about that at this time.’

Thanks.

I think I’ve found something in the Recipe Book that might be helpful–apparently I’ll have to dabble a bit in I6 to find out whether the things on the disamb list (the parse list, as it’s called there) are known/unknown. Here’s what I have come up with–

[code]To say no thoughts:
say “You have no helpful thoughts on that subject right now.”

Definition: a direction is matched if it fits the parse list.
Definition: a room is matched if it fits the parse list.
Definition: a thing is matched if it fits the parse list.

Rule for asking which do you mean when everything matched is unknown:
say “[no thoughts]”.

To decide whether (N - an object) fits the parse list:
(- (FindInParseList({N})) -)

Include (-
[ FindInParseList obj i k marker;
marker = 0;
for (i=1 : i<=number_of_classes : i++) {
while (((match_classes–>marker) ~= i) && ((match_classes–>marker) ~= -i)) marker++;
k = match_list–>marker;
if (k==obj) rtrue;
}
rfalse;
];
-) [/code]

Will this do the trick?

Thanks!

Whoops–I’ll have to somehow work in ‘when thinking’ in the ‘Rule for asking…’ line…??

Okay I had to make some changes–is there any way this piece of code can fail??

[code]Thinking about is an action applying to one visible thing.

Understand “think about [any thing]” as thinking about.
Understand “think about [any known thing]” as thinking about.

Report thinking about something unknown:
say “[no thoughts]”

Report thinking about something known:
say “[the thought of the noun][paragraph break]”

A thing has a text called thought. The thought of a thing is usually “You have no helpful thoughts about that at this time.”

Pondering is an action applying to one topic.

Understand “think about [text]” as pondering.

Report pondering:
say “[no thoughts]”

To say no thoughts:
say “You have no helpful thoughts on that subject right now.”

Definition: a direction is matched if it fits the parse list.
Definition: a room is matched if it fits the parse list.
Definition: a thing is matched if it fits the parse list.

Rule for asking which do you mean when thinking about:
if everything matched is unknown:
say “[no thoughts]”.

To decide whether (N - an object) fits the parse list:
(- (FindInParseList({N})) -)

Include (-
[ FindInParseList obj i k marker;
marker = 0;
for (i=1 : i<=number_of_classes : i++) {
while (((match_classes–>marker) ~= i) && ((match_classes–>marker) ~= -i)) marker++;
k = match_list–>marker;
if (k==obj) rtrue;
}
rfalse;
];
-) [/code]

Thanks a lot!

I hate to bring up code speed when you’re still trying to make it work, but this looks like the slow way. “if everything matched is unknown” will compile to (I6 pseudocode):

count = 0;
for each object I in the game:
  for each entry E in parse_list:
    if I is E and I is unknown:
      increment count;
return whether count equals length of parse list;

Since you’re already writing I6 code, you can just write a loop that looks for known objects in the parse list:

[ AnyKnownInParseList i k marker; 
   marker = 0; 
   for (i=1 : i<=number_of_classes : i++) { 
   while (((match_classes-->marker) ~= i) && ((match_classes-->marker) ~= -i)) marker++; 
   k = match_list-->marker; 
   if ( GetEitherOrProperty(k, (+ known +) )) rtrue; 
   } 
   rfalse; 
]; 

(This compiles but I haven’t fully tested it.)

Really, it’s easier to rely on the original grammar distinction, which you’ve already got:

Understand “think about [any known thing]” as thinking about.
Understand “think about [any thing]” as thinking speculatively about.

Have separate actions; display a different parser error based on which action you get.

If you want to handle both actions with the same rules, you could set a global flag and then have one action redirect to the other. (Or, it’s tidier to have them both redirect to a third internal action.)

Thanks, Zarf, for the idea!

I’m just used to doing things the hard way.

This definitely works–

[code]Thinking about is an action applying to one visible thing.
Thinking speculatively about is an action applying to one thing.

Understand “think about [any thing]” as thinking speculatively about.
Understand “think about [any known thing]” as thinking about.

Rule for asking which do you mean when thinking speculatively about:
say “You have no helpful thoughts about that subject at this time.”;
stop the action.[/code]

Thanks!

I think Jon Ingold’s Disambiguation Control extension has facility for checking whether the disambiguation list consists only of a certain kind of action, HOWEVER I’m not positive it’s updated for the latest Inform (I may even be responsible for updating it now) and it also rips out and replaces a big chunk of the parser so if you’ve got something that’s working without it you might want to stick with that. The solution you have looks cool.

Thanks, Matt. Yeh, I think I’ll stick with my code.

But one more question, keeping Epistemology in mind–I am also consolidating my scenery items, putting like items together as a backdrop, and adjusting their responses and ‘printed names’ according to location, when needed, and also using ‘Understand’ to adjust what the player can refer to them as. For instance–a kitchen tap and a bathroom tap–they are both a backdrop called ‘sink tap’–the player can call it a bathroom tap when in the bathroom, a kitchen tap when in the kitchen, among other names which can be used for either one–“hot/cold/-- sink/-- tap”. This is all well and good, because most times they will be referred to only when the player is in the same room. But with ‘thinking about’, I find I cannot use ‘kitchen tap’ or ‘bathroom tap’ to refer to either one specifically when I am in other locations, because those terms can be used only in those specific locations(per ‘Understand “bathroom tap” as the sink tap when the location is New Bathroom.’ etc). I know this sounds like a minor point, it won’t affect game play very much, but how can I use ‘Understand’ to refer to the sink tap as a ‘bathroom tap’, for instance, when the player is ‘thinking about’ it elsewhere?? I don’t want the player to be able to refer to the sink tap as a ‘bathroom tap’ when he is actually in the kitchen. I want the player to be able to say ‘think about bathroom tap’ when not in the bathroom.

Just want to avoid awkwardness–although I won’t consolidate any scenery item that has important ‘thoughts’ connected to it or disappears or makes any difference to do with being ‘seen/familiar/known’.

Thanks.

Is there a reason you’re restricting the Understand to the specific location? Normal disambiguation for most commands (that don’t refer to “any thing”) should prefer an in-scope item automatically.

EDIT: Okay, I see you’re consolidating it into a background, but if you expect people to interact with and THINK ABOUT it, why isn’t it a scenery item in the respective bathroom? Using a background places it in scope everywhere, which seems to be causing your issue.

Instead of a catch-all backdrop, you might want to do a catch-all scenery item in each room.

Hanon,

The taps are already scenery items–that was just an example–I wanted to make them into one backdrop ‘sink tap’, in two rooms, and find out how to allow ‘thinking about’ for it, as a ‘bathroom tap’ and a ‘kitchen tap’, while for other actions, only those specific names can be used in their respective rooms. There are a number of other scenery items that I wanted to consolidate like that, under categories like ‘trees’, ‘grass’, ‘bushes’, etc, and allow thinking about them under similar terms. But maybe I am going off the deep end, here, and I should just leave them as they are–individual scenery items…?? I just wanted to bring down the number of scenery items that I have (there are over 150 scenery items in the game) but maybe that’s not really necessary…?? Perhaps I am nit-picking myself. Keeping them separate would certainly work for ‘thinking about’, especially as most of them would have the usual ‘You have no helpful thought about that right now.’

I’m not sure what you mean by ‘catch-all scenery item’–do you mean putting different things in one room together as one generic item, with an Understand line including the names of all of these items? A desk, its chair and bookcase could be one item, with responses (all, of course, rebuffs) according to the action taken–‘entering’ (‘Though you love pretending to be boss, this isn’t the time for it.’), searching(‘You find nothing interesting.’), taking (a book)(‘That holds no interest for you.’), etc, do I get the gist? This could be done.

Thanks for the input!