• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • How often is Combat() called while... in combat?

    Discussion in 'Archives' started by ski, Mar 1, 2010.

    1. ski

      ski Well-Known Member

      Joined:
      Feb 12, 2010
      Messages:
      3,720
      Likes Received:
      48
      Trophy Points:
      48
      I tried changing all my spell casts to a massive switch/case statement, so that the conditions would be checked each time combat() is called (to allow for better reactions instead of just running through all the if-thens sequentially) but there is like 5 seconds between each spell cast.

      Do we know how often Combat() is run through? Is there a better way of doing combat logic then a bunch of if's or nested-ifs? I want it to make a decision on each spellcast, as opposed to a series of sequential decisions.

      With Ifs:
      - Check to see if we should death coil
      - Check to see if we should heal
      - Check to see if we should dot
      - Check to see if we should heal pet
      - Check to see if we should sbolt
      - Repeat

      Now the problem with that is, if I don't meat the conditions for step 1 right as I hit it, I have to run through every other conditional check (and subsequent casts) before I can hit step 1 again.

      What I'd like to happen:
      - Check to see if we should death coil, or heal, or dot, or heal pet, or shadowbolt
      - Repeat

      I'd like it to check to cast before each spell, that way the logic is more intelligent. Is there a good way to do that with the current way Combat is called?
       
    2. ski

      ski Well-Known Member

      Joined:
      Feb 12, 2010
      Messages:
      3,720
      Likes Received:
      48
      Trophy Points:
      48
      I should clarify a bit, I'm trying to implement my spells casting in something of a priority queue. I want things like heals, death coil, and fear to have a higher priority than spells like shadow bolt. Essentially, I want to be able to write my combat section in such a way that no matter what, the highest priority spells will be cast regardless of how far along it is in the Combat() region as a whole.
       
    3. flo84642

      flo84642 New Member

      Joined:
      Feb 17, 2010
      Messages:
      7
      Likes Received:
      0
      Trophy Points:
      0
      You are free to implement a complex behaviourtree for your combat logic, you just have to pulse it inside Combat()
       
    4. ski

      ski Well-Known Member

      Joined:
      Feb 12, 2010
      Messages:
      3,720
      Likes Received:
      48
      Trophy Points:
      48
      Can you go into more detail?
       

    Share This Page