Mechanics: Modular Writing – Part I – The Concept

Alright, so here’s something we’ve not done in a bit. I’ll try to write a tutorial on something. This will be a three-part tutorial; the first part will go over the basics of modular writing and the specific context the next two parts will follow.

So, let’s start with the question of what even is modular writing.

Simply put, it’s the process of writing and tagging (adding descriptive attributes) the script to be used by a system (like a video game) that will select the written text and insert it into a broader context based on those tags. Likewise, it will involve the tagging of situations where the system should draw from some specific pool of modules and insert it in the marked spot.

Video games are not the only place where modular writing is used, but it’s the perspective through which we’ll discuss it. You might also note that my description of this tagging process is rather vague. And that’s because that strongly depends on what we’re doing. So, let’s review a few examples of modular writing used in video games and consider what tags should be used for that text.

1) Examples of modular writing

So, let’s imagine a role-playing game. This game has non-player characters, as they often do, and these characters can sometimes perform something called ambient chatter. That is to say, they will speak a phrase at random or provoked by some trigger. Modular writing, in this case, relies on providing a pool of options for the characters to say and marking which is appropriate for what character. So you might have one that works only if the character is a dwarf, another that doesn’t work if it’s an elf, and then the following only makes sense when said while it’s raining, but some might be even more specific and can only be said by a man during a thunderstorm in the 4th act of the story. It’s purely up to the game’s structure, what tags make sense and how they are applied.

Something bigger might involve writing a series of random events the player may encounter. This involves more than just writing the events on their own, which might also cross over into interactive writing (i.e., commonly involving a conversation tree or forest). Still, at the core, we start by defining where and how the random event might be triggered; oh, this one happens on a road because it involves a travelling merchant, this one might happen in any wilderness location, and then that one can happen only at night, etc. However, as we go down to interactive writing, it might also be the case that the event’s context affects how it has to be presented for it to make sense.

Let’s imagine we have that travelling merchant. Let’s say he expresses worry about bandits operating in the area, but then it may be the case that the player character has already murderhobo’d the local bandits, and as such, create a case where we can adjust the event based on the state of the world. Were this event to trigger when the bandits were still terrorising the local countryside, the merchant may express worry about the exact situation. However, if the bandits were already dealt with, the merchant might instead refer to the problem as having gotten better but preferring to still be careful as he travels through the land. (Note also, that this is an excellent way to acknowledge that the player has an effect on the world without needing to actually do/change anything.) This is also a case of modular writing, as the different lines within the module must also be correctly tagged for the system (or the data entry person) to recognise what should be done to trigger the correct one. Modular and interactive writing go hand in hand when more refined interactive writing is applied.

2) Module scale

Based on the above examples, we can see different scales on which modular writing can operate. The biggest modules are the events, but then we can wonder how low it can go. Personally, I’d divide the scales as such:

a) Events: Like the example with the merchant, this is a whole, possibly complex interaction. We have a character show up, and we can interact with them, possibly in different ways. Maybe there are a few hooks to use game mechanics for various benefits (barter for items, pickpocket the merchant, kill him, help him get to the nearest in, and so on). An event would be compromised of multiple, interactively connected paragraphs.

b) Paragraphs: Bigger segments of text, though not necessarily actually a paragraph. It’s more about a certain threshold, where it forms a complete unit. Modular writing at this scale might involve those ambient character lines from the first example. Things we just need to insert into an appropriate place. There’s no interactivity.

c) Sentences: A paragraph (like the one mentioned above) might be composed of one or more sentences, each of which might be handled from modular writing. In this case, we can swap out parts of the bigger text (like the case from the example, with the merchant referencing the bandits) and substitute it either to match some conditions or purely to make something repetitive more diverse.

d) Words: Likewise, a sentence might be seen as composed of words, some of which might be swapped out through this same process of modular writing. This is a case I’ve not discussed above, but this happens when you make a character, and the game can reference that, most commonly by swapping out pronouns. Variable pronouns are in the (vast) majority referenced when a writer marks a spot for a pronoun to be inserted into. Of course, it can also be other things, like character names, to give another common example.

The game we make makes use of modular writing across all four of these categories, but most often around the level of sentences, as our systems commonly assemble the visible text sentence by sentence, sometimes going deeper to play around with the words.

3) Modular writing quality

It should be noted that proficient modular writers are rare. Part of this is the low demand for in-depth modular writing; part, though, can be (from my experience) attributed to people not being willing to step out of their comfort zone and try something new. To paraphrase something I’ve heard once, “I’m a writer, not a programmer”. Because I guess only programmers are capable of creating non-linear content or something like that. This is, of course, nonsense, but there is indeed a palpable lack of resources for modular writing. So, let’s consider what constitutes good writing in this style.

a) Fit for purpose: I would say that, to begin with, modular writing should be fit for purpose. Whatever slot the module might be inserted into, it should fit there. This involves purely technical aspects like character encoding to more writing-specific issues such as tense, person or style.

b) Diversity: Modular writing is usually employed to offer diversity in repetitive situations. When you have a character do an ambient quip, you do it to break the static monotony of a situation, preferably in ways that make it seem more alive. When you randomise events during some activity, it’s to break up that activity and make it a bit different than it was every other time the player did it. When going down to the level of building texts with sentences and words, the point is to output diverse texts. (We’ll speak about that a bit more at the end because I want to make a particular note of it.)

c) Reusability: For practical purposes, modules should be written to not be too specific. An overly specific module shows up rarely, meaning it does not contribute to the diversity of the situation quite as much as it could (though, of course, sometimes it’s fine to make a rare joke/easter egg module that is supposed to not show up too often). As a general rule of thumb, the bulk of modules written to service a specific need should be interchangeable in the broadest way possible, considering the least number of factors that would prohibit their use when the system takes a tally of available options.

4) Sentence diversity

Now, I mentioned that the concept of diversity can be expanded on just a little bit more for modular sentences. The advice below applies to many systems of modular writing but is, in particular, commonly considered in my own efforts.

a) The beginning and end of a sentence really count. Something about the human mind leads us to pay more attention to the beginning and end of words and sentences, it would seem, and as such, for modular sentences, it’s important to provide diversity in that area, at the simplest level, it’s about the modules that will slot into a specific place, but also when stringing modular sentences together, there are techniques to eliminate repetition there too. The biggest offenders are pronouns. “I”, “you”, and “he/she” often make their way to the beginning of a sentence (in English, at least) and should be treated with a bit more care than when writing linear text.

b) The length of sentences should vary. This isn’t something most people think about, but it does come up in modular writing specifically. If modules keep to a similar length, the block they produce will also be of comparable size each time, which stands out. As such, it’s sometimes worth adding extra flare to a specific sentence, maybe even splitting it into two, going on a digression or making particular note of some detail.

c) As great as diversity is, sometimes it’s possible to stumble into issues when trying to vary up a sentence. Specifically, it’s essential to consider if what we add matches what can possibly come before and after. When the same module is used in two radically different places, going into “what” is happening is safer than going into “why” it is happening. The latter will risk reducing the reusability of such a sentence, while the former is generally safer. Consider a situation where you open a door. The physical process of opening the door is appropriate for cases where the character does or doesn’t pass through it. However, speaking of why the door is being opened might conflict with one of those options. In general, I’d call this trying not to overstep player agency; the player can probably provide their reasons well enough.

d) If possible, consider sub-randomisations: Most systems that support modular writing (though not all) will also offer some means of sub-randomisation. In the context of modular sentences, it’s some method of randomising a specific word using synonyms. Rattling off a few alternatives takes little effort but can change the sentence just enough to give it some more freshness.

In the next part of this tutorial, I’ll show you how to use the Esoteric engine to do some sentence-level modular writing. It will be a more practical tutorial, but we’ll do it with the knowledge of what’s written above. It will be a step-by-step tutorial using the system itself, and if you follow it, you will be able to see your results in the terminal.

Leave a comment