-
-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way of detecting how many mobs are attacking the player? #631
Comments
Gooday. I would like to make a distinction between what kind of status the project can or cannot detect. What cannot detect the addon:
What the addon can detect:
The addon parses the combat log related to the player and and its pet, based on that can expose enemy related info such as
DamageTaken guids sources calculated by the addon and exposed to the c# client. The CombatLog only contains valid state while the player is in combat. |
Similiar issue was brought to my attention in the past. Im just not sure how you can determine a safe direction to run at. If you could further elaborate your plan we might get into a bargain position. My intention is to avoid you spening implementing a Proof of concept or more detailed code which might be flawed from the get go. |
Hey @Xian55 I basically figured out a rudimentary way. So in CombatGoal I am storing safe positions whenever I kill a mob and store it in a queue. Then when I detect that multiple mobs are attacking me, I turn in the direction of last safe position and press forward for 12 seconds. The problem is that when I try to run sometimes I will get stuck on a tree or a hill and the bot is dead again. Is there anyway to leverage the navigation engine to navigate the same way as we do in the route to a safe position back and run till the mobs no longer aggro? |
I could also share my patch but its very rough and work in progress. Do you have any ideas on how to use the navigation engine to move and how to keep running till we detect that the mobs dont aggro us anymore? |
First thing first. Im pretty happy withe the current state of the combat goal. It does simple logic and in my humble opinion it should keep that way. Basically a goal should only have basic task to complete. This way it can be ensured that the code kept clean as it can be. Lets say a new goal is getting introduced which i would call "Flee". The flees only goal would be to get out of combat by running away from the mobs. Flee goal entering criterias
Flee goal update loop
Challanges
Theres a navigation component which can be hooked into any Goal. |
In the upcoming few days i have limited tech access. I will probably going to into the details next week. Ive looked at the code at this state i would not accept this one for sure primarily because while the player moves forward the whole thread is blocked. Neutralizes bot to react to any changes meanwhile |
@Xian55 I agree CombatGoal is probably not the best place to do this. I think FleeGoal will be a good addition. I think safe position should be the location where we killed last set of mobs, because it ensures there is less probability that there are more mobs spawning there. In my opinion, Flee goal should be done when Player in combat and number of mobs attacking > X; where X could be taken from the Json.
Perfect that sounds really good.
Yes that will be perfect if we can get most optimal route that is a straight line and safe. We can use probably strafing and jumping to avoid getting dazed but this could be worked upon in stages.
Navigation component you mean GoalsComponent/Navigation?
Yes for sure dont accept it, its just to show you my idea. I need to figure how to do it better. |
I mean this whole problem can be avoided by killing mobs what your current character can handle easily. Like picking a route which is not densly populated with mobs. There are not many obstacles at the near terrain. Killing enemy mobs which are below 2-3 level lower compare to your character. By keeping in mind these simple principles the following issue should not occour. |
@Xian55 Thats not true, I have tried that a lot and experimented with that idea a lot. For example as a Mage in Dun Morogh, you can farm boars and stuff but even if you are 2-3 levels above and hit into 3 winter wolves you cant kill them. |
Yes implementing strafe movement will be amazing addition.
Yes, correct. |
As a mage in early level you should aim to get your wand asap. Thats going to speed things up. Not to mention you can regen quite a lot of mana as well |
@Xian55 Thats beside the point, I wanna make a bot that I can leave and farm the zones to kill mobs that aggro me and be safe. I will try to experiment with the Navigation Component meanwhile. |
I just want to add another bit of info related why fleegoal should be preferred instead of adding rhe logic in to the combatgoal. There are different modes how the bot can run. For example in Attended* modes the fleegoal should no be enabled. |
@Xian55 one more question do you know how I can check if the mobs have lost aggro or not? |
You exit combat |
so !bits.Combat? Really |
Yessir. On the other hand you check DamageTaken.Count If that value is zero that means while the player is in combat no mob dealth damage to the player. The combatlog compontent automatically cleans up the damage taken guids once the player left combat. |
Hey @Xian55 I was able to use the NavigateComponent in the CombatGoal. This allows me to navigate better, but the problem is while I am running away and when I am out of mobs range, I leave combat and Plan changes to ParallelGoal. But this doesn't give me chance to update the state that we are safe. Can you recommend me how to handle this? Currently my patch: #632 again we dont need to push this, just adding it here for your reference. |
Well the goap goals designed to take care of a singular task only. The CombatGoal designed to respect the combat rotation in the described classconfig action priorities until the target has died. In prior, CombatGoal had no movement implemented beside get into melee range by pressing interact with target. Thats why i suggested to go with a completely separate plan, FleeGoal. Each and ever GoapGoal has a precondition, until that given condition is met, a goal will get execution time. On the other hand your current implementation conflicts with another goapgoal called target pet target. This goal is getting added for hunters and warlocks but in leter expansion mage getting water elemental pet as well. |
Hey @Xian55 thanks for your responses, its super helpful. So right now I have updated it to make it simpler, it just adds navigation to last safe point but seems like the bot stops after a few steps? I am not sure why that is happening. Can you check my code once? Added a new commit here: #632 ; is it because playerNavigation gets overwritten somewhere? I guess we are still in combat goal till the time we are in combat so nothing else should interfere with Player Nav, but I still see whenever the bot tries to run to last safe point it stops after few steps :( . |
Also sometimes even when it escapes the mobs after that while targetting the next mob after it just keeps on moving around and missing all spells. |
Like i said before in order to test your solution in isolation i would strongly suggest to separate your feature into a Flee goal. This way you can ensure that only your logic gets executed and does not interfere with existing code. |
@Xian55 if I would wanna add a new FleeGoal with prerequisite as Combat and Damage taken count greater then X won't it interfere with CombatGoal? |
Also, shall I use the same format as the ParallelGoal for the FleeGoal? |
While you are fighting with a mob, then accidently body pulling X amount of extra mob, what do you want to do? A: Are you feeling comfortable that you can kill them while your are kiting them? B: Do you want to survive without dying, thus running away from possible death situation? A: imples that you want to do multiple goal at once, and and fight the mobs meanwhile running away then when an ability is ready then just look at the mob cast it mid air then run. B: suggest that you want to avoid death at all cost. I have a strong suspicion that you want B. |
Yes, I want B. I wanna be safe at all costs. |
Okay @Xian55 I figured out what was my issue, I wasn't clearing the Navigation point OnExit in Combat. Thats why after the combat the character was doing weird moves. Now its working perfectly as expected! Thanks so much for helping. Now I am thinking to add a FleeGoal to give back to this project. Do you think I should make it like ParallelGoal? |
No, i dont think so. ParallelGoal is not something what you use as a base class build upon. ParalellGoal is primary used to execute actions which may have similar precondition and may or may not have to be executed at once. Like if the player missing mana and hp you can initiate drinking water for mana and eat food at the same time. However awaiting their buff effect are belong to a different goal, wait for drink and wait for food. |
@Xian55 I am tryting to create a new goal FleeGoal as we discussed. Now my issue is that safepoints are not available inside any datastruct in the Goal. Shall I create a goap event for the safepoints? Also, is it possible for us to have a feature to add safe points in the route using the web ui? |
Gooday, i think i mentioned a possible storage which was the GoapAgentState |
Closing due #636 has been merged ! |
Is your feature request related to a problem? Please describe.
Hello, so in some zones with red mobs sometimes the red mobs can spawn behind the bot and the bot already is pulling another mob, in such situations i'd like to script to run away.
Describe the solution you'd like
If its possible to get what all mobs are attacking the player and hopefully their guids.
Describe alternatives you've considered
Looked around in the addon, i couldn't find any way to get the number of mobs attacking the player.
The text was updated successfully, but these errors were encountered: