Overheard today in Moraf . . .

Gorun Iksa: On behalf of the Duke I would like to welcome you to moraf.
Gorun Iksa: If you are new here I suggest talking to the pig seller.
Gorun Iksa: He will tell you what you can do to help out.
Gorun Iksa: If you have decide you would like to settle here I can assign you some land
Gorun Iksa: but you will need to show that you are a useful citizen.
Gorun Iksa: If you can raise 50 coins herding pigs, then a plot of land is yours.
Rillan: tell me about pig
Gorun Iksa: You can buy pigs from the sty, and sell them to the butcher once you have helped them grow big enough.
Rillan: tell me the location of pig
Gorun Iksa: The location of pig is sty
Rillan: tell me the location of sty
Gorun Iksa: The location of sty is 27.179918 metres south west

This conversation is between Rillan, a character played by me, and Gorun Iksa, an NPC driven by the cyphesis AI engine. Read on for more, and an explanation of how it works.

Rillan: tell me about land
Gorun Iksa: When you have contributed to our settlement, you will be rewarded with some land.
Rillan: tell me about herding
Gorun Iksa: You can herd pigs in the forest where the oak trees grow.
Rillan: tell me about forest
Gorun Iksa: The forest is full of wolves and skeletons that are dangerous to your pigs. Be careful.
Rillan: tell me about wolf
Gorun Iksa: Wolves live in the forest, and will eat pigs if they can catch them. However they prefer ham if they can get it.
Rillan: tell me about skeleton
Gorun Iksa: It is said that the undead haunt the area round the ancient mausoleum nearby.
Rillan: tell me about mausoleum
Gorun Iksa: The mausoleum was here when we discovered these lands, and seems to be hundreds of years old. No one knows who built it.
Rillan: tell me the location of mausoleum
Gorun Iksa: The location of mausoleum is 197.294174 metres north west

There are basically two things going on above, both based on the same core mechanism in the AI code. Each NPC mind has a knowledge base which contains everything that NPC knows about. Each piece of knowledge is three bits of data, a subject, a predicate and a value. The natural language parsing code knows about the verb “tell”, and knows that it is followed by a predicate and an object, as in the sentence “Tell me the price of fish.”. The predicate here is “price” and the object is “fish”. Any NPC that hears a sentence of this form will check its knowledge base to see if it has any knowledge that applies to this pair, thus when I ask the question about fish, any NPC that has knowledge about the price of fish will resond with a sentence of the form “The price of fish is 5″. The sentence structure is generic.

The exception to this sentence structure is the “about” predicate for which the knowledge base is assumed to contain a complete sentence on the subject. Most of the questions in the above conversation relate to the about predicate, and the replies are the result of a whole bunch of knowledge I have put into Gorun’s knowledge base about many aspects of the world.

This code will be in the next release of cyphesis, and should start appearing on the test servers soon. Log on and see what you can find out. Gorun can usually be found standing on the east side of the pig sty.

Leave a Reply

You must be logged in to post a comment.


UA-925252-3