RNG/Archived

Obtained from VoiD_Glitch's Github on 13 July 2018
----
WARFRAME - Rarity Weights and "Random" Number Generation
By Devove, FineNerds, & VoiD_Glitch
==Introduction==
Random Number Generation is the generation of a sequence of numbers or symbols that cannot be reasonably predicted better than by a random chance, usually through a random-number generator (RNG). Random Number Generation is an essential factor to in-game items as the drop chance of an item can determine its market value and influence a player's means of obtaining it (as in, farming for or purchasing it). There is no way to generate random numbers non-deterministically, but algorithms do exist that give the appearance of a random sequence. The algorithm WARFRAME makes use of is Donald Knuth's version of a Linear Congruential Generator (LCG), scaling off of Rarity Weights that influence the drop chances of items in DropTables and MissionDecks files. Note that the formula only applies to missions that involve getting rewards over time, such as Defense and Survival. This concept is explained by Pwnatron in this thread, starting with “The order of these items is important in a way.” In the cases of missions like Capture and Exterminate, they simply use the process that will be explained later in this article.
==Rarity Weights==
WARFRAME makes use of four (4) Rarity Weights in its Random Number Generation algorithm. These weights are uniform across DropTables and MissionDecks, with the exception of /Lotus/Types/Game/MissionDecks/SortieRewards, which uses FixedWeights (Weights that Digital Extremes manually assigns).
Rarity 	Weight 	Percentage
Common 	0.7555 	75.50%
Uncommon 	0.22 	22.00%
Rare 	0.02 	2.00%
Legendary 	0.005 	0.50%
0.755 + 0.22 + 0.02 + 0.005 = 1	0.755 + 0.22 + 0.02 + 0.005 = 1	0.755 + 0.22 + 0.02 + 0.005 = 1
==Formulae==
*Common Drop Chance (Per Item) = Base Common Drop Chance / Number Of [Common] Items
*Uncommon Drop Chance (Per Item) = Base Uncommon Drop Chance / Number Of [Uncommon] Items
*Rare Drop Chance (Per Item) = Base Rare Drop Chance / Number Of [Rare] Items
*Legendary Drop Chance (Per Item) = Base Legendary Drop Chance / Number Of [Legendary] Items
===Procedure (Example)===
Data Selection: 8 Common, 6 Uncommon, 4 Rare, 2 Legendary
 Common: 0.755 / 8 = 0.094375 = 9.44%
 Uncommon: 0.22 / 6 = 0.0366666666667 = 3.67%
 Rare: 0.02 / 4 = 0.005 = 0.50%
Legendary: 0.005 / 2 = 0.0025 = 0.25%
 Common: 9.4375 × 8 = 75.5
 Uncommon: 3.66666667 × 6 = 22
 Rare: 0.5 × 4 = 2
Legendary: 0.25 × 2 = 0.5
==Normalization==
Normalization occurs when one or more of the Rarity Weights are not present in a DropTable or MissionDeck. Normalization has many meanings, but in this case it refers to the division of constants that are added up so values fall between zero (0) and one (1) within different data sets.
===Normalization Procedure (Example)===
Data Selection: 1 Common, 1 Uncommon, 1 Rare, 0 Legendary
 Common: 0.755 / (0.755 + 0.22 + 0.02) = 0.758793969849246 = 75.8793969849246 = 75.88%
Uncommon: 0.22 / (0.755 + 0.22 + 0.02) = 0.221105527638191 = 22.1105527638191 = 22.11%
 Rare: 0.02 / (0.755 + 0.22 + 0.02) = 0.020100502512562 = 2.01005025125628 = 2.01%
75.8793969849246 + 22.1105527638191 + 2.01005025125628 = 100
==Attenuation==
Attenuation is a variable exclusive to DropTables. The Boolean OverrideLevelAdjustedBiasAtten determines if Attenuation is present in a DropTable or not. Attenuation is defined as “the reduction of the force, effect, or value of something.” This means that as the Attenuation value increases, the drop chance of an item should decrease. However, because of how minor its set value (0.5) is (from one of the Boolean's secondary variables, RareAttenMax), and that it impacts DropTables globally instead of individual items, it is impossible to accurately determine if it has a noticeable impact on items at all.
==Bias==
Bias is a variable exclusive to DropTables. Bias can be applied to items within DropTables but is not global across any. Bias is defined as “a feature of a statistical technique or of its results whereby the expected value of the results differs from the true underlying quantitative parameter being estimated.” This means that the sole purpose of Bias is to unequally weigh items within DropTables (through a positive (+) or negative (-) value change), even if said items have identical Rarity Weights. In WARFRAME, Bias is a variable that negatively impacts the drop chance of an item. The more Bias an item has, the lower its drop chance is. Additionally, because Bias scales from the Rarity Weight that the item it is impacting is assigned to, items with Rarity Weights that hold more weight than others will still tend to drop more often, depending on the amount of Bias that is present. I had individuals help me confirm this theory.
==Reward Seeds==
rewardSeed is a variable exclusive to MissionDecks. It is a 64-bit integer that determines the missionReward players receive at the end of a mission. It is granted to you at the start of the mission, and remains with you until its completion. rewardSeeds are given to the host, and members of the host’s group receive the sessionId in order to participate in the same session. You will only receive a rewardSeed when your client needs to distribute it to players in a group (as the host). This means that you will receive a rewardSeed if you begin a Public, Friends Only, or Invite Only session, but if you begin a Solo session, you will not be given a rewardSeed. Despite the SRand variable (the seeding for the random number generator (a pseudo-random integer between 0 and RAND_MAX)) being different for each player, each player will always receive the same missionReward as the host, because of their identical sessionIds.
==Copyright note==
©2018, VoiDLabs. All rights reserved.
==Patch History==
Category:Blog posts
Category:Mechanics
Category:Real-World References