Text adventures; Blitz and the english language

Blitz3D Forums/Blitz3D Programming/Text adventures; Blitz and the english language

Simon S(Posted 2005) [#1]
I need someone with a better grasp of english than myself to do a bit of testing, if they have the time to spare.

I'm putting together a text adventure in Blitz and I intend to have a sidekick in it who you can order around. The code for this is all coming together nicely.

I've set it up so that the sidekick uses exactly the same bit of code as yourself to carry out his actions (i.e. the code for him to take items, is the same as the code for you take items).

The text in the game is written in the classic infocom first person style (i.e. You take the mushroom from the badger), but of course that won't make much sense for the game to give you the same text when the sidekick does this.

So I wrote a procedure to convert text from 1st to 3rd person, (he takes the mushroom from the badger) but there are a lot of odd rules within the english language, and I'm not certain I've expressed them in code as fully or effectively as possible.

I've hacked the procedure from the game into this little program. If anyone is up for it can you try and think of some 1st person prose that will cause it to return incorrect english. The results get written into "debuglog.txt" so just post any unusual results from that.

www.zen65317.zen.co.uk/simon/Test%201st%20to%203rd.zip

The Blitz code is also in there if anyone thinks they improve on what's there.

Feel free to use the existing code in the (unlikely) event it's of any use to you.

Anyway, thanks in advance.


dangerdave(Posted 2005) [#2]
some output:

Input: You'd thought it would take longer than it actually did.
Output: He'D thought it would take longer than it actually did.
-----
Input: you had thought his trees would be taller.
Output: he hads thought his trees would be taller.
-----
Input: you have three muffins left.
Output: he has three muffins left.
-----
Input: you were walking along the path when you hit your head on the tree branch
Output: he weres walking along the path when he hits his head on the tree branch
-----


Simon S(Posted 2005) [#3]
Cheers. I'm looking into the bizarre captilisation I've seen happening.

"he weres" shouldn't be an issue as the first person text will always be written in the present tense, but I fixed it anyway. And thanks to that I found that "You are" becomes "He ares", so that's fixed, along with had.

It's been a long time since I studied English so I no longer have a grasp of it's terminology. I suspect describing the text as first person isn't quite right. I also suspect english is a few rules with exceptions thrown into the mix.

But still, the more people who try it out, the more problems I can fix in advance.

Thanks Dangerdave.

update: New version posted.

www.zen65317.zen.co.uk/simon/Test%201st%20to%203rd.zip


GfK(Posted 2005) [#4]
Can't you just keep it simple by saying "Player 1 fondles the cunning whelk", "Player 2 fondles the cunning whelk" etc?

Substituting one name for another is going to be heap easier than fannying about trying to be more clever than any gamer is ever really going to appreciate.


fredborg(Posted 2005) [#5]
'You' is 2nd person isn't it? 'I' is 1st person.


Simon S(Posted 2005) [#6]
GFK: This is true, and is indeed exactly what I intended to do if this attempt fails.

Mostly I'm curious to see if it can be done, and let's face, even if it's a disaster it's only 150 lines of fairly simple select/case code.

Other than that I really do have a soft spot for the direct narrative of Infocom and the "Choose your own adventures." books. I find it draws me into interactive fiction far more quickly. A small point, and maybe even a view shared by only myself.

But it's not like i'm working to a deadline. I've made some improvements and put it into the game, it seems very effective so far, but I know there will be new phrases and language structures that will baffle it.

PS: Yep that sounds right Fredborg, I knew there were something up with the way I was referring to it. Last time I studied english was 10 years ago. :O


Craig Watson(Posted 2005) [#7]
You could store some extra data about the conjugates, the verbs and the subjects. What you'd then do is create a dictionary of the verbs and each equivalent. This dictionary may have some further use in your parser.

The dictionary may get rather large though with this method, as you'll probably find you need to store all the persons and all the tenses.

Infocom kinda did some hacky stuff like this, but generally the majority of words in the games were preset, with some allowances for lookups (all text the game output had to also be processed for display.) The real sneaky stuff with the Z-Machine was how the parser dictionary worked and how it was stored.. very clever stuff.

Easiest way is to obviously just follow Gfk's suggestion. Nobody is going to notice the difference anyway.