Site News |
---|
Warning: This wiki contains spoilers. Read at your own risk! Social media: If you would like, please join our Discord server, and/or follow us on Twitter (X) or Tumblr! |
Random number generator
- "RNG" redirects here; for the stat abbreviated as "Rng", see range.
This page has been marked as a stub. Please help improve the page by adding information. |
The random number generator (or RNG) is a system that randomly generates numbers. Randomness is present in almost every game in the Fire Emblem series, primarily in the results of combat. As with most computer systems, random numbers in Fire Emblem are not truly random but pseudorandom—they simulate randomness with a deterministic series of numbers. When and how random numbers are generated changes from game to game.
Events that use random numbers include:
- Attacking an enemy
- Leveling up
- Creating a unit with randomly leveled-up stats
- Creating one of several possible "diagonal" paths
Generation
In the first three games, random numbers are "burned", and change each frame; they are saved as an eight-bit integer (ranging 0–255) that increments by 55 each time it is used, including when it is burned.^{[1]} in Fire Emblem: Shadow Dragon & the Blade of Light, the eight-bit integer is multiplied by 10 then divided by 25 (× 10 / 25) and then truncated—this allows for numbers ranging from 0–102, but all numbers above 100 are reduced to it; in Gaiden and Mystery of the Emblem, the integer is multiplied by 100 and divided by 256 (× 100 / 256) then truncated, allowing for a range of 0–99.^{[1]}
In most games from Genealogy of the Holy War onward—including the Game Boy Advance games and the games with turn-rewind mechanics—random numbers only change once they are used. The GBA games use similar RNG to each other: random numbers (in the same sequence in all three GBA games) are stored as sixteen-bit integers (ranging 0–65535) that are divided and truncated; in The Binding Blade, the integer is divided by 655, allowing for numbers 0–100—in The Blazing Blade and The Sacred Stones, the integer is multiplied by 100 and divided by 65536 (× 100 / 65536), allowing for numbers 0–99.^{[2]}
In most cases, only a single random number is used to determine the outcome of a random event. However, in games that use true hit—The Binding Blade being the first of which—two random numbers are used to determine whether an attack hits.
Attacking an enemy
Depending on whether the game uses true hit or not, either one or two random numbers are expended to determine whether an attack hits or misses. If the attack hits, another random number is spent to determine whether the attack is critical or not. Certain games expend additional random numbers for additional effects. In The Blazing Blade and The Sacred Stones, for example, there is a probability for an Assassin's critical hit to activate Silencer, and so an additional random number is spent if an attack is critical in those games, even if the attacker is not an Assassin.
Leveling up
- Main article:
Growth rate
When a unit levels up, random numbers are used to determine whether each stat increases or not. The odds of a stat increase for a specific unit are determined by the unit's personal growth rates, and—when applicable—their class. Some games also provide items and skills that boost a unit's growth rates, such as the Starsphere in Fire Emblem: Mystery of the Emblem or the Aptitude skill.
Additionally, in Thracia 776, enemy stats are treated as though they had leveled up, and can therefore vary between playthroughs and resets. The Game Boy Advance games also have enemy stats based on their growths with added randomness, though they are calculated in a manner that results in far less variance than in Thracia.
Some games have mechanics to prevent a level up from not increasing any stats and therefore limiting randomness:
- In Fire Emblem: The Binding Blade, Fire Emblem: The Blazing Blade, and Fire Emblem: The Sacred Stones, if a level up would not increase any stat, the level up will be re-rolled up to two times. If a level up would increase an already capped stat, it is considered a stat increase and will not be re-rolled. If both re-rolls fail to increase a stat, the level up will not grant any stat increases.
- In Fire Emblem: Radiant Dawn, level ups always increase at least one stat unless the unit in question already has all of their stats capped. If all of a unit's growth rates are modified to be 0% through hacking, the game will force a stat increase in HP. Additionally, level ups through bonus experience always increase exactly three stats unless the unit has less than three un-capped stats.
- In Fire Emblem: Shadow Dragon, a unit's odds of increasing a stat through level ups increases after it fails to increase on a level up.
- In Fire Emblem Echoes: Shadows of Valentia, blank level ups are forced to increase HP. However, if the HP cap of 52 is reached, blank level ups are possible.
- In Fire Emblem: Three Houses, Byleth, Flayn, Cyril, and all members of the four houses are guaranteed to increase at least two stats on level up. If a level up hits a capped stat, it is counted as a stat increase. If a level up would increase only one stat, that stat will not be rerolled.
In Fire Emblem Fates's Lunatic difficulty, a unit's level ups are determined when they are first recruited, and therefore cannot be rerolled through resetting.
Fire Emblem: Path of Radiance and Fire Emblem Engage have an optional, fixed mode where level ups are not determined by randomness. In both games, Fixed Mode is unlocked after completing the game once; in Engage, Maddening difficulty defaults to Fixed Mode.
Creating a unit
Random numbers are used to determine the stats of most enemies as they spawn. This is most evident for enemies in Arena battles. In the GBA games, for example, level 1 unpromoted enemies do not receive bonuses to their stat levels, but level 2 or higher enemies and promoted enemies do; thus the former do not use up as many random numbers as the latter.
Creating a path
When the game is forced to create one of several possible paths (usually by moving a unit to a point that is at a diagonal to its original position), it uses the RNG to determine which path to take. This can also be done by the player, if one controls a unit with odd-numbered movement.
References
- ↑ ^{1.0} ^{1.1} Oziphantom, Fire Emblem 1 : What is up with the RNG?, YouTube, Published: December 8, 2020, Retrieved: November 10, 2021
- ↑ StanH, response to Fire Emblem6 Rng Data, Fire Emblem Universe, Published: November 6, 2019, Retrieved: November 10, 2021