Advertisement
Lunneth

Elona+ Custom's AI Tips and Suggestions

Apr 10th, 2018
3,985
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.44 KB | None | 0 0
  1. >>>>>BASICS & STUFF<<<<
  2. Read this: http://elona.wikia.com/wiki/User_blog:AnnaBannana/New_Features_in_Elona_Custom_1.51.4
  3. Then read it again. This stuff is important.
  4. This pastebin will be mostly about tips and examples so you can build your own custom AI.
  5.  
  6.  
  7. >>>>>>>TIPS & STUFF<<<<
  8. Some stuff that people usually don't know/understand even after reading the Anna's guide (or skipping most/all of it):
  9.  
  10. ------//------
  11. -> Custom AI only works when:
  12. *Pet's custom AI is ON ("Toggle AI" in the AI Configuration menu)
  13. *Pet's directive order is Onslaught (default option, you can change it with a item called "Command Flag" or a special action called "Directive")
  14. *Pet is in combat (at least one hostile target on your pet's sight)
  15. ------//------
  16. -> The number of AI lines is based on your pet's Learning attribute.
  17. ------//------
  18. -> The AI will read each line in the list in order (top to bottom), and it will stop reading it as soon as it finds a viable action (going back to the top and reading each line in order again). Always keep this in mind.
  19. Example:
  20. [...]
  21. a) Target Distance = 1 : Attack (Melee)
  22. b) Self Buff != Hero : Hero
  23. [...]
  24. With this AI, your pet will never buff itself with Hero spell if there is an enemy in melee range, because the AI will read the attack line first, confirm that it is viable, complete the action, and repeat the whole process again (read lines from top to bottom until it finds a viable tactic).
  25. If you invert these lines' order (buff on top of melee attack), the pet will always buff itself as soon as the buff expires, even if there is a target in melee range.
  26. ------//------
  27. -> Because of the rule explained above, it's important to have a "fail-safe" tactic as the last line in your pet's Custom AI. This a very important line that all custom AIs should have if you don't want to flood your log with "[pet] doesn't know how to respond to the situation based on the instructions you've given" messages. The basic idea is that "if all previous tactics are impossible, this one must absolutely never fail to work".
  28. Usually movement tactics (Move Forward or Move Away) will almost never fail to work, but you can also use self-buffs (spells or special actions) like [Self HP <= 100% : Cheer] as your fail-safe line.
  29. ------//------
  30. -> Use "*" to move tactic lines around. There is no sound/visual effect for this but you just need to press it once to "pick the line up", press it again to "drop the line".
  31. ------//------
  32. -> Pets will priorize your enemy target over any hostile enemy near them. You can change your main target with "*".
  33. ------//------
  34. -> In case you didn't understand how Pet's Energy/not-Stamina system works, read this example: [>>18719681]
  35. "Swarm cost 27 SP
  36. You get energy pool of the size 5*(27/10), 13 (or 10 if its rounded down, unsure)
  37. Every use of swarm uses 3 energy, every turn recovers 1 energy so effectively you can have ~7 turns of nonstop swarm usage before exhausting energy pool.
  38. Each action has it's own separate energy pool, so if you alternated shadow step and swarm you can use one of those actions almost every turn, but will still exhaust energy pool during long fights. I use fallback attack(melee) or spell/debuff in the end in case if actions are on cooldown."
  39.  
  40.  
  41. >>>>>>>ROUTINES & STUFF<<<<
  42. "Routine" is a set of tactics that are part of your pet's custom AI. I prefer to follow this "model" when organizing my pets' custom AI:
  43. 1. Buff Routine
  44. 2. Support/Debuff Routine
  45. 3. Combat Routine
  46. 4. Movement Routine
  47. 5. Fail-Safe Routine
  48. For example: As soon as combat starts, the pet will buff itself (1), cast debuffs on the target (2), and engage direct combat (3), in this specific order. If the debuff and combat routines aren't viable actions because of the target's distance (too far away to hit it with anything), the movement routine (4) will try to fix this issue. If even the movement action isn't viable for some reason, then the fail-safe routine (5) will give the pet something to do (to avoid error messages flooding your log).
  49. You can organize your AI in any order you prefer, just remember to make it as "logical" as possible.
  50.  
  51. Now I will show you some examples of basic routines that you can use on your pet, and then combine/improve based on your preferences and pets' abilities.
  52. -------------------------------
  53. 1. [Basic Melee Combat Routine]
  54. -------------------------------
  55. a) Target Distance = 1 : Attack (Melee)
  56. b) Target Distance < 6 : Shadow Step
  57. c) Target Distance > 1 : Move (Forward)
  58.  
  59. -> Line A
  60. No mysteries here. Hit it until it dies.
  61.  
  62. -> Line B
  63. The idea here is that your pet will use Shadow Step to jump to your target. This will put your pet in melee range, so lines B and C will be ignored because line A will always be used from now on (as long the target stays in melee range).
  64. Remember that Shadow Step is a special action, and it is possible that your pet will run out of energy for spamming it too much.
  65. If for some reason you want your pet to ignore Shadow Step at a certain range (for example, when the pet is just 2 tiles away from the target), you can add this line on top of Line B: [Target Distance > 2 : And].
  66.  
  67. -> Line C
  68. This is the basic movement line, and also this basic AI's "fail-safe" tactic.
  69. In this AI's case, if all previous actions aren't viable (target's distance is 7 or above, pet ran out of energy, etc), your pet will try to go after the target (and hopefully this will make one of the previous lines a viable action).
  70.  
  71.  
  72. --------------------------------
  73. 2. [Basic Ranged Combat Routine]
  74. --------------------------------
  75. a) Target Distance = 1 : Attack (Melee) OR Move (Away)
  76. b) Target Distance < 6 : Attack (Ranged)
  77. c) Target Distance > 1 : Move (Forward)
  78.  
  79. -> Line A
  80. This is the "in case of melee" situation, it's on top because a ranged pet in melee range may be in trouble, so this is a priority.
  81. "Attack (Melee)" and "Move (Away)" are just some examples of how to deal with this situation, if you have a better plan (like teleportation or Zero Shoot spam) feel free to use it.
  82. You can also simply delete this line if you don't need it. The pet will just use the Line B in melee range. Plus, with the Dancing Wire action, you can just pull enemies away from your pet.
  83.  
  84. -> Line B
  85. Custom AI's ranged attacks have a special rule: Pets will never attack when the range is superior to 5, even if said attack is actually possible (in "non-custom" conditions) with your weapon of choice. If you change this line to
  86.  
  87. something like "Distance != 1", then your pet won't do anything until the target is 5 or less tiles away from your pet.
  88. Remember to consider the ranged weapon’s optimal distance to maximize your pet's chance to hit and damage output, "Distance < 6" may not be the best number for your weapon of choice. Read this for more details: http://elona.wikia.com/wiki/Ranged_Weapons
  89.  
  90. -> Line C
  91. This is the basic movement line, and also this basic AI's "fail-safe" tactic.
  92. The range of choice here is just "1" (melee range) because I just want to show you another example of how the AI works: While melee range may not be the best choice for a ranged pet, your pet won't try to reach melee range because it will be spamming ranged attacks as soon as the target is in Line B's valid range.
  93.  
  94.  
  95. --------------------------
  96. 3. [Basic Wizard Routines]
  97. --------------------------
  98. a) Self MP < 10% : Move (Away)
  99. b) Self MP >= 10% : And
  100. c) Target Status = Wet : And
  101. d) Target Distance < 6 : Lightning Bolt
  102. e) Self MP >= 10% : And
  103. f) Target Distance < 6 : Magic Dart
  104. g) Target Distance > 1 : Move (Forward)
  105.  
  106. -> Line A
  107. When the MP runs out, the pet will just run away from the target. You may change or just delete this line if you want to.
  108.  
  109. -> Line B and E
  110. This is the "anti-suicide" tactic. Pets don't really care about their lack of MP while spamming their spells non-stop, and will probably get themselves killed because of it.
  111. With this line, the tactic in Line C will only be viable if this one is viable too. So, if the pet's MP is below 10%, the AI won't do the tactic in Line C, avoiding an embarrassing death.
  112.  
  113. -> Lines C and D
  114. Line B works as a debuff check: If the target is wet, then the pet will cast Lightning Bolt on it.
  115. But if it isn't wet, then the AI will skip Line D.
  116.  
  117. -> Line F
  118. If Lightning Bolt isn't a viable tactic, the pet will cast Magic Dart instead.
  119.  
  120. -> Line G
  121. This is the basic movement line, and also this basic AI's "fail-safe" tactic.
  122. In this AI's case, we already have another movement tactic way above this one. This way, the pet will always priorize running away from combat if it runs out of MP, and will only try to go after its targets if enough MP is available AND enemies are out of range.
  123.  
  124.  
  125. -------------------------------
  126. 4. [Basic Buff/Debuff Routines]
  127. -------------------------------
  128. a) Self Buff != Speed : Cheer
  129. b) Self MP >= 10% : And
  130. c) Target Buff != Mist : Mist of Frailness
  131.  
  132. -> Line A
  133. Very simple stuff, pet will buff itself as soon as the buff runs out. Cheer isn't a buff on its own, so you need to check either Speed or Hero (Cheer gives you both).
  134.  
  135. -> Line B
  136. The "anti-suicide" tactic, explained in the Wizard Routine (Lines B and E).
  137.  
  138. -> Line C
  139. Similar to Line A, it will make the pet cast a debuff as soon as it runs out.
  140. If the target resists the debuff, the pet will just keep trying it over and over. Keep this in mind.
  141.  
  142.  
  143. --------------------------------------------
  144. 5. [Self-Healing and Clingy Healer Routines]
  145. --------------------------------------------
  146. a) Self MP >= 10% : And
  147. b) Self HP <= 30% : Healing Rain
  148. c) Self MP >= 10% : And
  149. d) Player Distance < 4 : And
  150. e) Player HP < 50% : Healing Rain, Preserve Entity
  151. f) Player Distance != 1 : Move (Forward), Preserve Entity
  152. g) Player Distance = 1 : Cheer
  153.  
  154. -> Lines A and B
  155. "Self-preservation" tactic, pet will heal itself when MP is available and HP is low. Feel free to change the spell and the %values to anything you want.
  156.  
  157. -> Lines C, D and E
  158. Similar to Lines A and B, except the target is the player. Two main differences are the Line D and the "Preserve Entity As Target" option.
  159. Line D exists because Healing Rain have a fairly short range (3 tiles). Without this line, the pet will fail to cast the spell and spam the usual error message.
  160. "Preserve Entity" is required to make Line E work properly. As Anna's blog says, it "will force the entity specified in this tactic to be your pet's target for that action". In this AI's case, the entity is the Player, and the action is Healing Rain. Without this option, the pet will try (and fail) to cast Healing Rain while targeting an enemy (the default target during combat).
  161.  
  162. -> Lines F and G
  163. This is the basic movement line, followed by a fail-safe line.
  164. In this AI's case, since the pet is essencially a healbot, it will priorize staying near the player as much as possible.
  165. And since it's possible that the pet will find itself out of viable tactics (pet have full HP, player have full HP, pet and player are 1 tile near each other), I added an extra line to give it something to do instead of spamming error messages.
  166. You can change Line G to anything you want, as long it is a 100% viable action (like a self-buff). Depending of how your pet works, maybe this line won't even be necessary.
  167.  
  168. Also, as a strategy tip, remember that the "Dancing Wire" special action can be used on pets with no penalties (it never deals damage). If you want more than a simple healbot, you can remove lines F and G and add a combat routine below the healer routine (lines C, D and E). This way the pet will be fighting most of the time, but if you need some pocket healing you just need to pull your pet with Dancing Wire: since the healer routine is on top of the combat routine, it will priorize healing until you have enough HP to be considered safe (in this AI's case, 50% HP or more).
  169. Don't forget that letting your pet kill enemies is the best way to train it (killing stuff will give it tons of EXP, money and crafting materials).
  170.  
  171.  
  172. >>>>>>EXAMPLE & STUFF<<<<
  173. So, how to mix all that stuff above to make a proper AI? Like I mentioned before, I try to put my routines in a specific order (routines and priorities). Here is one basic example of an evolved Black Angel's custom AI.
  174. <Buff Routine>
  175. a) Self Buff!= Boost : Boost
  176. b) Self Buff!= Lulwy's : Lulwy's Trick
  177. c) Self Buff!= Speed : Speed
  178. <Ranged Routine>
  179. d) Target Distance = 1 : Zero Shoot
  180. e) Target Distance < 6 : Attack (Ranged)
  181. <movement/fail-safe routine>
  182. f) Target Distance > 1 : Move (Forward)
  183. <End>
  184. With this AI, when an enemy is spotted, my Black Angel will fully buff herself (first routine) and then try to attack the target (second routine). If the enemy is too far away, she will move forward (third routine) until she is able to hit it with her ranged weapon. If her buffs expire mid-combat, she will stop her attacks to recast them immediately (buff routine is above the ranged routine). It Just Works™.
  185.  
  186.  
  187. >>>>>>STUFF & STUFF<<<<
  188. Some extra random tips for your AI building:
  189. ------//------
  190. -> Buffs can be used to "trick" the Custom AI system, so your pet can temporarily get the required attributes to learn a new spell/special action or unlock a new AI line ("all AI rules will work even if pet loses learning stat after you set up its AI");
  191. ------//------
  192. -> Don't let your pet use Swarm while under Uncontroll state (friendly fire);
  193. ------//------
  194. -> You can avoid getting yourself killed while your pet is brainwashed by using a tactic like [Self Status=Brainwash : Move (Away)];
  195. ------//------
  196. -> Pets can use Provoke with [Target Status != Fury : Provoke];
  197. ------//------
  198.  
  199. -END-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement