How to Write Interactive Fiction and Interactive Audio Stories – 025 – Variables

Five Tips for Using Variables

1. Do not Use Variables for Attributes and Abilities at every Player Choice

If, for example, all the player is being asked is whether they wish to use diplomacy or violence, Player Choices will quickly become monotonous and boring since the players will already have developed their character in one direction or the other anyway. On top of this, you will be taking all agency away from the player. So vary your Player Choices and rephrase them in such a way that the player at least has to speculate which of their abilities will be called upon for it. Only then will the power of the player’s decision feel like a personal success.

2. Use Personality Traits Early On

At the beginning of the story ask your player questions like you would in a personality quiz, record their answers assigning variables like “honesty” or “friendliness”, and let these influence the later events of the game.

3. Confront the Player With a Moral Dilemma

Sporadically, present the player with moral Player Choices. The different options offered through these questions should be equally valid or each offer different advantages and disadvantages. Record these decisions assigning variables like “justice” or “loyalty” and confront the player later on in the story with their earlier decisions.

4. Use Variables to Create a Dynamic Game World

Let the decisions of your player influence the game world and show their these changes. This can be done through the fate of secondary characters or how they react to the player character. For example, if the player achieved their previous goals through severe brutality, tell them that, as they enter the tavern, everyone falls silent. The inn keeper refuses to serve them or an old woman cries out that they are a killer and criminal. If the player wasted too much time because they insisted on also cracking the safe and investigating the basement, then tell them, as they return to the headquarters, that the main suspect has already been released from custody and has now disappeared without a trace.

5. Provide the Player with Expandable Resources

Every decision that is immediately rewarded with pieces of gold is, to the player, worth its actual weight in gold. The collecting of jingling coins and other objects of value does not only makes them feel like they are making progress in your story, but also lends a concrete metric to this progress. If the player also has the chance to transform these resources into some game advantage, for example by buying a better weapon, you have already succeeded in meeting the requirements for creating a great gaming experience.


Variables can be used:

  • To record relationships based on the behavior of the player character towards one or several other characters. Depending on the state of the relationship, the other character (or one of their friends/enemies) will react differently to the hero at different points in the story. Examples: sympathy, love, reputation, loyalty.
  • To record the attributes of the character. These attributes can be determined through character generation in the beginning or through the actions of the player character, and they can change throughout the course of the story. Attributes can be used to determine the success of certain player actions, like the breaking of a door. Examples: strength, beauty, intuition, charisma.
  • To record abilities gained, either during the character generation or during the game. Later you can check whether the player character has a specific ability to then offer the player additional choices for the use of that ability. Examples: sneaking, haggling, fire spell, healing.
  • To record any items gained or lost, either during the character generation or during the game. Later you can check whether the player character has a specific item to then offer the player additional choices for the use of that item. Examples: rope, key, gun, admission ticket.
  • To record specific player actions that become relevant later in the story. If the player has performed a certain action earlier, you can then offer them additional choices or lead them down a different path. Examples might include a lever pulled, evidence photo seen, or a meeting arranged.
  • To keep track of specific resources that can grow and shrink through certain player actions and will influence the course of the game. Examples: gold, water supply, lead, life points.
  • To generate random numbers. These can be used to have random events happen or to determine the success of certain player actions. Examples: weather, traffic density, dice throw, hit chance.
  • The deliberate use of variables can help you to define the nature of the player character, changes in the game world, variations in the plot, and the success of the player character.
Share The Post