• Visit Rebornbuddy
  • Cyclone ExampleRoutine Modifications

    Discussion in 'Archives' started by Infinite Monkeys, Apr 5, 2015.

    1. Infinite Monkeys

      Infinite Monkeys Community Developer

      Joined:
      Jul 7, 2012
      Messages:
      224
      Likes Received:
      16
      Trophy Points:
      18
      The default ExampleRoutine bugs out a lot with Cyclone, but I made a couple of modifications that seem to make it work alright that people might be interested in. It could be improved massively as the 'best' way to use cyclone now is to right click as close to your character as possible - each time the cyclone starts it damages enemies, so using it at minimum range increases DPS massively. I'm too lazy to code that right now, though, so this'll have to do. In ExampleRoutine.cs:

      Find:
      Code:
      weight -= entity.Distance/2;
      
      var m = entity as Monster;
      if (m == null)
          return;
      Replace with:
      Code:
      if(entity.Distance < ExampleRoutineSettings.Instance.MaxMeleeRange)
          weight += entity.Distance/2;
      else
          weight -= entity.Distance/2;
      
      var m = entity as Monster;
      if (m == null)
          return;
      Find:
      Code:
      // Do not consider inactive/dead mobs.
      if (!m.IsActive)
          return false;
      
      // Ignore any mob that cannot die.
      if (m.CannotDie)
          return false;
      Replace with:
      Code:
      // Do not consider inactive/dead mobs.
      if (!m.IsActive)
           return false;
      
      // Ignore mobs that are too close to cyclone.
      if (m.Distance < 5)
          return false;
      
      // Ignore any mob that cannot die.
      if (m.CannotDie)
          return false;
      You also need to set Max Melee Range to 40.
       
      Last edited: Apr 5, 2015
      WhereIsMyMind likes this.
    2. Notmyreal

      Notmyreal Member

      Joined:
      Apr 22, 2014
      Messages:
      62
      Likes Received:
      0
      Trophy Points:
      6
      I praise you like a god. exactly what i needed <33
       
    3. Infinite Monkeys

      Infinite Monkeys Community Developer

      Joined:
      Jul 7, 2012
      Messages:
      224
      Likes Received:
      16
      Trophy Points:
      18
      No problem :) After some testing, I'd suggest setting Max Melee Range to 40 rather than 50 as I said before, since sometimes the bot mouses over potions otherwise if you are using a small game window.
       
    4. krone6

      krone6 Member

      Joined:
      Jun 11, 2012
      Messages:
      441
      Likes Received:
      0
      Trophy Points:
      16
      Found a bug while using. The CR will ignore anything under 5 and occasionally get stuck. Just watched a yellow hit at my character while he did nothing until he logged out. I'm not a programmer so I can't really do much to fix this besides tweak what you gave me. I'll set 5 to 1 or 2 and see how it works.

      EDIT: Maybe it's not related to that part, still did it when I took that section out.
       
      Last edited: Apr 12, 2015
    5. WhereIsMyMind

      WhereIsMyMind Member

      Joined:
      Oct 12, 2013
      Messages:
      848
      Likes Received:
      5
      Trophy Points:
      18
      krone6,

      pepper the code with:
      Log.InfoFormat("Something like 1.. and continue with 2 and 3.. basically you are setting some points to dump variables.");

      If you are interested in what a value is doing, you can likely use
      Log.InfoFormat("I am interested in this value: {0}", objectName); // for instance objectName can be skill.Name or in your case perhaps m.distance?

      Reading your bug report, I expect the skill cannot target within that close a range, that being 5, thus the routine should be changed to attack a point 10 from your current location, that travels through the mob.

      wimm
       
    6. lyvewyre

      lyvewyre Member

      Joined:
      Jan 3, 2013
      Messages:
      418
      Likes Received:
      12
      Trophy Points:
      18
      I have noticed this too. The code above takes care of this issue in almost all cases by ignoring the mobs that are too close, which is great until there is only 1 left. However, as long as the toon is in motion (I've seen it move back and forth over the same rare). I've only seen the above occur when cyclone has finished its pathing too close the mob and so cannot target it.

      The only solution I can think of is to put a logic in to go into some ignoreception and ignore the ignoring of mobs when only one is in melee range. Like yourself I am not a coder so cannot help, but hopefully this will help the OP who can do some tweaks with this observation.
       
    7. darkbluefirefly

      darkbluefirefly Community Developer

      Joined:
      Nov 8, 2013
      Messages:
      1,927
      Likes Received:
      18
      Trophy Points:
      38
      Hey All,
      Use

      Code:
      Utility.NumberOfMobsNear(m, 30) <= 2
      where 30 is range, so you can use
      Code:
      Utility.NumberOfMobsNear(m, ExampleRoutineSettings.Instance.CombatRange) < 2 
      or whatever you need, add it to
       
    8. Infinite Monkeys

      Infinite Monkeys Community Developer

      Joined:
      Jul 7, 2012
      Messages:
      224
      Likes Received:
      16
      Trophy Points:
      18
      I never had this problem. When all the enemies but one died, the bot leap slammed away from it to continue exploring, at which point it was outside of the ignore range and the bot cycloned back towards it and killed it. I'd try to work something out, but my cycloner is retired as I'm playing HC now and the beta comes out in a week anyway. I'll probably be playing a cycloner at some point in the beta or after release of the expansion, in which case I'll make a more complete and effective cyclone routine. For now, this and the modifications suggested by darkbluefirefly will have to do, sorry!

      e:
      This code doesn't seem like it would make a difference except to break my changes. The point of ignoring mobs closer than 5 is that cyclone doesn't work on mobs at extremely close range - clicking the button does nothing as the skill effectively has a minimum range. My solution was to ignore those mobs, meaning that if there was an alternate target they'd be attacked and if there was no alternate target the bot would try to explore, get further away from the enemy, stop ignoring it and re-engage. Your change retains the behaviour of attacking other enemies if they are within combat range but further away than 5 units (which my modification already did). However, it means that if a mob is the last one remaining and closer than 5 units, the bot will get stuck trying to attack it which is exactly the behaviour that I added this change to prevent. I'm not sure why the bot didn't explore away for krone6, but I don't believe this is a solution.
       
      Last edited: Apr 13, 2015
    9. WhereIsMyMind

      WhereIsMyMind Member

      Joined:
      Oct 12, 2013
      Messages:
      848
      Likes Received:
      5
      Trophy Points:
      18
    10. alpella95

      alpella95 New Member

      Joined:
      Dec 4, 2014
      Messages:
      23
      Likes Received:
      0
      Trophy Points:
      0
      Sadly this doesnt work. My character still get stuck occasionally.
       
    11. darkbluefirefly

      darkbluefirefly Community Developer

      Joined:
      Nov 8, 2013
      Messages:
      1,927
      Likes Received:
      18
      Trophy Points:
      38
      Hey alpella95, define stuck.
       
    12. colt689

      colt689 New Member

      Joined:
      Jan 15, 2010
      Messages:
      15
      Likes Received:
      0
      Trophy Points:
      1
      if(m.Distance <5)
      return null;

      This is what is bugging the bot out with single mobs. The first code snippet is a great fix, but this portion causes it to ignore single mobs unless you're using something like leap.
       
    13. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      No, it ignores mobs too "close" somehow, I don't get why since it'll just search for a better target in this case a raise the %usage.
       
    14. Darox

      Darox Member

      Joined:
      Nov 7, 2014
      Messages:
      353
      Likes Received:
      2
      Trophy Points:
      18
      Man. I wonder if this will be effected by beta at all. I am hoping on making a cyclone for farming. Have to test it out in July I guess.
       
    15. Zalles83

      Zalles83 Member

      Joined:
      Sep 13, 2014
      Messages:
      51
      Likes Received:
      2
      Trophy Points:
      8
      First of all thanks for code replacement, it really helped me alot...... but i still got stucked.

      So to fix the stuck problem, your Single Target Melee Skill Slot should be Flickerstrike..... problem solved. Been watching the bot for 1 hour now, and not one single stuck.

      Edit. Do the same thing for AOE Melee skill Slot.
       
      Last edited: Jun 14, 2015
    16. krone6

      krone6 Member

      Joined:
      Jun 11, 2012
      Messages:
      441
      Likes Received:
      0
      Trophy Points:
      16
      You're a genius! I saw my character flicker twice which would have meant he'd have been stuck twice. I was also in a very narrow hallway which would make it more likely to get stuck. I will post back if I get stuck though it doesn't seem so.
       
    17. Zalles83

      Zalles83 Member

      Joined:
      Sep 13, 2014
      Messages:
      51
      Likes Received:
      2
      Trophy Points:
      8
      Glad i could help :)
       
    18. krone6

      krone6 Member

      Joined:
      Jun 11, 2012
      Messages:
      441
      Likes Received:
      0
      Trophy Points:
      16
      Got stuck in Lunaris near a pillar. Had flicker on both melee and single target melee skill and also tried setting it to fallback. The only reason the bot is still going is due to random mobs coming near me to get me out.
       
    19. Zalles83

      Zalles83 Member

      Joined:
      Sep 13, 2014
      Messages:
      51
      Likes Received:
      2
      Trophy Points:
      8
      Yeah Flicker will only work with mobs around you. If you have problem getting stucked without any mobs around you, just use the plugin "StuckDetection".
       
    20. krone6

      krone6 Member

      Joined:
      Jun 11, 2012
      Messages:
      441
      Likes Received:
      0
      Trophy Points:
      16
      That's the thing, a yellow was right near me and the character did nothing until other mobs showed up.
       

    Share This Page