Advertisement
Prof9

BN6 OldStove AI

May 12th, 2016
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.52 KB | None | 0 0
  1. Basically:
  2. - Move to random adjacent panel.
  3. - Target panel 3 panels in front of MegaMan.
  4. - Move towards target until MegaMan is in range or cannot move further (directly) towards target.
  5. - Attack.
  6. - Repeat.
  7.  
  8.  
  9. Notes:
  10. - Before the first move to the random adjacent panel, the current position is saved (let's call it L).
  11. Next time it does the first move to a random adjacent panel it will prefer not to move back to L.
  12. - If confused or blinded, the attack cooldown delay is always the same as the V1's (120 frames).
  13. - If confused, the attack range is only 1 square ahead. However, the range check is still 3 squares ahead.
  14. - When moving towards target panel, vertical movement has priority over horizontal movement.
  15. - When moving towards target panel, will never move away from target panel (so it can't always go around holes).
  16. - The confused/blinded behavior depends on WHEN the virus is confused/blinded:
  17. - If confused/blinded while attacking, will continuously attack immediately after moving to random adjacent panel.
  18. - If confused/blinded while moving, will keep moving to random adjacent panel until MegaMan is in range. After attack it falls into the pattern above.
  19.  
  20.  
  21.  
  22.  
  23.  
  24. Simplified version with confused and blinded:
  25.  
  26. RandomMovement (start):
  27. - Select a random adjacent panel A to move to, excluding L, unless L is the only panel it can move to.
  28. - If no such panel could be found, go to Attack.
  29. - Save current position L.
  30. - Move to selected panel A.
  31. - If blinded, go to Attack.
  32. - Otherwise, go to TargetEnemy.
  33.  
  34. TargetEnemy:
  35. - If MegaMan is in range of 3 panels ahead, go to Attack.
  36. - Set the target position T to the 3rd panel in front of MegaMan.
  37. - Go to HomingMovement.
  38.  
  39. HomingMovement:
  40. - If MegaMan is in range of 3 panels ahead, go to Attack.
  41. - If confused or blinded:
  42. - Move to random adjacent panel.
  43. - If not possible, go to Attack.
  44. - Otherwise, go back to HomingMovement.
  45. - If OldStove is on target position T, go to Attack.
  46. - If OldStove can move vertically towards T:
  47. - Do so.
  48. - Go back to HomingMovement.
  49. - If OldStove can move horizontally towards T:
  50. - Do so.
  51. - Go back to HomingMovement.
  52.  
  53. Attack:
  54. - If confused or blinded, set attack cooldown to 120 frames.
  55. - Otherwise, set attack cooldown to the default based on virus level.
  56. - If confused, set attack range to 1 panel ahead.
  57. - Otherwise, set attack range to 3 panels ahead.
  58.  
  59.  
  60.  
  61.  
  62.  
  63. Expanded version:
  64.  
  65.  
  66. RandomMovement (start):
  67. - Find all adjacent panels that OldStove can move to.
  68. [_][_][_]/[_][A][_] O = OldStove
  69. [_][_][_]/[A][O][A] M = MegaMan
  70. [M][_][_]/[_][A][_] A = adjacent panel
  71. If no such panel exists (i.e. OldStove cannot move):
  72. - Go to Attack.
  73. If one such panel exists:
  74. - Move to it.
  75. If multiple such panels exist:
  76. - Exclude L.
  77. - Move to a random adjacent panel (equal chance for each).
  78.  
  79. - Save the last position (before moving) as position L. (So OldStove will prefer not to do its first random movement to L next time.)
  80. [_][_][_]/[_][O][_]
  81. [_][_][_]/[_][L][_]
  82. [M][_][_]/[_][_][_]
  83.  
  84. - Check if blinded.
  85. If yes:
  86. - Go to Attack.
  87.  
  88. - Go to TargetEnemy.
  89.  
  90.  
  91.  
  92. TargetEnemy:
  93. - Check if enemy (MegaMan) in following range:
  94. [_][R][R]/[R][O][_] R = range
  95. [_][_][_]/[_][_][_]
  96. [M][_][_]/[_][_][_]
  97. If yes:
  98. - Go to Attack.
  99.  
  100. - Set target position T to 3rd square in front of target (regardless of panel color).
  101. [_][_][_]/[_][O][_]
  102. [_][_][_]/[_][_][_]
  103. [M][_][_]/[T][_][_]
  104.  
  105. - Go to HomingMovement.
  106.  
  107.  
  108.  
  109. HomingMovement:
  110. - Check if enemy in following range:
  111. [_][R][R]/[R][O][_] R = range
  112. [_][_][_]/[_][_][_]
  113. [M][_][_]/[T][_][_]
  114. If yes:
  115. - Go to Attack.
  116.  
  117. - Check if confused or blinded.
  118. If yes:
  119. - Move OldStove to random adjacent panel. Equal chance for each panel that qualifies. L is not affected.
  120. [_][_][_]/[A][O][A]
  121. [_][_][_]/[_][A][_]
  122. [M][_][_]/[T][_][_]
  123. If no such panel exists (i.e. OldStove cannot move):
  124. - Go to Attack.
  125.  
  126. - Go to HomingMovement.
  127.  
  128. - Check if OldStove current position is T.
  129. If yes:
  130. - Go to Attack.
  131.  
  132. - Check if OldStove can move vertically towards T.
  133. If yes:
  134. - Move OldStove vertically towards T. L is not affected.
  135. [_][_][_]/[_][O][_] N = new position
  136. [_][_][_]/[_][N][_]
  137. [M][_][_]/[_][_][_]
  138.  
  139. - Go to HomingMovement.
  140.  
  141. - Check if OldStove can move horizontally towards T. L is not affected.
  142. If yes:
  143. - Move OldStove horizontally towards T.
  144. [_][_][_]/[N][O][_] H = hole
  145. [_][_][_]/[_][H][_] N = new position
  146. [M][_][_]/[_][_][_]
  147.  
  148. - Go to HomingMovement.
  149.  
  150. - Go to Attack.
  151.  
  152.  
  153.  
  154. Attack:
  155. - Check if confused or blinded.
  156. If confused:
  157. - Set attack cooldown to 120 frames (2 seconds).
  158. - Set attack range to 1 panel ahead.
  159. [_][_][_]/[_][_][_]
  160. [_][_][_]/[R][O][_]
  161. [_][_][_]/[_][_][_]
  162.  
  163. If blinded:
  164. - Set attack cooldown to 120 frames (2 seconds).
  165. - Set attack range to 3 panels ahead.
  166. [_][_][_]/[_][_][_]
  167. [_][R][R]/[R][O][_]
  168. [_][_][_]/[_][_][_]
  169.  
  170. If no:
  171. - Set attack cooldown to the following:
  172. V1 120 frames (2 seconds)
  173. V2 100 frames (1⅔ seconds)
  174. V3 80 frames (1⅓ seconds)
  175. SP 60 frames (1 second)
  176. Rare 80 frames (1⅓ seconds)
  177. Rare2 40 frames (⅔ seconds)
  178. - Set attack range to default (3 panels ahead).
  179. [_][_][_]/[_][_][_]
  180. [_][R][R]/[R][O][_]
  181. [_][_][_]/[_][_][_]
  182.  
  183. - Perform attack.
  184.  
  185. - Go to RandomMovement.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement