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: Difference between revisions

From Fire Emblem Wiki, your source on Fire Emblem information. By fans, for fans.
No edit summary
No edit summary
Line 15: Line 15:
*Creating a unit with randomly leveled-up stats
*Creating a unit with randomly leveled-up stats
*Creating one of several possible "diagonal" paths
*Creating one of several possible "diagonal" paths
==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 FE7 and 8, for example, there is a probability for an Assassin's critical hit to be a 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==
{{stub}}
When one of your units levels up, random numbers are burned to determine whether each stat levels up or not.
==Creating a unit==
When an enemy spawns and has randomly leveled stats, random numbers are spent to determine how those stats are leveled. This is most evident for enemies that spawn for [[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 and/or 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.
{{refbar}}
{{refbar}}


{{NavMech}}
{{NavMech}}

Revision as of 20:36, 2 November 2023

"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.

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 to 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 to 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 to 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 hitThe Binding Blade being the first of which—two random numbers are used to determine whether an attack hits.

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

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 FE7 and 8, for example, there is a probability for an Assassin's critical hit to be a 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


This page has been marked as a stub. Please help improve the page by adding information.

When one of your units levels up, random numbers are burned to determine whether each stat levels up or not.

Creating a unit

When an enemy spawns and has randomly leveled stats, random numbers are spent to determine how those stats are leveled. This is most evident for enemies that spawn for 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 and/or 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. 1.0 1.1 Oziphantom, Fire Emblem 1 : What is up with the RNG?, YouTube, Published: December 8, 2020, Retrieved: November 10, 2021
  2. StanH, response to Fire Emblem6 Rng Data, Fire Emblem Universe, Published: November 6, 2019, Retrieved: November 10, 2021
Game mechanics
Out-of-battle management Base (BarracksBase CampBase conversationEveryone's ConditionsExpeditionGarreg Mach Monastery (Abyss) • My CastleSomniel) • Bonus experienceDungeonsGameplay modes (DifficultyCreature CampaignNew Game +) • GoldLessonsMila ShrinesPeddlerPreparationsRenownShopping (ArmoryBargainsForgeItem shopMerchantOnline shopSecret shop) • Supply convoyWorld map
Battles and chapters ArenaBattle saveBossCastleChapter (Alternate routeParalogueSide quest) • ChestCombat forecastEvent tilesHidden treasureObjectivesReinforcementSkirmishTerrain (Hazards) • Turn (Turn rewind) • Weather (Fog of war) • Village
Stats Units ActionAffinityAuthorityBiorhythmCharmClass (Class masteryClass relative powerUnit type) • Constitution (Aid) • DefenseExperienceFollow-up critical multiplierGrowth rateHit pointHoly BloodInventoryLevelLuckMagicMovementProficiencyResistanceSkillSpeedStrengthWeapon levelWeight
Weapons Brave weaponCritical rateDurabilityHitKill bonusMightPersonal weaponsRangeWeapon experienceWeapon levelWeightWorth
Unit mechanics and commands AdjutantAttack (Counterattack) • Auto-BattleBattalion (Gambit) • CantoChain attackChain GuardClass change (Reclass) • Combat artCrestsDance (GaldrarPlaySing) • Death (Decoy) • DismountDragon VeinEmblem RingsFatigueInventoryLaguz transformationLove (JealousyInheritance) • Pair UpRallyRecruitmentRescue (Capture) • Skills (Offensive skill) • SmashStaggering BlowStatus effectsSupportTalkTradeUnit (AvatarBond unitsBonus unitEinherjarLoan unitPrisonerReplacement unitSubstitute character) • Visit
Calculations AttackAttack speedAvoidBonus damageCritical hit (Combination bonusDodgeTriangle Attack) • Hit rate (True hit) • Random number generatorWeapon triangle (Trinity of magic)
Connectivity amiiboData transferDouble DuelDownloadable contentLink ArenaMultiplayer battleOnline shopSpotPassStreetPass
Other BarrierBirthdayClass rollGlitchesMultiple endingsRankingsSound RoomTactician bonus