Author Topic: How to use Qualifying Adjectives with the parser?  (Read 36398 times)

0 Members and 1 Guest are viewing this topic.

Offline Cloudee1

Re: How to use Qualifying Adjectives with the parser?
« Reply #45 on: November 26, 2010, 11:57:04 AM »
If it workd, you should definately post that in the how to section
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #46 on: November 26, 2010, 01:13:29 PM »
Yeah, it works, but consumes all of the heap (or pretty close).  Found that out this morning.  I don't see how it possible, going from 20K heap size to 0 with that code.  I'm going to beat up on it more today...

EDIT:  Got it fixed.  Now utilizes minimal heap space (less than 1K). Who knows what the problem was.  Will post complete write-up in the how-to section soon
« Last Edit: November 26, 2010, 05:28:24 PM by gumby »
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline Cloudee1

Re: How to use Qualifying Adjectives with the parser?
« Reply #47 on: November 26, 2010, 05:38:22 PM »
...  Got it fixed.  Now utilizes minimal heap space (less than 1K). Who knows what the problem was.  Will post complete write-up in the how-to section soon

Sweet, that's about what the guage script costs to run.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline MusicallyInspired

Re: How to use Qualifying Adjectives with the parser?
« Reply #48 on: November 26, 2010, 05:44:24 PM »
Nice! I need to find time to implement this...
Brass Lantern Prop Competition

Offline Cloudee1

Re: How to use Qualifying Adjectives with the parser?
« Reply #49 on: November 27, 2010, 03:18:05 PM »
Very nice tutorial indeed. I see you've got some of your check actor code in there. Now if we can get Brandon, or was it you, that figured out the gold/silver key syntax to stick it in there quick, the two topics will always show up together. 
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #50 on: November 27, 2010, 03:42:09 PM »
Very nice tutorial indeed. I see you've got some of your check actor code in there. Now if we can get Brandon, or was it you, that figured out the gold/silver key syntax to stick it in there quick, the two topics will always show up together. 
Whoops!  I didn't mean to have the actor stuff in there.  I'm going to do another how-to for that.  I'll throw in the stuff about the keys too...
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #51 on: November 30, 2010, 10:10:40 PM »
I just love it.  After I have a solution to this problem, I can't still can't let it go.  It is solvable without any special code...

Code: [Select]
    (if(Said('take/goodies<basket<of'))
       Print("You got the goodies basket!")
    )

Here is how the vocab needs to be defined:
basket - noun
goodies - noun
of - preposition & noun

There are a few tricky things I ran into.  Leave both 'basket' and 'goodies' as nouns.   You can (optionally) make the 'basket' an adjective, but don't make 'goodies' an adjective.  Then you have to make 'of' a noun (you can leave it a preposition).

I figured this out through a brute-force technique.  I was able to get 'take/goodies<basket' working first (just like the other example 'take/key<gold') then started inserting 'of' at all possible positions in the string.  When I exhausted all possible combinations, started changing the word classes.

We desperately need some deep working knowledge of the parser dumped into a how-to.  I mean all possible combination of said string examples possible.  Nobody should ever have to figure this stuff out on their own.  Not like this.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: How to use Qualifying Adjectives with the parser?
« Reply #52 on: December 01, 2010, 12:07:58 AM »
Dear God, YES. Absolutely ridiculous. If there's one thing about SCI0 game development that needed to be thoroughly documents from day one it's the parser. So cool that you figured it out, though (somewhat)! It's just too bad that "Take goodies basket" can't also work. You'd think that since "of" is a proposition that it would automatically accept "Take basket of goodies" as an alternative to "Take goodies basket". In the same way, it should also accept "Take basket with goodies" since with is also a preposition and it still makes sense. Maybe it's a bug in the implementation. I guess we won't really know until someone reverse engineers or decrypts a game script from an existing Sierra game.
Brass Lantern Prop Competition

Online Collector

Re: How to use Qualifying Adjectives with the parser?
« Reply #53 on: December 01, 2010, 01:02:29 AM »
Too bad that we couldn't ask one of the old Sierra developers for input. Scott Murphy can be contacted on Facebook, but he would probably be too keen about it.
KQII Remake Pic

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #54 on: December 01, 2010, 07:55:41 AM »
I have half a mind to write a utility that allows you to enter an input string, specify what (ideally) you would like the word class of each word to be, and it would try every possible permutation of said strings, shuffling tokens around until it would be able to parse the input string.  And the result would be the syntax of the said string.

This feels like all sorts of laziness to me.  Not from a development standpoint, but an unwillingness on my part to fully understand the parser front-to-back.  However, I'm not sure that I care.  Do I want to be spending my time messing with trying to get the parser to take my input, or do I want to be working on more rewarding game-development endeavors?

Rant complete.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #55 on: December 01, 2010, 12:21:30 PM »
I have half a mind to write a utility that allows you to enter an input string, specify what (ideally) you would like the word class of each word to be, and it would try every possible permutation of said strings, shuffling tokens around until it would be able to parse the input string.  And the result would be the syntax of the said string.

Oh yeah, it's on.  I've already started coding this.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #56 on: December 01, 2010, 10:04:57 PM »
It's just too bad that "Take goodies basket" can't also work. You'd think that since "of" is a proposition that it would automatically accept "Take basket of goodies" as an alternative to "Take goodies basket". In the same way, it should also accept "Take basket with goodies" since with is also a preposition and it still makes sense.

The tool I'm developing is already paying off.

All your examples solved with 'normal' (if one can call it that...) parsing.  First, set up the vocab:

  with - preposition
  of - preposition & noun
  basket - noun
  goodies - noun

Code: [Select]
// responds to 'take basket of goodies'
(if(Said('take/goodies<basket<of'))
    Print("take/goodies<basket/of")
)

// responds to 'take goodies basket'
(if(Said('take/basket<goodies'))
    Print("take/basket<goodies")
)

// responds to 'take basket with goodies'
(if(Said('take<with/basket/goodies'))
    Print("take<with/basket/goodies")
)

And my favorite one that I was originally testing with:
Code: [Select]
// responds to 'take large sword from troll'
(if(Said('take<from/sword<large/troll'))
    Print("take<from/sword<large/troll")
)

I don't think I ever would have figured that one out.  I just don't find it intuitive.  It had 24 permutations & worked on the first try.  I can't wait until we have a library of examples documented.

The pattern I see emerging is that prepositions are 'semantically applied' to verbs & adjectives (and nouns) are 'semantically applied' to other nouns.  We'll get this figured out yet.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline MusicallyInspired

Re: How to use Qualifying Adjectives with the parser?
« Reply #57 on: December 01, 2010, 11:41:29 PM »
Niiiice.
Brass Lantern Prop Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #58 on: December 02, 2010, 08:06:12 AM »
Now that I reflect upon it, the whole idea of a 'complex noun' falls apart (except perhaps from a Said() string simplification).  It sure appears that a complex noun can be accomplished by linking multiple nouns together with the semantic reference  The part we were missing was just making the individual words all nouns.

I'll update the how-to.
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition

Offline gumby

Re: How to use Qualifying Adjectives with the parser?
« Reply #59 on: December 02, 2010, 10:25:24 PM »
Okay, the app is completed.  It accepts a user input string of 5 words or less (I wish it could be more, but 5 words creates 240 different said() strings - 6 words creates 1800 - heap space gone).  It will output a rm001 script, which can be copied into a fresh template game, and run.  When run, the user inputs the same input string they specified with the utility, and the correct said() string syntax is printed to the screen.  Pretty cool.

But I'm still not satisfied.  I just realized after completing this that it is simply the beginning of another application.  After we figure out the parser, the next application will accept any length user input and will output the correct said() string (without the parsers' help) straight out of the command line app.

I've uploaded it to mediafire (it will live here soon...).
http://www.mediafire.com/?9xlq64vquvb8c5v
In the Great Underground Empire (Zork port in development)
Winter Break 2012 Rope Prop Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.028 seconds with 22 queries.