## Dream Combat AI

I have gotten the basic deal-making operational, and now the time has come to start with dream combat. I have already set up the verbs for initiating dream combat; now I must address the most crucial issue in the entire storyworld: how does an actor decide upon the auragon to use? Two factors contribute to this decision: his estimate of the other actor’s auragon set, and his assessment of his own auragon set. The way these two factors interact is rather tricky.

On the one hand, your simplest strategy is to select the auragon for which you have the highest count. But this fails to take advantage of what you know about the other actor. You should attack him with your auragon that is upstream from his smallest auragon count. But these two auragons (your best attacking auragon and your auragon upstream from his worst defening auragon) will not likely be the same. So you must calculate the reward values for every auragon pair.

My first approximation of the reward function for a given choice of auragon is quite simple:

reward value = my auragon count / his auragon count

(reminder: “his auragon count” is actually paragon[me for him])

This simple formula says that I should prefer the auragon that I have most of, and that I should prefer the auragon that he has least of. All simple and straightforward.

But is division the ideal operator to apply here? I can’t use division with BNumbers — the result makes no sense. But I could convert the BNumbers to regular Numbers and then divide. Even then, though, is division the best operator? I suspect that I will need an operator that is more attuned to the distortions of these values, but for now, I can see no better operator. Division it is.

Executing the calculation should be easy in Sappho: PickBestActorTrait should do the job. Here’s what I came up with:

That was easier than I expected!