The purpose of this essay is to spell out in detail exactly how a deal can be structured in the Erasmotron. Rather than discussing it at a general level as I have done so far, I shall work out a specific example, loosely based on Shattertown.
First, we need two sides of the deal, and both must be desirable. For one side, I shall posit the desirability of a weapon of greater power. That is, we presume that all characters always feel that more punch in weaponry is a good thing. On the other side of the deal should be some desirable service; let's suppose that it's "rough up somebody."
Our starting point is a character's desire to have somebody roughed up. It's a weakling desiring revenge against a stronger person. The weakling has just been shoved around by the bully, and the weakling is now contemplating his options for revenge. One of those options is the verb DealForRoughUp. He doesn't know what the deal might look like, or whom he might deal with, but on some general principle he decides to pursue this course. He stores the bully into CharacterObject1.
Now he's at DealForRoughUp. His options are all deals involving roughing up the bully: OfferWeaponForRoughUp, OfferMoneyForRoughUp, and their two demand versions: DemandRoughUpForWeapon, DemandRoughUpForMoney. The distinction between these two is simply the sequencing of the two parts of the deal. He has to make two decisions: whom to offer the deal to (the agent), and how much to offer. The first is easy: we use PickBestCharacter. The acceptability criterion will be the agent's capability to rough up the bully. The desirability will be the agent's willingness to do the deal, likely based on the agent's affection for the bully. The second half, the price, should be established by balancing the greed of agent against the distastefulness of the task. Here some care is required: we come up with a balancing formula, and then make certain to use the same formula in the agent's later decision to accept or reject the deal. The weakling thus comes up with a number that represents the agent's likely price, in some arbitrary units ("meta-dollars") for doing the job. This number is then used in the inclination formula for OfferWeaponForRoughUp by multiplying it by the agent's innate desire for weaponry &emdash; which could be treated as a constant or calculated from other personality traits. PickBestThing is used to find the weapon that the weakling will offer; it is stored in ThingObject1. Note that, if the weakling has no adequate weapon, the option will be poisoned and not chosen. The inclination formula for OfferMoneyForRoughUp multiplies the likely price by the agent's innate greed for money.
There are two more modifications to this scheme. First, the weakling must subtract his own innate desire for the offered things (weapon or money) in the inclination formulas. Hey, if the price is too high, I might not want to make the deal in the first place.
The second twist is that the weakling must assign slightly different inclinations for the two Demand deals as compared with the two Offer deals. The basis for this differentiation is trust: the weakling's trust in the agent's likelihood of carrying out the deal, and the agent's trust in the weakling should he be forced to trust the weakling: "Do I trust him more than he trusts me?" Basically, you just subtract Trust[Agent, Weakling] from Trust[Weakling, Agent] and add the result to the Demand deal and subtract it from the Offer deal.
OK, so the weakling has decided which of the four deals to make; now the action turns to the agent, who has three options: AcceptOfferWFR, RejectOfferWFR, or HaggleWFR. If the proposed deal was a demand instead of an offer, the agent would also have the option MakeItAnOffer, which translates to "Sure, if you do your part first." The inclination formulas for AcceptOfferWFR and RejectOfferWFR are straightforward considerations of the distastefulness of the giving side of the deal and the desirability of the taking side of the deal; they might look like this:
Inclination[AcceptOfferWFR] <= Greed * NumberObject1- Affection[Actor, CharacterObject1]
Inclination[RejectOfferWFR] <= Affection[Actor, CharacterObject1] - Greed * NumberObject1
Inclination[HaggleWFR] <= AbsoluteValue( Greed * NumberObject1 -
Affection[Actor, CharacterObject1] ) + 10;
This last formula says that, if the desirability and the distastefulness are closer to each other than 10, then we'll haggle.
Let's examine the complex issue of haggling first, and then move on the consummation of the deal. First, let me note that none of these verbs are generic: they cannot be applied to any proposed deal, but must be specific to this deal. I'll count up all the verbs required for a single deal towards the end of this essay. Of course, the inclination formulas presented above would lie in the DirObject's reaction to OfferWeaponForRoughUp, and as such would be specific to the deal. The weakling's options for HaggleWFR are the same as he had at DealForRoughUp, only the value of the thing or money must be goosed up a notch over the previous set of equations. The degree of goosing up can be determined by counting the number of times that he has gotten the haggle response in this thread. If the deal is goosed up too high, then the weakling might not make an offer, in which case he just walks away. However, let's assume that he comes back with another proposal, and that the agent accepts his proposal. We have a deal.
Let's suppose that the deal was an offer; the weakling must act first. His role requires him to transfer the weapon to the agent. He does so immediately; there is no dramatically interesting juncture here. Here's an interesting point: the agent does not react to the transfer of the weapon; instead, his part of the deal is activated in direct response to the verb AcceptOfferWFR, exactly parallel to the weakling's part of the deal. (btw, there must also be an AcceptDemandWFR verb for the case of demands.) The agent's role in response to AcceptOfferWFR gives him just a single option, with a preparation time set to something greater than the likely time it would take the weakling to fulfill his half of the deal: in this case, just a few minutes. That option will be called VerifyDealWFR, a mental state of the agent, with three options: FulfillDealWFR, RenegeDealWFR, and AbandonDealWFR. This last option is chosen only if a search of the historybook fails to discover the required weapon transfer; in other words, if the weakling didn't do his part of the deal, then the agent chucks the deal. You might even throw in a verb giving the agent the option to go back to the weakling and prod him to carry out his half of the deal; I'll skip that possibility for now.
The choice between FulfillDealWFR and RenegeDealWFR is simple, based on the integrity of the agent and his affection for the bully and the weakling. There might also be some biasing factor based on the likelihood that the weakling will discover the truth in the event of a renege. If RenegeDealWFR is chosen, that's the end of the thread, as far as agent is concerned. If FulfillDealWFR is chosen, then the agent's only option in reaction to FulfillDealWFR is RoughUp, which does the job. Note that CharacterObject1 had to be transferred down the entire line of events during this process.
Now, what happens if the agent reneges on the deal? The last design task is to provide a mechanism for the weakling to find out if the agent fulfilled his half of the deal, but this mechanism cannot be a sure thing. The difficulty here is the arbitrariness of the timing. Even if roughing up were a publicly knowable act, it is reasonable to think that the agent would need preparation time or appropriate circumstances. How is the weakling to decide when enough time has elapsed?
It seems to me that the way to do this is with a lookback verb that I will call VerifyFulfillmentWFR, which gives the weakling three options: AcknowledgeFulfillmentWFR, DemandFulfillmentWFR, and AccuseRenegeWFR. The inclination formula for these options are keyed on a historybook search for the fulfillment of the deal. We simply set VerifyFulfillmentWFR with a suitably long preparation time. The problem is, what sets up VerifyFulfillmentWFR? The answer here is that the weakling's verb for fulfilling his side of the deal must be specific to the deal; transferring the weapon is not done with a general-purpose verb like GiveWeapon &emdash; it must be done with a special-purpose verb that I'll call GiveWeaponWFR. The subject of this event (the weakling) has a role in response to it, whose only option is VerifyFulfillmentWFR. That sets up the verification process.
I will not go into the handling of the verbs that follow VerifyFulfillmentWFR; they could be generic, but their design seems obvious to me.
So let's summarize. What verbs are required for this one deal? The list is long:
DealForRoughUp
OfferWeaponForRoughUp OfferMoneyForRoughUp
DemandRoughUpForWeapon DemandRoughUpForMoney
AcceptOfferWFR AcceptOfferMFR
RejectOfferWFR RejectOfferMFR
HaggleWFR HaggleMFR
MakeItAnOfferWFR MakeItAnOfferMFR
GooseOfferWFR GooseOfferMFR
GooseDemandWFR GooseDemandMFR
GiveWeaponWFR GiveMoneyMFR
VerifyDealWFR VerifyDealMFR
FulfillDealWFR FulfillDealMFR
RenegeDealWFR RenegeDealMFR
AbandonDealWFR AbandonDealMFR
VerifyFulfillmentWFR VerifyFulfillmentMFR
AcknowledgeFulfillmentWFR AcknowledgeFulfillmentMFR
DemandFulfillmentWFR DemandFulfillmentMFR
AccuseRenegeWFR AccuseRenegeMFR
This adds up to 35 verbs. However, if we count only the single deal money for rough up, it comes to 18 verbs per deal. That's a lot, but remember that to make further deals, the storybuilder need only duplicate each of the 18 basic verbs and then modify the details such as inclination formulas and secondary objects. It would probably be one day's work per deal.
So there you have it.