A random encounter is a feature commonly used in various role-playing games whereby encounters with non-player character (NPC) enemies or other dangers occur sporadically and at random. In general, random encounters are used to simulate the challenges associated with being in a hazardous environment—such as a monster-infested wilderness or dungeon—with uncertain frequency of occurrence and makeup (as opposed to a "placed" encounter). Frequent random encounters are common in games like Dragon Quest,Legend of Legaia, Pokémon and the Final Fantasy series.
Random encounters—sometimes called wandering monsters—were a feature of Dungeons & Dragons from its beginnings in the 1970s, and persist in that game and its offshoots to this day. Random encounters are usually determined by the gamemaster by rolling dice against a random encounter table. The tables are usually based on terrain (and/or time/weather), and have a chance for differing encounters with different numbers or types of creatures. The results may be modified by other tables, such as whether the encounter is friendly, neutral or hostile. GMs are often encouraged to make their own tables. Specific adventures often have specific tables for locations, like a temple's hallways.
Wandering monsters are often used to wear down player characters and force them to use up consumable resources, such as hit points, magic spells and healing potions, as a way of punishing them for spending too much time in a dangerous area.
Random encounters were incorporated into early role-playing video games and have been common throughout the genre. Placed and random encounters were both used in 1981s Wizardry and by the mid-1980s, random encounters made up the bulk of battles in genre-defining games such as Dragon Warrior,Final Fantasy, and The Bard's Tale. Random encounters happen when the player is traversing the game world (often through the use of a "world map" or overworld). Most often, the player encounters enemies to battle, but occasionally friendly or neutral characters can appear, with whom the player might interact differently than with enemies. Random encounters are random in the respect that players cannot anticipate the exact moment of encounter or what will be encountered, as the occurrence of the event is based on factors such as programmed probabilities; Pseudo-random number generators create the sequence of numbers used to determine if an encounter will happen. The form and frequency can vary depending on a number of factors, such as where the player is located in the game world and the statistics of the player character. In some games, items can be found to increase or decrease the frequency of random encounters, even to eliminate them outright, or increase the odds of having a particular encounter.