After posting my whining about JavaScript, I posted requests for help on Facebook and the Thaddeus page. Help started pouring in; within just a few hours I had the solution to my problem; the solution was ridiculously simple but for the fact that you had to know the trick. It turns out that one of my mistakes was that I used “processOption()” when I should have used “processOption”. Yep, the parentheses made all the difference in the world. JavaScript is notoriously difficult to debug, because there are so many ways that it could fail. Back in the bad old days, there weren’t that many kinds of errors, so the machine could tell you something like “Error 1029: unfrangled gigamajig” and you could figure it out. When JavaScript encounters a bug, it just stops. Even the debugger isn’t much use; when you come to the line with an error in it, it just says “error”.
Anyway, now that my previous problems are solved, I’ve already moved on to the next step. I already have implemented the textual part, but I’ve run into a problem with the main part: the calculation of the effect of Arthur’s choice. This involves three Blend calculations. My problem is that the Blend calculations are meant to apply to a single character’s pValues towards Arthur. Whose pValues are affected by the Blend calculations?
Everybody as a group
The first answer is that I eliminate individual pValues and instead boil everything down to just two pValues, representing the group of characters as a unit. This idea is immediately squashed by the fact that there’s no need for Arthur to worry about individuals when this is done. Moreover, some of Arthur’s actions are indeed specific to one character. Therefore, this answer is eliminated.
Everybody as individuals
Here I would use a loop in which all characters react to Arthur’s action, but each reaction is modified by that character’s accordance values. This is definitely better, and some of Arthur’s actions should be processed this way.
Individuals
This answer requires me to perform a separate calculation for each character. That’s out of the question. If I have 200 encounters, each with three options, and each option has one reaction for each character, that adds up to 4800 Blend operators that I have to specify. Too much work. Besides, most reactions will be similar. And of course some reactions are specific to an individual.
Character-specific reactions fall into two groups: responses to gifts and responses to having their toes stepped on. Thus, if Arthur gives something particularly nice to Bors, then Bors should have a strong positive response. But the other characters will have negative envious responses. If Arthur yells at Bors for stepping out of line, then Bors should have a strong negative response, but other people will have positive or negative responses based on the propriety of Arthur’s action and their pValues towards Bors.
Hoo, boy, this is getting complicated.
Let’s talk about pValues between characters. I think it best to keep those constant. Thus, Sagramore’s feelings towards Bors are fixed and do not change during the game. That keeps things simple. But this means that we’ll need a way for Arthur to learn about those pValues. I suppose that’s good; it will mean 64 encounters right off the bat.
Next let’s talk about the simplest encounters, in which Arthur makes a decision that is not specific to any character. These should produce changes in pValues that are based solely on accordance values—right? Should there be any other personality attributes that might further alter the change in pValue? For example, would one character expect more sternness out of the king, while another character expects a king to be a nice guy? In such circumstances, Arthur’s choice between stern and nice would have different effects.
Here’s a specific case: let’s say that one of the men is badly wounded in a battle. He can’t be moved safely. Arthur decides to leave him behind to die so that the army can get to safety. One character might respect that decision as a reflection of military sense, while another might resent it as heartless. No, I think this gets too messy. Let’s just stick with accordance values.
Next, let’s consider gifts. A gift will affect both pBad_Good and pTimid_Dominant in that it reflects both generosity (pBad_Good) and justice (pTimid_Dominant). But calculating the response of an individual character is messy business.
If the character is the recipient of the gift, then both of the character’s pValues towards Arthur will increase in proportion to the value of the gift and the character’s Ascetic_Greedy trait (that’s a new one I’ll have to put in). It also means that we’ll need encounters demonstrating the Ascetic_Greedy values for each of the characters— we’ll need several of these to nail it down.
But will characters have different evaluations of different gifts? Will Lancelot value a fine sword more than pretty boots? If the gift goes to the character’s wife, how will the character react? Hmm, more thought required here.
Even messier is the response of the other characters to the receipt of a gift by another. How will envy play out? Do I need another personality attribute for envy? Envious_Altruistic? Nah…
Can I treat an insult as simply the negative of a gift? Probably. But there’s still the fact that I need two sets of Blend operators for these—that will require a major change in Encounter Editor, something I very much want to avoid. Is there any way that I can have a single Blend operator that handles both the recipient of the act and everybody else?
Much to consider.