10 Nov 2006
My first job for an own approach to interactive Storytelling was a prototype for the User Interface. Chris Crawford suggested to use an inverse parser, and I liked the idea. A parser is a program that can tell if a sentence is valid for a given grammar. An inverse parser takes a part of a sentence and tells you what would be a valid way to go from there to build a valid sentence. That is of course a nice way to help users input sentences to a program that uses a grammar. My own picture of how to deliver that idea is that I plan to deliver the "game" over a web browser.

Here is a screenshot of the first prototype, using only a very simple language with very few words. But I think you get the idea.
On the left you see the menu with which you construct what you want to say or do. On the right is just a list of things you said or did.

The parser proposes optional next words as you type. You can also avoid typing and only select from the dropdown menu by using the mouse or cursor buttons.
If a complete sentence was entered, the input box turns green and the "say" button is activated. If you enter a letter so that your sentence will never be valid, the input box turns red.

Some technical details:
I'm learning to love Python as my favorite Programming Language. In addition, I thought that Prolog would be a great language to code the grammar in. I struggled hard to get Python, running on an Apache Webserver, to use Prolog via Pylog, an interface plugin between the two. It was too hard once I tried using it over the webserver. There are several independent processes talking to each other, one of them being the Apache Webserver, and it's much trouble.
I decided to write the whole parser myself, using Python and its Generator idea - for now, it works great.
The interaction with the parser on the way is using Ajax technology to create the auto-suggest-box (thanks to brandspankingnew for inspiration). I'll need to see how well that works with a big grammar, but the communication load will never be too big (I'll introduce a limit to the amount of suggestions that are send at once).
# lastedited 13 Nov 2006
You are seeing a selection of all entries on this page. See all there are.