That's not a typo. I'm just using a random word generator to pick out the names for modules these days. I'm terrible about picking names for things, especially for a general purpose computing module. So for now I'm going to do an experiment where I just pick a randomly generated word. If I really hate it later, I can do a global search and replace.

Eostric will be an actor to actor interaction system which will parallel the interactions players have with actors in the simulation. Actors sometimes need a little prompting about what the important details are for an interaction, so part of Eostric is to document and publish information in a machine readable format. Unlike English (or some other human language), Eostric grammer is pretty strict. The verb is always the first token. There are no positional terms, following the verb is a key/value list if parts of speach, or arguments to a function.

Let's imagine two agents haggling at a market. In English the conversation between A and B would look like this:

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

Because English is spoken between two human beings, and human beings are really good at building mental models, filling in missing details, and filtering out extra details, most of us can sort of follow along.

A computer... not so much.

So Eostric is designed to allow otherwise unintelligent actors to follow a conversation. The first thing is that we have to tell the actors that they are starting a new conversation. So there will be an interaction between all actors that will a) get their attention and b) allocate a GUUID which will serve as a token for the two parties to keep track of what conversation they are having.

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

Once the line has been open, the two parties interact:

set reply [::eostric send $uuid $party_a negotiate {
  give {500 shekel}
  recieve {name {+10 Vorpal Sword of doom} count 1}
  recieve {name {Foodstuff +10} count 200}
}]

The reply would look like:

negotiate {
  recieve {550 shekel}
  give {name {+10 Vorpal Sword of doom} count 1}
  give {name {Foodstuff +10} count 200}
}

The rebuttle would be:

set reply [::eostric send $uuid $party_a negotiate {
  give {525 shekel}
  recieve {name {+10 Vorpal Sword of doom} count 1}
  recieve {name {Foodstuff +10} count 200}
}]

And the reply would be:

negotiate {
  recieve {550 shekel}
  give {name {+10 Vorpal Sword of doom} count 1}
  give {name {Foodstuff +10} count 200}
}

It is quite clear that the seller is firm on his/her price, so the buyer can either terminate the conversation (and abort the transaction) or submit an off that the seller has said they will accept.

set reply [::eostric send $uuid $party_a transfer {
  give {550 shekel}
  receive {name {+10 Vorpal Sword of doom} count 1}
  receive {name {Foodstuff +10} count 200}
}]

And the reply would be:

accept {}

When the accept is generated, the backend then transfers the 550 shekel from

party_a to party_b, and then also transfers the goods from the inventory of party_b to party_a. The party can also beam back reject.

The first question you might want to ask is "why go through this complexity?". Well for buying and selling, the concept that something has an fixed price is relatively new. Credit for the invention of the retail price tag is given to John Wanamaker, but they had been used by Quaker merchants for up to a century before he introduced them in his store. Up until the invention of the price tag, the price of goods was bargained out per transaction.

Bargaining is just one form of negotiation, and in a game involving wars, truces, alliances, betrothals, and all of the other trappings of civilized culture, negotiation is important to a) get right and b) bake into the game's mechanics.

In a perfect world, I suppose it would be good to also add some sort of emotion to this language. For instance, if party feels utterly insulted by a price offered, the other party can offer to apologize. Or double down. Or to communicate that they are completing the transaction, but feel they were cheated.

set reply [::eostric send $uuid $party_a purchase {
  give {550 shekel}
  receive {name {+10 Vorpal Sword of doom} count 1}
  receive {name {Foodstuff +10} count 200}
  emotion {cheated 10}
}]

So, that's my task for this week: develop a way for actors to buy and sell things. And then after I get that system working, to find a human-to-eostric <-> eostric-to-human interface. It'll probably be a combination of command line interactions and HTML forms.

I'm really starting to understand why Sumerians started writing this kind of stuff down. And truth be told, for every one tablet of literature we have in Cuneiform, there are probably a thousand tablets of contracts that read along the lines of: "Ached sells Bartholomew 10 goats for 20 jugs of beer and a whore to be named later."