Days ago I set off to try to discover the roots of human language by studying Ancient Sumerian. I was hoping to get a glimpse of the most fundamental elements of human thought. But alas, their system was every bit as complex as our own. Without the physical experience of being human, and an encyclopedic reference of proper nouns and historical events, a machine would be every bit as lost deciphering Cuneiform as modern English.

Some interesting finds. For instance from the base symbol zú (𒍪), which means "teeth". When combined with other symbols makes a compound word:

zú...kud/ku5to bite
zú-gublunch ('teeth' + 'to stand')
zú...li9-li9to laugh ('teeth' + 'to glisten')
zú...ra-aþto devour ('teeth' + 'to strike repetitively, shake')

On one hand, yes, Sumerian does make a decent first cut at elemental concepts. On the other, the combination of those ideas into more complex ideas is really non-intuitive. There are rules, but they basically amount to "This is the standard we came up with. Deal with it." (English has its fair share of that, as does every other language in existence.)

For grins I started looking into Chinese, and found the same sorts of complex and non-intuitive combinations of seemingly simple characters into complex ideas:

fake | false | artificial | to borrow | if | suppose
病假sick leave
產假maternity leave
度假go on vacation
放假to have a holiday or vacation
寒假winter vacation
假的(adj) bogus | ersatz | fake | mock | phoney
假定to assume | to suppose
假髮a wig

I realize there is a rhyme and rhythm to how one goes from "fake hair" to wig. But "cold/poor borrow/fake/suppose" to "Winter Vacation" requires a bit more of a cultural adjustment to my thinking.

The long and short of it is, I'm not going to find a golden table of linguistic shortcuts to help put Eostric together. I'm going to have to brute force analyze what concepts my specific application needs to represent, decompose them into elementals, and work out a notationally satisfying way to combine those elementals into thought.

I can get some inspiration from existing human languages, but not a complete solution. And any solutions I get from a specific language is going to have a lot of cultural and/or biological assumptions baked in. In a way that is liberating, because I know I'm not going off and defying (or worse simply reinventing) an existing knowledge base. On the other, it took mankind thousands of years to assemble the dictionary. I don't think a general purpose application of this methodology could be completed in a human lifetime.

But I'm not going for a general purpose, fortunately. I'm just trying to write a game! So let's get back to our bartering example:

A: I'll give you 500 shekel for that +10 Vorpal Sword of doom,
and for 200 of those Foodstuff +10 thingies.

B: 550 and you have a deal

A: 525?

B: 550

A: Sold

In my original post, the beginning of the converstation (on a machine level) would be the formation of an interaction UUID, to track the thread of the conversation. That is still a good idea.

# Open a line of communication
set uuid [::eostric start $party_a $party_b]

This act is simply the process of A getting B's attention.

Having spent the holidays conversing with real people, I'm remembering now that humans don't just walk up to one another and start blurting ideas at one another. We have a conversation first to discuss what a conversation may be about. A conversation may go off on tangents, but that's the joy of it. The conversation above is the equivilent of someone yelling "Give me this thing" and waving money. It would be considered highly rude. (And Rude comes to use from the Latin rudis for rough, crude, unlearned.)

There has to be a little story telling and exposition before discussing an act. Odds are before the converstation started, either the patron or the seller talked about something trivial. "This is a nice shop." or "You have the look of an adventurer about you." Some sort of recognition of the role each is to play in the later conversation about money and goods changing hands. If someone does walk up and start blurting out an order for something, it's generally within the confines of an established relationship. A stock broker, for instance. And only where time is at a premium, there is an established vocabulary of terms, and a limited variety of actions to perform.

Some might point out the rather mechanical interactions humans have at, say, the grocery checkout. Or when ordering fast food. But I would ask you to replay in our minds what was discussed between yourself and the teller before and after the merchant transaction. Even the mechanical "scan-it-yourself" station tries to enter into a conversation with you! It welcomes you to the station. It explains the process as you go. It asks you for your frequent-shopper code. (Remember what I was saying about an established relationship?) Those interactions are terse and perfunctory, but they are still there.

Getting back on topic, our actors will need some sort of conversation starter to set the stage of the interaction.

set reply [::eostric send $uuid $party_a negotiate {
interaction_begin barter buyer $party_a seller $party_b}

This command uses a command "interaction_begin" that, within the confines of a conversation, marks the beginning of the converstation. Our computers, not being very loquacious, do get directly to the point of things. But first they announce their intent.

The reply would look like:

ok {}

The response code is needed, because an agent may try to initiate a barter interaction with a game object that is unable or unwilling to barter.

Thusfar both parties now understand that are engaged in a conversation, and that conversation is about bartering, and the person doing the purchasing as person a and the person doing the selling in person b.

Now, at a modern super market, we humans have a system of allowing patrons to peruse around the store and pick out merchandise, walk around the store with that merchandise in a cart until purchase, and finally pull those items out of the cart at the counter to announce our intent to purchase those things. We bargain prices down with little slips of paper (coupons), that are presented at the time of sale. Those represent what concession to price the seller is willing to make. And finally we present a little token of plastic (credit card), or more slips of paper (cash) as legal tender the buyer can in turn exchange for something else. (Namely more things to stock the store with.)

This modern market works with the help of a lot of training and repetition on the part of everyone involved. We may not be aware that this system is completely artificial, or even what the rules would be if we tried to write them down. But it's a system of bargaining that is mainly present to minimize time and expense for both the buyer and the seller.

Sadly, we don't know a lot about how buying and selling was conducted in the ancient world. We can go to places where we think they still do business the the ancient ways, but really the marketplace itself is old. Not the way of doing business. At Trajan's Market, arguably the world's first shopping mall built in the 1st century AD, there is evidence that customers still came to a window for service, rather than actually enter the store. So we don't have shopping carts quite yet. And Trajan's Market itself was simply the logical development if a more ancient concept, the Bazaar.

While patrons may have been able to take things off of the shelves, and interact with them pre-purchase, I can imagine that a lot of interaction were similar to a modern deli counter. You come to a window, you state what (and how much) you wish to purchase. Work out a what the merchant wants in exchange, and then depart with your newly gotten gains.

The begin {interaction barter} line encompasses the "take a number", and waiting in line. We are up to placing an order. And in fact, let us assume from here on out that a seller in a barter interaction places an order.

begin order
  add {item {+10 Vorpal Sword of doom} count 1}
  add {item {Prepackaged Foodstuff +10} count 200}
  add {item {Wheat} quantity {1 assload}}
end order
begin offer
  add {item {silver} quantity {550 shekel}}
end offer
solicit reply

I'm adding a third item to our shopping list, just to show that our new language can handle countable and non countable items. But you see that I still have the bias that there is an action. Every line starts with a verb. But every verb has a direct object. If I need to translate this to human, it's just switching things around a little bit (which is still a lot less switching than, say, from one form of human speech to another.) Also note that our unit of currency has switched from assuming some sort of countable coinage to an uncountable quantity of silver. That is because, even in coin form, in a barter system that coin is just a measure of weight of a precious metal. The name shekel refers to the weight. Not the coin, nor the material the coin was made from, or the relative value of the coin. One could have a shekel of virtually anything.

Now there is another subtle change from my last notation attempt. See that instead of GIVE and TAKE, the notation is describing two objects. One is an order, the other is an offer. They are structured identically. But they represent place holders in a logical model in both the buyer and seller's mind. Also, the behaviors of both the buyer and seller are looking for these two objects to be defined and agreed upon before the sale is made.

The solicit directive is an indicator that the seller will stop streaming data and wishes to get the reaction of the other party. We humans have both verbal and non-verbal cues for when parts of a conversation begin and end. Computers need a little help in that department.

If the buyer likes the arrangement, he or she would reply with:

agree true

But on our case, our Merchant doesn't think the offer is equal to the order, and wants to balance the transaction.

agree false
replace offer
  add {item {silver} quantity {550 shekel}}
end offer
solicit reply

Here is the merchant not agreeing to the original sale, and replacing the offer portion with what he or she believes is a fairer deal. The buyer can agree to the new terms, cancel the transaction, or alter the deal again.

agree false
replace offer
  add {item {silver} quantity {525 shekel}}
end offer
solicit reply

You will also note that in this new structure, it doesn't really matter which side of the conversation is speaking. The structure is the same. None of the swap verbs nonsense that was going on before. Our merchant considers the new offer. And rejects it.

agree false
replace offer
  add {item {silver} quantity {550 shekel}}
end offer
solicit reply

So it is clear, they are not budging on the price. So our hero can either accept the deal, or walk away. They chose to accept the deal.

agree true

And at the interaction_complete the two parties will swap the agreed upon items. An interaction_cancel would have aborted the interaction, but left the conversation open. And for the purposes of allowing truly complex negotiations, I could see instituting a stack based architecture to manage nested interactions.

A stack is a construct by which the last item in is the first item out. Like a stack of pancakes. The next pancake to come off of the stack is the last pancake that was placed on the stack. (In computer nerd LIFO - Last in First Out).

Time for me to get back to contemplating. I think I'm getting closer and closer to something that can actually be implemented. And in less than a human lifetime.