• Visit Rebornbuddy
  • Change the amount of pulses.

    Discussion in 'Community Developer Forum' started by Exmortem, Mar 23, 2014.

    1. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      Is it possible to override the amount of pulses the bot gives out within a combatroutine? I'm having an issue where I want to be able to heal out of combat, so I modified the combat assist botbase to be able to do so, in turn it's lowered the games performance because RB is constantly pulsing looking at my parties health.

      This is what I use to find a healing target.

      Code:
                      foreach (PartyMember p in PartyManager.VisibleMembers)
                      {
      
      
                          if ((p.GameObject as BattleCharacter).CurrentHealthPercent < 100 && !(p.GameObject as BattleCharacter).IsDead)
                          {
      
      
                              if (healtarget == null || (p.GameObject as BattleCharacter).CurrentHealthPercent < healtarget.CurrentHealthPercent)
                                  healtarget = (p.GameObject as BattleCharacter);
                          }
                         
                      }
      
      Only pulsing that at the bots current rate is lowering my FPS by nearly 20, if I add a check to see if the healtarget is a tank it continues to lower FPS. I'm thinking that lowering the pulses will return some performance.
       
    2. Eterna

      Eterna New Member

      Joined:
      Mar 18, 2014
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      If this is running on a separate thread, it should not affect your games FPS. Is it?
       
    3. Exmortem

      Exmortem Community Developer

      Joined:
      Mar 28, 2010
      Messages:
      799
      Likes Received:
      16
      Trophy Points:
      18
      I'm not running it on a different thread, I guess I should, i'm still very new to programming and have never used threads before. If the routine is calling a variable from a class that's on a different thread will that cause an issue?
       
    4. Eterna

      Eterna New Member

      Joined:
      Mar 18, 2014
      Messages:
      9
      Likes Received:
      0
      Trophy Points:
      0
      I'm not sure how RebornBuddy implements its plugins. If everything is time sharing, including the memory lookups, this might be troublesome. I've been developing a plugin (not a bot-base) and we run on a seperate thread for all our logic. Some of it is fairly advanced, and we don't have any slow downs.

      Accessing variables that are shared between threads is bad -- unless you have a locking mechanism. As long as all your code that affects the same thing runs on the same thread, you will be fine. I just noticed you're using the CombatRoutine, so that shouldn't be an issue... if this still the case I would suggest hooking a profiler remotely to the RebornBuddy EXE and see where the REAL slowdown is. This will show you which method is sucking up with the biggest chunk of your CPU.
       

    Share This Page