Advertisement
LilPinkus

Ridley 4 x-factor opener

Aug 21st, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. Timeline of Ridley AI during 4 x-factor opener
  2. ----------------------------------------------
  3.  
  4. Can follow it at https://milde.no/public/sm/ridley_diagram.png if ya want.
  5.  
  6. A35B Some init stuff at the start.
  7. |
  8. A377
  9. |
  10. A389
  11. |
  12. A3DF
  13. |
  14. A455
  15. |
  16. A478
  17. |
  18. A354
  19. |
  20. B2F3 Accelerates Ridley to a specific coordinate in top left corner
  21. |
  22. B321 Choose next AI that Ridley should do.
  23. |
  24. | Would need to jump up to Y=$160 or higher to have a chance of choosing BAB7. Or spin jump to move on to B5C4.
  25. | Since we're on the floor, standing still, B6A7 will always be chosen (see full logic below).
  26. |
  27. B6A7 Pogo startup
  28. |
  29. | Checks if Ridley Y>$120 (meaning Ridley is closer to the floor) and accelerates to $120 if it is.
  30. | If it's not, we go to B6DD.
  31. |
  32. | Since B2F3 (see above) already put us at Y<$120, we go to B6DD immediately.
  33. |
  34. B6DD Pogo startup 2
  35. |
  36. | Accelerates towards $120 for 32 frames. Since Ridley has an upward momentum at this point, this only serves to
  37. | slow the upward momentum down - he will be at Y=$89-ish while still moving slowly upwards after 32f.
  38. |
  39. | After the deacceleration it does some tail AI & sets Ridley's speed for the pogo (4 different speeds at random),
  40. | and then moves on to B70E.
  41. |
  42. B70E Pogo downwards
  43. | 1. Attempts to grab Samus (unless Samus is spinjumping or damage boosting, which we are not).
  44. | If Samus is grabbed, it moves on to BB8F and returns.
  45. | 2. Moves the tail downwards and checks if it collides with a block.
  46. | If it doesn't, it just returns and does the same next frame too.
  47. | 3. If Ridley's tail does collides with a block, it sets new "pogo speed" (4 different speeds) and goes on to B7B9.
  48. |
  49. | At this point in the opener, Ridley's tail is inside the left wall, making the AI go to B7B9 immediately.
  50. | If you jump up, you can see the tail has smoke around it, just like when the tail hits the ground in a normal pogo.
  51. |
  52. B7B9 Pogo upwards
  53. | 1. If Samus is high up in the room (Y<$160), it will move on to B321.
  54. | 2. It updates Ridley's speed (deaccelerates) and checks if Ridley is moving downwards or not by now. If he is,
  55. | we move on back to B70E.
  56. |
  57. | At this point in the opener, Ridley is still moving upwards (but deaccelerating) when this AI script is hit first,
  58. | so this serves to deaccelerate Ridley into a pogo. This takes around 30f.
  59. |
  60. B70E See above. But this time, the tail is not inside the wall, and the next AI change will happen when the tail
  61. | collides with the blocks on the ground.
  62. |
  63. B7B9 See above.
  64. | This time in the opener, you should be higher then Y=$160 in the room (jumping up for the 2nd x-factor),
  65. | thus the AI will simply move on to B321.
  66. |
  67. B321 See above. But I'll extend this comment to explain the full logic.
  68. |
  69. | This routine first sets up an array of 8 AI scripts, and chooses from that array at random. Which array is used is
  70. | decided like this:
  71. |
  72. | 1. If Samus is spin jumping, the array contains 8x B5C4 (Hover).
  73. | 2. If Ridley is dead, the array contains 8x BAB7 (Lunge).
  74. | 3. If Ridley has less than 14400 health, the array contains 4x B6A7 (Pogo) and 4x B441 (Swoop).
  75. | 4. If Samus is below Y=$160 (ground level or slightly above), the array contains 8x B6A7 (Pogo).
  76. | 5. If Samus is NOT spin jumping, grappling or damage boosting, the array contains 6x BAB7 (makes him move upwards)
  77. | and 2x B6A7 (Pogo).
  78. | 6. If she is, the array contains 4x B441 (Swoop) and 4x B6A7 (Pogo).
  79. |
  80. | At this point in the opener, all you need to do is to make sure you are high enough. That's all. There's no X
  81. | coordinates that works better than others, the charging of the 2nd x-factor does not matter, you don't need to
  82. | hit a very specific Y area or angle down, just go high enough and you get the 75% chance of BAB7, which is the
  83. | desired AI script for pulling off a 3rd x-factor.
  84. |
  85. BAB7 Lunge
  86. |
  87. | Does a lot of decisions based on things like whether Ridley is facing Samus, whether Samus is above Ridley, whether
  88. | they are closer than 2 blocks from each other, whether Ridley is dead, whether a power bomb just went off etc.
  89. | Since you should be above Ridley at this point
  90. |
  91. B3EC Sets up a timer (to 0x80) and moves on to B3F8
  92. |
  93. B3F8 Decrements the counter, and if it's 0, moves on to B321. So we do the following for a maximum of 0x80 frames:
  94. | Accelerates Ridley towards top left corner. Once he hits it, move on to B321.
  95. |
  96. | This movement is what enables us to get in a 3rd x-factor.
  97. |
  98. B321 See above.
  99.  
  100. At this point in the opener, we yet again get the 75% chance of BAB7 and 25% chance of B6A7 (re-pogo).
  101. If we get BAB7, we can pull off a 4th x-factor. If B6A7 he will pogo and we can't.
  102.  
  103. Chance for getting 3 x-factors: 75%
  104. Chance for getting 4 x-factors: 56.25%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement