Difference between revisions of "Earthbound RNG manipulation"

From RPG Speedruns
Jump to: navigation, search
m
 
(One intermediate revision by the same user not shown)
Line 23: Line 23:
 
Additionally, RNG 1, 2, and 3 are always reset to the same values once the console is reset. It is this that allows for consistent RNG manipulation from reset to reset.
 
Additionally, RNG 1, 2, and 3 are always reset to the same values once the console is reset. It is this that allows for consistent RNG manipulation from reset to reset.
  
From testing, it appears that turn order for each round in a battle is determined at the very beginning of a round (before you select your actions for that round)
+
RNG 1 and 2 affects turn order. Turn order for each round in a battle is determined at the very beginning of a round (before you select your actions for that round). This includes turn order for the first round being decided before the fight starts.
 +
 
 +
RNG 1 and 2 affects enemy item drops. Item drops are also decided before the round start similar to turn order. If there are multiple different enemies in the fight, only one enemy is checked randomly to have it's item drop before the fight starts.
 +
 
 +
RNG 1 and 2 decides the action of a Bash at the end of the attack text in order of miss, smash (assuming non-ranged weapon), dodge, damage, and finally status.
  
 
'''Events that change RNG 1 and RNG 2'''
 
'''Events that change RNG 1 and RNG 2'''
Line 31: Line 35:
 
* An NPC begins moving or stops moving. Each time one of these events occurs, RNG advances a single unit.
 
* An NPC begins moving or stops moving. Each time one of these events occurs, RNG advances a single unit.
  
* Moving the cursor in a menu. Each cursor movement advances RNG 1 and RNG 2 a single unit. This starts the moment the console is turned on.
+
* Moving the cursor in a menu. Each cursor movement advances RNG 1 and RNG 2 a single unit. This starts the moment the console is turned on. Moving the cursor in the PSI menu advances RNG 1 and 2 by two units.
  
 
* Opening and closing the menu. Opening the menu with A advances RNG 1 and RNG 2 a single unit. Closing the menu with B then advances RNG 2 units. Note that if you wait long enough in the menu that your characters HP/PP boxes come up, RNG 1 and RNG 2 will advance one unit every second.
 
* Opening and closing the menu. Opening the menu with A advances RNG 1 and RNG 2 a single unit. Closing the menu with B then advances RNG 2 units. Note that if you wait long enough in the menu that your characters HP/PP boxes come up, RNG 1 and RNG 2 will advance one unit every second.
Line 37: Line 41:
 
* Pressing B to see characters' HP/PP boxes. This will have the effect of advancing RNG 1 and RNG 2 one unit every single frame that they are open. As a result, pressing B for an RTA route is not recommended as frame perfect inputs would be required for consistent routes.
 
* Pressing B to see characters' HP/PP boxes. This will have the effect of advancing RNG 1 and RNG 2 one unit every single frame that they are open. As a result, pressing B for an RTA route is not recommended as frame perfect inputs would be required for consistent routes.
  
* Sometimes (although it is unknown to what extent this occurs) when RNG 3 changes from one of the events listed below, RNG 1 and RNG 2 will also advance.
+
* While in Dusty Dunes Desert or in Scarba Desert, RNG 1 and 2 will advance by one unit on a 20 seconds global timer when the game checks to give you sunstroke.
 +
 
 +
* Bubble Monkey and the Cultist Lady in Happy Happy Village when in the party will change RNG 1 and 2 when starting and stopping their paused and "catch up" movements.
 +
 
 +
* RNG 1 and RNG 2 will also advance by one unit when the 16s place, 0x00a0, changes in RNG 3.
  
 
'''Events that change RNG 3'''
 
'''Events that change RNG 3'''
  
* Crossing 64 pixel boundaries around the map. Imagine the map is laid out in a huge grid of 64x64 pixel boxes. When you cross one of the vertical lines or horizontal lines in a certain direction, RNG 3 will advance. Note that there are certain times in the game where this mechanic is not active. An example of this is at the beginning of the game where you walk up the cliff to talk to Pokey by the cops. These 64 pixel boundaries are not active during this time.
+
* Crossing 64 pixel boundaries around the map. Imagine the map is laid out in a huge grid of 64x64 pixel boxes. When either the first pixel on Ness crosses a vertical line or when the top or bottom most pixel on Ness crosses a horizontal line, RNG 3 will advance. Note that there are certain times in the game where this mechanic is not active. An example of this is at the beginning of the game where you walk up the cliff to talk to Pokey by the cops. These 64 pixel boundaries are not active during this time.
 +
 
 +
* Through door transitions, RNG 3 will advance by 15 units. Falling down a hole, RNG 3 will advance by 30 units.
 +
 
 +
* RNG 3 does advance during some stationary cutscenes. When in a moving cutscene, RNG 3 will be turned off.
  
 
'''Additional Facts about RNG'''
 
'''Additional Facts about RNG'''
  
RNG 1 and 2 follow a sort of predictable chain pattern in the way they advance. If RNG 3 is constant, RNG 1 and RNG 2 will always follow the same stream of values as events occur. This means that whether you are in a menu or watching an NPC walk ok screen, RNG 1 and RNG 2 advance in the same pattern. As soon as RNG 3 changes though, this pattern can change. RNG 3 on the other hand always follows the same pattern in that it always increases linearly.
+
RNG 1 and 2 follow a sort of predictable chain pattern in the way they advance. If RNG 3 is constant, RNG 1 and RNG 2 will always follow the same stream of values as events occur. This means that whether you are in a menu or watching an NPC walk ok screen, RNG 1 and RNG 2 advance in the same pattern. As soon as RNG 3 changes though, this pattern can change.  
 +
 
 +
Going through the same door transitions sometimes do not lead to consistent advancement of RNG 1 and 2, but entering on the same seed will always advance by the same amount.
 +
 
 +
RNG 3 does not always follow the same pattern. Crossing the RNG 3 lines normally updates by 5 units. When there are repeating identical spawn plates a certain distance away from an RNG 3 line, this causes the game to repeat checking RNG 3 up to 5 additional times depending on the amount of identical spawn plates. Known RNG 3 line values range from 5-10 units.

Latest revision as of 01:18, 11 June 2018


RNG Info

RNG in Earthbound is dependent on multiple factors. There are 3 values in memory that the game uses to determine all random events in the game. These three values behave in different ways under different circumstances and influence randomness in different ways. Additionally, the third RNG value was discovered fairly recently and it is not yet known to what extent it does influence randomness. We do know that it does influence it, though.

The RNG values are below and their location in game memory is as follows:

  • RNG 1: 1 byte hex value at 0x7E0024
  • RNG 2: 1 byte hex value at 0x7E0026
  • RNG 3: 2 byte hex value at 0x7E4A7A

RNG 1 and RNG 2 always change in step with each other and behave exactly the same way. When an event occurs that would change RNG 1, RNG 2 will also change, and vice versa. RNG 3 changes primarily based on the player's movement around the map.

Additionally, RNG 1, 2, and 3 are always reset to the same values once the console is reset. It is this that allows for consistent RNG manipulation from reset to reset.

RNG 1 and 2 affects turn order. Turn order for each round in a battle is determined at the very beginning of a round (before you select your actions for that round). This includes turn order for the first round being decided before the fight starts.

RNG 1 and 2 affects enemy item drops. Item drops are also decided before the round start similar to turn order. If there are multiple different enemies in the fight, only one enemy is checked randomly to have it's item drop before the fight starts.

RNG 1 and 2 decides the action of a Bash at the end of the attack text in order of miss, smash (assuming non-ranged weapon), dodge, damage, and finally status.

Events that change RNG 1 and RNG 2

  • A character is printed in a text box. When an NPC is talking to you, every time a character is printed in the box, RNG 1 and RNG 2 will advance a unit. It doesn't matter what the character is, the RNG advances in the same way. This is critical to remember when naming your characters. The number of characters in your characters' names will change the character count in text boxes.
  • An NPC begins moving or stops moving. Each time one of these events occurs, RNG advances a single unit.
  • Moving the cursor in a menu. Each cursor movement advances RNG 1 and RNG 2 a single unit. This starts the moment the console is turned on. Moving the cursor in the PSI menu advances RNG 1 and 2 by two units.
  • Opening and closing the menu. Opening the menu with A advances RNG 1 and RNG 2 a single unit. Closing the menu with B then advances RNG 2 units. Note that if you wait long enough in the menu that your characters HP/PP boxes come up, RNG 1 and RNG 2 will advance one unit every second.
  • Pressing B to see characters' HP/PP boxes. This will have the effect of advancing RNG 1 and RNG 2 one unit every single frame that they are open. As a result, pressing B for an RTA route is not recommended as frame perfect inputs would be required for consistent routes.
  • While in Dusty Dunes Desert or in Scarba Desert, RNG 1 and 2 will advance by one unit on a 20 seconds global timer when the game checks to give you sunstroke.
  • Bubble Monkey and the Cultist Lady in Happy Happy Village when in the party will change RNG 1 and 2 when starting and stopping their paused and "catch up" movements.
  • RNG 1 and RNG 2 will also advance by one unit when the 16s place, 0x00a0, changes in RNG 3.

Events that change RNG 3

  • Crossing 64 pixel boundaries around the map. Imagine the map is laid out in a huge grid of 64x64 pixel boxes. When either the first pixel on Ness crosses a vertical line or when the top or bottom most pixel on Ness crosses a horizontal line, RNG 3 will advance. Note that there are certain times in the game where this mechanic is not active. An example of this is at the beginning of the game where you walk up the cliff to talk to Pokey by the cops. These 64 pixel boundaries are not active during this time.
  • Through door transitions, RNG 3 will advance by 15 units. Falling down a hole, RNG 3 will advance by 30 units.
  • RNG 3 does advance during some stationary cutscenes. When in a moving cutscene, RNG 3 will be turned off.

Additional Facts about RNG

RNG 1 and 2 follow a sort of predictable chain pattern in the way they advance. If RNG 3 is constant, RNG 1 and RNG 2 will always follow the same stream of values as events occur. This means that whether you are in a menu or watching an NPC walk ok screen, RNG 1 and RNG 2 advance in the same pattern. As soon as RNG 3 changes though, this pattern can change.

Going through the same door transitions sometimes do not lead to consistent advancement of RNG 1 and 2, but entering on the same seed will always advance by the same amount.

RNG 3 does not always follow the same pattern. Crossing the RNG 3 lines normally updates by 5 units. When there are repeating identical spawn plates a certain distance away from an RNG 3 line, this causes the game to repeat checking RNG 3 up to 5 additional times depending on the amount of identical spawn plates. Known RNG 3 line values range from 5-10 units.