The hobbit: developing the parser

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Wall_Axe
Microbot
Posts: 175
Joined: Mon Nov 13, 2017 11:13 pm

Re: The hobbit: developing the parser

Post by Wall_Axe » Fri Apr 13, 2018 10:08 pm

this bit from the WL readme might interest some:
this is how the hobbit stores objects?

(7) - The Objects
=================
The object database is (beside the room and dictionary database) one of the
core items of the game. The following informations are stored for each object:

Object Number: the game's internal object reference number (NPCs are >= 60d).
Name: the object's full name (a noun and a maximum of two adjectives).
1L (first location): most objects do only appear in one location, which is
referenced here as room number (see game map). Some objectes (eg. doors) are
visible from more than one room, in this cases only the first room is
indicated.
# (number of): how many times the object appears in the game.
MO (mother object): if an object is carried or enclosed within another object
this object is referenced by its object number (or 0xFF if this is not the
case).
Vo (volume): the object's volume.
Ma (mass): the object's mass.
04 (property with offset +04): currently unknown
St (strength): the object's strength (eg. used in fighting)
06 (property with offset +06): currently unknown
Attributes (each object has 8 binary attributes associated with it):
v: visible
A: animal (otherwise it is an object)
o: open (otherwise it is closed)
*: gives light
b: broken (or dead for animals)
f: full
F: it is a fluid (water, wine)
l: locked
1 x

MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

Re: The hobbit: developing the parser

Post by MrPixel » Mon Apr 30, 2018 11:14 pm

interesting
0 x

hikoki
Manic Miner
Posts: 400
Joined: Thu Nov 16, 2017 10:54 am

Re: The hobbit: developing the parser

Post by hikoki » Thu May 03, 2018 10:09 am

MrPixel wrote:
Mon Apr 30, 2018 11:14 pm
interesting
even better playing it like a hangman or wheel of fortune :)
0 x

User avatar
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: The hobbit: developing the parser

Post by Nomad » Thu May 03, 2018 1:47 pm

I figure this was the only way you could practically do a Plotto style interactive fiction game/RPG on the spectrum.

https://www.brainpickings.org/2012/01/06/plotto/
0 x

MrPixel
Microbot
Posts: 170
Joined: Sat Mar 24, 2018 7:42 pm

Re: The hobbit: developing the parser

Post by MrPixel » Wed May 09, 2018 5:44 pm

how does that help? just curious
0 x

Ralf
Dynamite Dan
Posts: 1311
Joined: Mon Nov 13, 2017 11:59 am
Location: Poland

Re: The hobbit: developing the parser

Post by Ralf » Wed May 09, 2018 6:56 pm

I figure this was the only way you could practically do a Plotto style interactive fiction game/RPG on the spectrum.
how does that help? just curious
Yes, could you elaborate more on it?

I've read the text in the link and it's actually an interesting subject of building some system of classification for book plots. I recall the similar things were done for example for fairytales which often have common, recurring motifs.

But how does it relate to Hobbit and Zx Spectrum? ;)
0 x

User avatar
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: The hobbit: developing the parser

Post by Nomad » Wed May 09, 2018 7:10 pm

Ok that is a fair question.

The Hobbit encoded the data this way to be as compact as possible - this saved space but this made easy fan translations difficult (you are not looking for strings any more - you have to re-design the whole parser.)

Think of the advantages of creating a program this way - you tokenize whole parts of the sentence that you can re-assemble as you need. This enables you to pack a lot more data than you would have otherwise been able to with simple strings.

When you think about this technique, an obvious application is to use it for stuff like Plotto. To try and digitize plotto using standard string storage wouldn't work because it would take up way to much space even on a disk system. So what I am saying is probably the only way you could get a digitized version of plotto on the spectrum would be to use the same type of tokenizer/parser method that the hobbit used.

Now why would you want to do this - well as far as interactive fiction or RPG goes, Plotto can give you a very rich almost never ending set of story possibilities. Lots of TV shows and pulp stories were written with this method. Perry Mason is probably one of the best known examples. Others that have been suspected to use Plotto were many of the Perry Rhodan stories - how else do you write 30-50k words a fortnight for years without some sort of help like this? :lol:

I am not sure its been attempted on the spectrum, but what I am saying is by using the same technique that the hobbit used, you could at least come close.
0 x

Bizzley
Microbot
Posts: 124
Joined: Thu Nov 16, 2017 10:47 am

Re: The hobbit: developing the parser

Post by Bizzley » Wed May 09, 2018 8:26 pm

Nomad wrote:
Wed May 09, 2018 7:10 pm
Others that have been suspected to use Plotto were many of the Perry Rhodan stories - how else do you write 30-50k words a fortnight for years without some sort of help like this? :lol:
The Perry Rhodan stories were written by a team of rotating authors so it's no wonder they could come up stuff so quickly, but it's chicken-feed compared to the old pulp authors. Walter B.Gibson aka Maxwell Grant was reportedly knocking out 10,000 words a day single-handedly when he was writing his 280+ Shadow novels and that was in addition to his other book, comic and magic writing commitments. When you were paid by-the-word it was quantity not quality that mattered, an accusation that was often aimed at the pulps, but if Plotto is reponsible for the Rhodan works then it's not a good advertisement. As those of us who've managed to read more than a few of them or sat through the awful 'Mission Stardust' film can attest to.
2 x
"He made eloquent speeches to an audience consisting of a few depressed daffodil roots, and sometimes the cat from next door."

User avatar
Nomad
Manic Miner
Posts: 600
Joined: Thu Dec 28, 2017 12:38 pm

Re: The hobbit: developing the parser

Post by Nomad » Thu May 10, 2018 7:17 am

Yea you have a good point, the pulp writers knew how to not just write a lot but write stuff that they knew they could sell to the magazines. That is why I laugh when people complain they have writers block or talk about how they are warriors for writing 4k words over a weekend. I think to myself 'Dude, guys wrote 30k space operas in the same time period.. and they got paid.. then the next week write a western or war story..' :lol:

Still; I think Pixel is going out of his mind with this going off topic. :lol: So I will leave it.
0 x

User avatar
R-Tape
Site Admin
Posts: 2586
Joined: Thu Nov 09, 2017 11:46 am

Re: The hobbit: developing the parser

Post by R-Tape » Thu May 10, 2018 4:46 pm

Nomad wrote:
Thu May 10, 2018 7:17 am
That is why I laugh when people complain they have writers block or talk about how they are warriors for writing 4k words over a weekend. I think to myself 'Dude, guys wrote 30k space operas in the same time period.. and they got paid..
I heard a summary of writers' block recently that I quite liked, it was along the lines of “it’s not that you can’t write, it’s that you aren’t willing to write badly”. I never liked the often made comparison to other professions though – “e.g you don’t get Plumbers' block”, maybe it applies a bit for the total hackwork, but generally don't think creative stuff can be compared.

For the Spectrum, we have Automatic Muse, but there are much better ones on the web, I like this one.

(Writer's or Writers' block? Opted for the latter as it's an affliction of writers as a whole...)

(Slightly OT, sorry MrPix)
1 x

Post Reply