intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Jan 19, 2019 5:01 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Epistemology
PostPosted: Thu Jan 10, 2019 10:54 am 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 407
Whoops--I'll have to somehow work in 'when thinking' in the 'Rule for asking...' line....??


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Epistemology
PostPosted: Thu Jan 10, 2019 10:59 am 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 407
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;
];
-)


Thanks a lot!


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Epistemology
PostPosted: Thu Jan 10, 2019 11:18 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5884
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):

Code:
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:

Code:
[ 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.)


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Epistemology
PostPosted: Thu Jan 10, 2019 11:22 am 
Offline

Joined: Sat Jan 23, 2010 4:56 pm
Posts: 5884
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.)


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Epistemology
PostPosted: Thu Jan 10, 2019 12:00 pm 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 407
Thanks, Zarf, for the idea!

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


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Epistemology
PostPosted: Thu Jan 10, 2019 12:21 pm 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 407
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.


Thanks!


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Epistemology
PostPosted: Thu Jan 10, 2019 6:41 pm 
Offline

Joined: Tue Mar 09, 2010 2:34 pm
Posts: 5526
Location: Burlington, VT
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.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Epistemology
PostPosted: Fri Jan 11, 2019 6:55 am 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 407
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.


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Epistemology
PostPosted: Fri Jan 11, 2019 11:59 am 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2841
Location: US - Central
Quote:
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.')


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.

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: Epistemology
PostPosted: Fri Jan 11, 2019 12:49 pm 
Offline

Joined: Sat May 07, 2016 5:57 pm
Posts: 407
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!


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Eriorg, lft and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group