TODO_MOB_AI.txt 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. // eAthena TODO for Monster AI
  2. // -----------------------------------------
  3. // The idea of this file is to write a system to use for mob AI because
  4. // to put it bluntly, our mobs are stupid. If we can pull off some sweet
  5. // AI, we will own the other emulators.
  6. //
  7. // What we have here are 2 columns. I describe them below...
  8. // - 'mode' : Mode is when the monster can attack, like, can it move? can it
  9. // attack first? can it assist other monsters?
  10. //
  11. // - 'AI' : AI is the smart part of the monster. This is how the monster
  12. // will actully go about attacking something. For example we
  13. // could make archer skeletons fire an arrow or 2, then flee
  14. // and fire a few more arrows. Or we could have them avoid other
  15. // classes with range (archers, mages). We could also have mobs
  16. // run when being sniped off cliffs by archers/mages (wont they
  17. // hate that, but in reality, thats what they would do).
  18. //
  19. // The mode flags will be given an ID to the power of 2, (binary style, like
  20. // job id's in the item_db) and added together to make the mode. But before
  21. // the system can be written we need a nice file to explain it. That would be
  22. // this file. So add away, when it looks done, begin the implementation.
  23. //
  24. // Also, if possible, new config file in /conf/. 'mob_ai_athena.conf'. This is
  25. // where mob AI is enabled/disable. And options can be set to allow and dis-
  26. // allow certin modes. Ex: People like the AI, but dont like one options, can
  27. // simply disable THAT AI feature rather then rewriting mob_db to remove it.
  28. //
  29. // I wrote the first modes, C devs, move them around as you see fit for programming.
  30. //
  31. // -Ancyker
  32. //
  33. // (check bottom for more AI ideas)
  34. //
  35. 'mode'
  36. Immobile - Monster can not move, can not be moved (like by archers knockback skills)
  37. Agressive - Monster can attack first (doesn't mean it will, decided in 'AI')
  38. Detect cast - Monster will detect if someone is casting on it, and attack back
  39. Assist - Monster will help other monsters (what monsters it will assist is decided in 'AI')
  40. Looter - Monster will loot items (if 'Agressive' flag is set, it will attack before looting)
  41. No Target Change - Monster will not start attacking another target until the first target is dead or out of range
  42. Passive - Monster will not attack back (ever, unless 'Agressive' flag is also set?)
  43. Detects Hidden - Monster can see hidden players
  44. 'ai'
  45. NoAI - Doesn't do anything (plants)
  46. NoSnipe - Monster will run away if being 'sniped' from a clif by archer, mage, etc.
  47. AttackFlee - Monster will attack, then flee, attack, then flee, etc (Archer Skels, run away, shoot arrow, etc)
  48. AttackRange1 - Will only attack if player is in a set range [0-3] (It's like the player is close, its a threat now)
  49. AttackRange2 - Will only attack if player is in a set range [4-6]
  50. ClassFlee1 - Will run from any player with range (archers, mages, thiefs with bows)
  51. NoviceNoFlee - Will not run if a player is a novice
  52. LevelFlee - Wlll run if player is of a higher level (porings would run from level 99s, AHH DONT KILL ME!)
  53. AvoidPlayer - Will run if it sees any player (So it cancels 'Agressive' flag)
  54. AttackMostDamage - Will attack the player doing the overall most damage
  55. AttackLessDamage - Will attack the player doing the overall least damage
  56. AttackLowestLevel - Will attack the lowest level first
  57. AttackHighestLevel - Will attack the highest level first
  58. WarpLowHP - Will warp if HP is low (how low is low?)
  59. NeverStop - Monster will always be on the move, never stop walking. (Is over-ridden by 'Immobile' flag)
  60. //
  61. // Again, more stuff...
  62. //
  63. // The monster spawns sripts need some more params. some examples...
  64. //
  65. // We have: map,x,y,offsetx,offsety, ...
  66. // What if we added more? To only let the monster move so far off from
  67. // where it was spawned. It could 'guard' an arena, an exit/enterance
  68. // an npc, whatever =).
  69. //
  70. // .... ID,time,time,blah...,mode,WAP
  71. // Have monsters walk a certin path. Waypoint files are your friend.
  72. // If a monster has a WAP (optional) it will walk this path.
  73. // Guardians on patrol? Could be interesting.
  74. //
  75. // Add more if you think of any =)
  76. //
  77. // If you don't like an idea, comment why, dont remove it.
  78. // example: (using this one cuz not sure about it)
  79. //
  80. // // NeverStop - Will/Could cause lag, don't think its a good idea -name
  81. // NeverStop - ...
  82. //
  83. Lupus: (guys, rearrange my ideas or move them as u want)
  84. Some memory - speed optimizations:
  85. There'a big "for cycle" when u look up for a place to mob spawn.
  86. It could be made quite fast:
  87. On server .GAT loading you should make an array with OFFSETS (not even X,Y) of right
  88. places for future mob spawns.
  89. If the waypoints aren't found for the loadied map then you should make at least 1-2 waypoints automatically.
  90. About AI:
  91. EACH map has defined mobs. Your mob should have a flag "healer", "supporter" etc. "weak", "ranged attacker"
  92. and each map should contain an attached list of mobs with their types
  93. when one MVP is hurt it'd look for "helpers", "healers".
  94. And if a mob is almost 0 HP it should look for helpers or look for other mobs ranged attackers
  95. defence. Etc.
  96. Mobs AI should be WRITTEN IN SPECIAL SCRIPTS.
  97. Some default mobs will use the same script.
  98. And some advanced ones will use their own.
  99. MOB-scripts are quite interesting. (remember Robot-Wars game?)
  100. Gulid Wars:
  101. I think guardians should be able to warp from room to room using WARPS like common Players.
  102. Aria's Ideas: (do whatever u want)
  103. We can make aggressive monsters make ambushes, where one attacks and runs away to a huge group of the same monster
  104. instead of dropping 2 x1 items, just drop 1 x2 item
  105. make AI vary inside of a group of monsters (IE 1/2 porings do 1 thing, and the other half do another)
  106. aggressive monsters sould surround enemies, not just blindly attack them
  107. we should also make monsters look as player-like as possible. There should be groups traveling together, or 2 monsters
  108. next to eachother, chatting.
  109. we shouldn't let mobs spawn right infront of people, like in anime or manga. they always walk towards you, or you walk
  110. towards them.
  111. let mob stats vary a little bit - every mob shouldn't be the exact same. if it's stronger it gives more exp, and vice
  112. versa.
  113. have a monster be able to use its drops, and not drop it. like a poring using an apple.
  114. davidsiaw: About that last line, now the player finds a 4 slot pike and a poring takes it and uses it against him... hmm won't that be a lil... frustrating?