Malleoz

Java Program Help

Sep 29th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. Summary:
  2.  
  3. Help! I want to write a program that will list all of the combinations of wasting frames in different spots.
  4.  
  5. In-depth explanation:
  6.  
  7. In Paper Mario: The Thousand-Year Door, Power Bounce is the main attack of choice because of the fact that it allows Mario to deal large amounts of damage to enemies, especially bosses. When Mario Power Bounces, he can perform a certain number of jumps until the game randomly determines that he cannot do another jump. The minimum number of jumps usually varies from boss to boss. For example: Hooktail minimum is 8, Shadow Queen minimum is 6. Like I said, the number of jumps is randomly determined by the game's RNG algorithm. The formula basically dictates that on, and after, the minimum number of jumps there is a 2/3 chance that Mario will not be allowed to jump per jump. Let's focus on Hooktail. There is a 100% chance that you will not get capped on 7 jumps. After that jump, there is a 2/3 chance you will cap, meaning you will deal the 8th jump but then be forced off. But, there is a 1/3 chance at that point that you will not cap. This means that you will deal the 9th jump and not be forced off. In addition, Mario will then bounce a 10th time. At this point, the game will then call for RNG to determine whether or not Mario should cap on that jump. Again, there is a 2/3 chance he will cap and a 1/3 chance he will not cap. Overall, this means that getting a 10 cap was a 1/9 chance. This chance exponentially decreases as Mario deals more jumps. This 2/3 and 1/3 chance is constant.
  8.  
  9. What I want to do with this information:
  10.  
  11. In the TAS, I deal 11 jumps in turn 1 and then 10 jumps in turn 2 in order to kill Hooktail. (Her HP is 20, but my first Power Bounce does not deal damage.) I wondered if a 21 cap would be possible. This would kill Hooktail in one turn as opposed to 2, potentially saving time. Knowing that RNG is represented as a 4 Byte Big Endian, there are 4,294,967,296 different RNG values. The theoretical chance of getting a 21 cap is (1/3)^13 = 0.0000627% chance (1/60 million chance). This says that this cap can only theoretically occur 71 times in the entire RNG algorithm.
  12.  
  13. Some background info: RNG advances quickly whenever text is displayed on screen, so wasting a frame in battle menus will change the RNG value. Why not just waste frames until you get it? I wanna go fast! In the battle, there are 5 different spots at which I can waste frames and get a different RNG result. Note that wasting 2 frames at the same spot will produce a DIFFERENT RNG VALUE than wasting 2 frames across different spots. I need to create a program that can expand all the combinations of wasting frames in 5 different spots so that I know every single combination to test to see if it allows for a 21 cap.
  14.  
  15. Visual representation of what it should look like:
  16. https://i.gyazo.com/a639f4d5eb9881afb2380c05de15f9a1.png
  17.  
  18. Well why don't I just keep writing it out like that to list all the combos? Well, as you can see, as the number of frames I can waste increases, the more combos there are in that set. Once I get to 5 or 6, I can easily miss combinations that can occur. I want this program to display a table of values like this depending on how many frames I want to waste.
  19.  
  20. Hopefully I explained this well enough for people to understand. I don't have much experience with coding, so all I know is that it would probably work best in Java and require a lot of for loops. I really appreciate anyone that can help with this.
Advertisement
Add Comment
Please, Sign In to add comment