Random

From IFWiki

Random is an adjective applied to any element in a game determined (in part) by a pseudorandom process at runtime. The random seed may be refreshed at restart, undo or other meta-commands. Random elements may be purely superficial (such as the occasional appearance of brief, mood-establishing cutscenes), may affect the game world in a way not relevant to puzzles (such as a wandering NPC) or may be critical to puzzles.

Many of the features of randomness are shared by arbitrary game features, but the distinction between the two becomes quickly clear on replay.

Applications

  • Puzzle key randomisation. To prevent a knowledge conflict (for instance, from a walkthrough) some games randomise the correct solutions to puzzles. The simplest form of this would be the randomisation of a numerical password, but any number of alternatives are possible; entire games can be built around the diagnosis of a randomly generated puzzle key.
  • NPC behaviour. Real-life people (or animals) are less predictable than the medium-sized dry goods which IF concentrates on by default. Random behaviour - if used properly - can make an NPC seem less robotic and artificial. The most common - and arguably least effective - example of this is the randomly wandering NPC, but randomness is also a strong feature of active conversational NPCs.
  • Generation of atmospheric messages at random intervals.
  • Randomness may be used to add an impression of genuine danger in high-risk situations, such as combat.

Advantages

  • Random elements, if used properly, may greatly enhance replay value.
  • Properly used, randomness reduces the impression of a static, artificial environment.

Disadvantages

  • If there are distinctly positive and negative random outcomes, players are likely to feel the game is unfair, and will probably 'cheat' to get better outcomes.
  • Games with many random elements may cause combinatorial explosion, making coding more arduous.
  • Heavy random elements may give the player a feeling of arbitrariness and lack of control, and hence dissociate them from the game.
  • Randomness may cause players to miss good elements of a game through no fault of their own, since they may assume that a random response is what always happens when they attempt a particular action. Randomness can thus be a great way for an author to sell themselves short.
  • Critical random elements make the use of a walkthrough much more difficult. Some players may consider this inconsiderate of the author.
    • One potential solution to this problem is to implement a verb that sets the random number generator to a known state. The Inform 6/11 library includes just such a verb, "random".

Cautions

  • Avoid hiding important information in a random fashion; for example, a book which displays a random page each time you open it, one of which contains a vital clue for completing the game.
  • Beware of random events which may unfairly disadvantage the player. Infocom's Zork II includes a wizard who appears at random intervals and casts a spell on the PC, which can actually make the game unwinnable in certain situations - see Duncan Stevens' Zork II review

Links