+ Reply to Thread
Results 1 to 4 of 4

Thread: D/P/Pt Battle RNG research

  1. #1
    Member
    Join Date
    Jul 2010
    Age
    31
    Posts
    1

    D/P/Pt Battle RNG research

    I am a TAS speedrunner looking to try and complete D/P/Pt games as fast as possible, but would like some info on what RAM addresses to look at regarding the battle RNGs of the games - stuff related to critical hits, accuracy of attacks, Quick Claw activation, and so on. The notable breakpoints page mentions a lot of invaluable addresses to look at, but almost nothing on the battle system at all. Any help would be appreciated in this area.

    Thanks in advance

  2. #2
    Member Translation ContributorDeveloperROM Researcher
    Join Date
    Apr 2009
    Age
    24
    Posts
    305

    Re: D/P/Pt Battle RNG research

    I remember a long time ago when I was poking around in RAM I found a value that effected "hax" in battles. Freezing it at 0 caused everything to always fail baring moves with 100% accuracy from landing, and setting it to 0xFFFFFFFF caused everything that could happen to happen.

    I didn't save the offset, but I can try to look for it again.

  3. #3

    Re: D/P/Pt Battle RNG research

    Super old bump there Kazo

    The Battle RNG calculations probably carried over from gen 3, which you can see at TASVideos by FractalFusion.
    Spoiler
    In battle: Accuracy
    The game determines attack accuracy right before it says "X used attack", if the attack does damage. If the attack does not do damage, the game determines it after it says "X used attack".
    When the game rolls for attack accuracy, the game will cycle the RNG 3 times on that frame.

    Code:
      xxxxxxxx
      xxxxxxxx
      aaaaxxxx   Attack hit: aaaa mod 100 < acc%     otherwise miss
    In battle: Critical hits
    The game determines critical hits a few frames after the message "X used attack", provided that the attack does damage, and the attack did not miss, and it is not a tutorial battle where the game forbids critical hits.
    When the game rolls for critical hits, the game will cycle the RNG 3 times on that frame.

    Code:
      xxxxxxxx
      xxxxxxxx
      xxxaxxxx   Critical hit: a==0
    This assumes a 1/16 chance of a critical hit. It does not describe situations where the critical hit ratio is raised to be greater than 1/16, or the target has the ability Battle Armor (no critical hits).

    In battle: Damage variation
    For almost all attacks, the amount of damage that an attack does varies between about 85% and 100%. The game determines damage variation three frames after it checks for critical hit.
    When the game rolls for damage variation, the game will cycle the RNG 3 times on that frame.

    Code:
      xxxxxxxx
      xxxxxxxx
      xxxaxxxx    Damage variation, max: a==0   min: a==15
    The lower the number, the more damage the attack does.
    It is not known for certain if 0000 is the only value that does max damage (a property in the first two generations where only the "best" value yields max damage).


    Gen 3 used the main LCRNG for the battle determinations, and iirc so did gen 4.

    Gen 5 uses a new seed generated when the battle scene is loaded (after the flash), so it'd be much harder to cheat with.


    %100 and *100 respectively for accuracy, %16 and *16 for everything not a multiple of 5%.
    Last edited by Kaphotics; Sep 7th, 2011 at 11:24 PM.

  4. #4
    Member Translation ContributorDeveloperROM Researcher
    Join Date
    Apr 2009
    Age
    24
    Posts
    305

    Re: D/P/Pt Battle RNG research

    Quote Originally Posted by kaphotics View Post
    Super old bump there Kazo
    oops sorry, should have paid attention to the date.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
PPN Top 50