What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

any way to lower the cpu usage of db

plat

New Member
Joined
Oct 12, 2011
Messages
35
Reaction score
0
is there any way the buddy team can look into maybe some how to lower the cpu usage of db.
 
If you use AGB make sure you don't touch the TickPerSecond option, leave it at the lowest.
 
Leave it at the lowest = More CPU %, 20 ticks more than 40 i think.
Higher = more cpu

What ? no

You won't notice much performance difference aside from a higher cpu usage if you increase it more than say 15.
20 tps ( ticker per second ) means you need your code to take less than 2ms to execute or it's not gonna be running at 20 tps.
The bot is probablly running at around maybe 12-16 when you set it to anything above 10.
It all depends on how well optimized and profiled your code is.
 
Last edited:
Higher = more cpu



You won't notice much performance difference aside from a higher cpu usage if you increase it more than say 15.
20 tps ( ticker per second ) means you need your code to take less than 2ms to execute or it's not gonna be running at 20 tps.
The bot is probablly running at around maybe 12-16 when you set it to anything above 10.
It all depends on how well optimized and profiled your code is.


The What ? No was to mephuser :)
Your totally right of course on the more TPS = more CPU usage part.

However, 40 TPS should correspond to 25ms per tick and not 2 and with ticks that may end in some part of the BT where theres no action to be taken or that gets aborted because some pointer got invalidated it should take way below than that.
10 TPS is actually too slow for the vaulting / combat portion of AGB, 20 elevates most of the slowdowns 25 makes em disappear completely even if my TreeStart hook returns Success and anything above that is just overkill :)
 
The What ? No was to mephuser :)
Your totally right of course on the more TPS = more CPU usage part.

However, 40 TPS should correspond to 25ms per tick and not 2 and with ticks that may end in some part of the BT where theres no action to be taken or that gets aborted because some pointer got invalidated it should take way below than that.
10 TPS is actually too slow for the vaulting / combat portion of AGB, 20 elevates most of the slowdowns 25 makes em disappear completely even if my TreeStart hook returns Success and anything above that is just overkill :)

Yea brainfart.
I mean 25 if ure running at 40 TPS that's the amount of time the function that ticks the tree will sleep before ticking the tree.
However if you want the bot to actually run at 40 TPS you need to make sure your code takes no time to execute which is quiet impossible.

Also you need to make sure to pause the bot when creating games and taking portals or Diablo might crash if it tries to acess pointers that hasn't been initialized yet.
Here's the code we use for creating new games, feel free to use it.

PHP:
new Decorator(
    ret => ProfileManager.CurrentProfile != null && ProfileManager.CurrentProfile.CreateGameParams != null,
    new Sequence(
        new Action(
            ctx =>
                {
                    var @params = ProfileManager.CurrentProfile.CreateGameParams;

                    ZetaDia.Service.Games.CreateGame(
                        @params.Act,
                        @params.Difficulty,
                        @params.Quest,
                        @params.Step,
                        @params.ResumeFromSave,
                        @params.IsPrivate
                        );
                    Thread.Sleep(1500);

                    // Pause the bot until we make sure we are ingame.
                    BotMain.PauseWhile(() => !ZetaDia.IsInGame || ZetaDia.IsLoadingWorld, 1500);
                })
        )
    )
 
Back
Top