The Greatest Algorithm Ever Made!


If I were a superhero standing arms crossed on a mountaintop with the wind gently blowing my cape, my chest would be emblazoned with an “A”, because I would be “Algorithm Man” {cue tarantara}. I live and breathe algorithms; I am always searching for interesting new algorithms to tackle interesting problems. I’ve come up with some doozies over the years. Someday I should write an essay describing some of my most inventive algorithms.

=

I’ve always searched for good algorithms to extend the applicability of encounters. The most obvious algorithm was to allow the encounter to be applied to any character in the cast. This required some simple algorithms for representing the antagonist in the text. For example:

“You give {AntagonistName} {AntagonistPossessivePronoun} book back.”

That was easy. I tried some other extensions, such as passing as a parameter a Prop to the encounter software, then referring to in text like so:

“You give {AntagonistName} {AntagonistPossessivePronoun} {PropName} back.”

But those didn’t work out well. More interesting was the idea of passing adverbial modifiers based on the three primary relationships, like so:

“You {TraitAdverb} give {AntagonistName} {AntagonistPossessivePronoun} book back.”

This might translate into “You amiably give Joe his book back.”

Another extension was to add intensifiers to the parameters being passed, like so:

“You slightly amiably give Joe his book back.”

This didn’t work that well, and it imposed a significant burden on the player.

Next up was an idea I first used way back in 1984 with Balance of Power: variation in clauses:

{Three old ladies | Small groups of protesters | Huge crowds } demonstrate outside the capital building.

I even developed some schemes for complex nested clauses. However, this was just getting more and more complicated without really extending the range of experiences for the player by much.

Here it comes!

But I recently had an idea (actually, an extension of some things I’ve mentioned before) that changes everything. It’s the greatest, most powerful, most splendiferous algorithm for extending the experience of encounters! Here it is:

Duplicate and modify.

Ta-da!

The idea is simple: start with an existing encounter. Duplicate it. Then make enough edits to it to make the duplicate a distinct experience even if it is based on the same starting point. For example, let’s take the opening sentences of the encounter I showed in “Encounters First”:

You’re patrolling Galahad’s borderlands with him and a handful of katterfacks when you come across a gang of workers strengthening a dike. They’re digging the trench in front of it deeper, and using the soil to pile the dike up higher.

Duplicate that algorithm, do a few minutes’ editing, and you have this:

You and Gawaine go on an impromptu hunt. What with the latest Saxon raid, beef hasn’t been on the menu very often, so you figure that a little venison might be appreciated by all. As you’re cantering through the forest, you come upon a band of peasants on their own hunt. But they’re not hunting deer—they’re after a pig. This pig is huge and has been tearing up gardens for miles around. You’ve heard of this pig before; it’s called “Toork Troo-eth” and apparently it’s quite large and dangerous. The peasants invite you to join them. Gawaine shouts “Who do you think you are? This is the King!”

You wordlessly accept the frantic apologies from the hunters.

“Don’t be so harsh, Gawaine. They didn’t recognize me.”

You thank the peasants for their offer but decline it.

The words of this encounter are entirely different, but structurally it’s very similar to the earlier encounter. Sure, it has a different antagonist, and a different scenario, but internally it uses similar calculations.