WARFRAME Wiki
Advertisement
WARFRAME Wiki
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 Xn = (aXn-1 + c) mod m 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

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[]

Hotfix 10.6.2 (2013-11-05)
Source: https://forums.warframe.com/topic/128402-rng-algorithm-bugschanges/

NOV 5th, 2013 - RNG ALGORITHM CHANGES

If you are one of those players that feel like the RNG Gods are angry with you, starting today you may begin to notice a more fair and balanced hand from these divine beings.

Glen (our Tech Director) identified and fixed a serious distribution flaw with random number generation (RNG) in Warframe. While enemy drops were not seriously affected, a truncation in the random 'seed' within the mission reward script could result in a terrible chain of bad luck. While some players may have benefited from this (a chain of good luck) the distribution was terrible.

For context: Games use a lot of random numbers for things other than drops; for example when you blast one of those damned security cameras and a shower of sparks explodes out of it the each particle’s direction is determined by an RNG. Since games need a lot of RNG for effects and other things we actually have a very optimized RNG to make the game run quickly – the problem is you trade entropy (how random it is) for speed.

The RNG for drops needed to be slow and good to be fair and truly reflect the intended drop rates. The new code changes embraces a much slower and entropic means of determining drops of all kinds - weapons, Warframe parts, etc.

I'm very sorry for the frustration this has caused. We are committed to preventing future regression through automated tests... Attached to this post are contrast-boosted images from these tests. The bugged RNG, which is plainly giving dreadful runs. The 'fast' RNG without the truncation error - much better but still with an obvious pattern. Lastly, Glen's new code which shows a vastly improved distribution.

Thank you for reading and happy hunting Tenno!

Left to right: Bugged, Fast, Fixed (new hotness)

These pictures show the output of each RNG technique repeatedly flipping a coin: White is heads, Black is tails. In order for the loot tables to be fair and well distributed you want your RNG to output something that looks like static (which the new approach does).


Advertisement