December 9th

I’ve been grinding along, making progress on all three fronts of effort:

Improving the Encounter Editor
I’ve made a number of improvements to the program, cleaning up parts of the graphic layout and providing new features that allow me to display the list of encounters in either alphabetical order or in order of the relative timing of the encounters. This has proven to be quite handy.

Improving the JavaScript
I’ve also tidied up and expanded the JavaScript program that displays the encounters and performs all the processing of the consequences of the player’s choices. I still need to handle the algorithms specific to individuals in the encounters that are explicitly addressed at individuals. 

Filling in the details on existing Encounters
I’ve also been going through the entire set of encounters, filling in details that were previously left blank. I’ve had to cross-check my terminology, insuring that the same terms are used in all encounters. I’ve had to enter the timing values for each encounter, to insure that they arise in roughly the right order. There’s still plenty of variation possible in the user experience of encounters. I’ve also had to double-check the algorithms applied to each option, as well as enter Consequence encounters where necessary.

The current brick wall
But now I’m facing a nasty problem. I have just finished writing a series of Encounters about a Greek merchant who comes with lots of exotic goodies, offering them in trade for tin. The end result of these encounters is that Arthur ends up with a bunch of goodies to distribute among the characters. My intention is that Arthur can use these goodies to shore up his political support from the characters. But there’s a technical problem: how can the player do this using the current user interface? The encounter system presents the player with a story followed by up to five options. How can you allocate nine objects among nine characters when you have only five options? There are dozens of permutations of the distribution results. I can’t even do it one-dimensionally (one encounter for each gift, or one encounter for each character).

This problem stumps me. Sure, I could redesign the system with a new user interface, but that’s too radical a change to contemplate at this stage. 

A second problem is bothering me: how do I give Arthur feedback on the perceptions of the characters? He needs to know who is on his side and who isn’t. I have those numbers in the state variables, but there’s nothing in the Encounter system that could address that. I’m thinking about writing a large set of encounters that would communicate this information, but as yet I have no trigger mechanism for such encounters. I believe that I can build a proper trigger mechanism, but it will be complicated. 

I need time to digest these problems. I think I’ll go work in the forest.

After returning from the forest work
I think that I have an idea, but it will require special-case coding. The first idea is that the gifts are ranked by value. Everybody agrees what the best gift is and what the worst gift is. The algorithm looks something like this:

CurrentActor = 0;
CurrentGift = 0; // the most valuable gift in the lot
while any gift is left
   Configure Encounter such that CurrentActor asks for CurrentGift
   Present Encounter to Arthur
   if (Arthur agrees to request) {
      transfer CurrentGift. ++CurrentGift.
   }
  ++CurrentActor

The problem with this code is that it will produce a very mechanical output, and it will require an average of about 18 iterations to complete the process. I could make the encounters unique by hand-writing all of them, but the tree expands to something like 256 nodes. Yes, they’re all copy-and-paste nodes, but everything in my body revolts against such a data-intensive approach. 

Damn! I hate the idea of spending hours worrying over this special case. Perhaps I should set it aside for now, let my subconscious masticate it for a while, and work on some of the other issues, such as the problem of feedback to Arthur.


Even later that day
I realized that the above ideas would entail big, messy changes in the code; it was all so demoralizing that I resorted to eating ice cream out of the carton, always a sign of trouble. But then I went out to work some more in the forest (I’m building a big pile of slash to burn to reduce fire hazard on the land), and an idea came to me. First, I’ll set aside the problem of gifts for the moment. Perhaps I’ll just allow Arthur to dole them out on a case-by-case basis. In any event, I decided to concentrate my efforts on the problem of providing the player with feedback on how the characters feel about him. This is absolutely necessary; if I can’t get this working, I have to abandon the entire design.

After bouncing around with several ideas that didn’t work out, I chanced upon a great solution. To make it work, I’ll need lots and lots of encounters directly involving each of the characters. There’ll be encounters for Tristram, other encounters for Bors, other encounters for Sagramore, and so forth. I’ll also build a database of about a hundred general observations indicating attitude. For example:

{Character} slaps you on the shoulder warmly as he takes his leave.
As he turns to leave, {Character} scowls at the ground.
You notice that {Character} is clenching his fists as he talks to you.
There’s something wrong with {Character’s} smile—it doesn’t seem quite natural.

I can then slap one of these sentences into any Encounter, substituting the character’s name as required. 

This might just work.