Directors

As a Rogue-lite, Risk of Rain 2 features a lot of random generation as part of its gameplay - unlike many other action games, enemies and most items are randomized between different runs, both in their nature and location. The systems that manage these are called the Directors. Their main purpose is to manage spawning of Monsters and Interactables while keeping a balance between variety and consistency to ensure a fun experience and ever-different playthroughs.

Risk of Rain 2 uses two sets of Directors : The Scene Director, which is responsible for setting up the map when entering an Environment, and the Combat Directors, which are responsible for spawning enemies while players explore the map.

Basics and Terminology
Although both Directors work differently, they share some similar concepts. Understanding them is important to understand the finer details of their inner workings.

List of Directors
The number of Directors used by the game is equal to 6. Note however that not all of these Directors are active at the same time. Directors are classified into Instantaneous and Continuous Directors. Only active Directors can spawn monsters and interactables.

Instantaneous
Instantaneous Directors have a simple behavior : Once activated, they perform their spawns then immediately disable themselves.


 * The Scene Director is active during map setup. It is responsible for spawning all interactables as well as spawning the initial monsters present on the map when players teleport in.
 * The Teleporter Boss Director is active 3 seconds after players activate the Teleporter. It is responsible for spawning Teleporter Bosses.
 * The Shrine of Combat Director is active whenever a player activates a Shrine of Combat. It is responsible for spawning enemies that appear as parts of its activation.

Continuous
Continuous Directors activate and deactivate themselves based on various conditions. While active, these Directors will regularly receive credits and attempt spawns until they are disabled.


 * The two Standard Directors activate when players enter the map and deactivate 3 seconds after players activate the Teleporter. They are responsible for spawning most of the monsters players will encounter when exploring the map. Both Directors have very similar characteristics, however, they differ in their spawn rates. They will be called the Fast and Slow Directors in the rest of the article.
 * The Teleporter Director activates 3 seconds after players activate the Teleporter and deactivates when the Teleporter is fully charged. It is responsible for spawning enemies while the Teleporter is charging.

Director Credits
Just as players use money to purchase items, the Directors make use of a special, invisible currency called "credits". Instantaneous Directors gain a burst of credits which they immediately spend, while Continuous Directors accumulate and spend them over time while active. The number of credits received depend on the Director itself, though all directors use the same costs.

Spawn Cards
In order to determine what to spawn and at which frequencies, the Directors make use of a concept called Spawn Cards. A Spawn Card represents a single entity and has a Weight, a Credit Cost and Conditions. Every monster and non-static interactable in the game has a spawn card.


 * The Entity represents what will be spawned if the card is selected
 * The Weight represents the relative chance of the card to be picked
 * The Credit Cost represents how many credits a Director must spend to spawn the entity
 * The Conditions represent any additional conditions that must be fulfilled before the card can be used

Categories
All spawn cards belong to one of several Categories, which are simply a collection of spawn cards with a weight. Every map uses the same set of categories, however, the weight of the categories themselves vary depending on the map, and not all maps use all spawn cards. Some maps can also override the weight or cost of individual spawn cards although this is rare. Note that no interactables are spawned by the Scene Director on Gilded Coast, which is omitted from the table.

Weighting
Whenever a Director picks a spawn card, it does not do so randomly - it takes into account the computed weight of the element. The computed weight of the element depends on two things :


 * The relative weight of the category (Equal to the weight of the category divided by the sum of the weights of all categories)
 * The relative weight of the card (Equal to the weight of the element divided by the sum of the weights of all elements that can spawn on this map and within that category)

The final chance to be picked is equal to the product of these ratios.

Think of it like a lottery : First, every category puts in tickets equal to their weight (A category with a weight of 10 has 5 times more tickets than a category with a weight of 2). Then, a random ticket is picked : Its category is selected. The same thing then happens within the category : Every item puts in tickets equal to its weight, the winning spawn card is selected.

Spawn attempt
Note : I am tired right now, I will continue later today or tomorrow Seud (talk) 14:31, April 25, 2019 (UTC)