Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 25

Thread: [Help] Some scripts will slow my game down.

  1. #11
    Basic Member
    Join Date
    Nov 2015
    Posts
    107
    Personally, I feel like devs should strive to not have the console warning errors for long think()s. I mean, it's there for a reason and is causing issues any time it happens frequently. There are times that are special occasions that can be forgiven, meepo spawning a new clone can bring up a 8-12mS think, but that is 4 times per game max, and still it makes me unhappy. But if you are getting consistent errors, you are doing something very wrong.

    I'm not sure we know what happens exactly if your think() overruns a frame or two (ten?) but if you are having that issue, you should be trying to solve it yourself, so that the behavior is known to you.
    Last edited by ironmano; 04-28-2017 at 10:23 PM.

  2. #12
    Basic Member
    Join Date
    Oct 2016
    Posts
    158
    almost all of my think "errors" are under the 3ms mark and seem to be caused by the purchase think used by EXP, but i think its a pretty standard script, it doesnt look long or over complicated to me.

    im not sure they are even meant to be errors, but i get lots of these during my game -

    Script function 'ItemPurchaseThink' on bot npc_dota_hero_slardar took 2.357ms
    Script function 'ItemPurchaseThink' on bot npc_dota_hero_ancient_apparition took 2.750ms
    Script function 'ItemPurchaseThink' on bot npc_dota_hero_brewmaster took 3.103ms
    it is generally never ability usage thinks, but i have been getting high VM memory usage after i added a script for dodging AOE.
    Last edited by Yavimaya; 04-28-2017 at 10:42 PM.

  3. #13
    Basic Member
    Join Date
    Mar 2012
    Posts
    1,642
    Also, please keep in mind that using 2 bot scripts uses more resources since each team has a separate VM.
    Native bots are faster, but performance degrades after 25-30 minutes.
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  4. #14
    Basic Member
    Join Date
    Nov 2015
    Posts
    107
    Quote Originally Posted by Yavimaya View Post
    im not sure they are even meant to be errors, but i get lots of these during my game -


    it is generally never ability usage thinks, but i have been getting high VM memory usage after i added a script for dodging AOE.
    They are not errors so much as warnings. If you get tons of them, that is bad. They may be 2.5ms each, but what if all 10 bots were to consider that an 'ok' benchmark. Now it takes 25ms just for your bots to decide if they want to buy an item. That's almost two whole frames at 60fps for a func called every frame and then you still have to run all the UpdateXDesire() functions and AbilityLevelUpThink(), AbilityUsageThink(), ItemUsageThink(), CourierUsageThink(), BuybackUsageThink() once for each bot every frame not to mention all your other code sporadically too.

    My point is, the errors are there for a reason, and it is nice that they are. They do not mean you have to re-write that code this second, but it is a reminder that it isn't something you should just let happen frequently. Also, we have no idea how the VM timing works behind the scenes. Some have observed that if you push these warnings too much the bots will slow down their processing or 'get dumber' I think it was put, but we aren't sure how the game outside the VM's or the other VM is affected by a slow script. We don't know if spending so much time will prevent the other teams VM from getting think time, or if it's time sliced somehow. That's is why I suggest doing what you can to keep those errors to a minimum.

  5. #15
    Basic Member
    Join Date
    May 2014
    Posts
    226
    If I get "the more than 3ms warning" like 9 times for all heroes in early 9 minutes game, can it be considered as too much?
    And what is this warning mean "Attempting to call GetNearbyHeroes() on enemies when filtering by bot mode". I use that to cancel SB charge when I want to get enemy and ally info around the target.
    Last edited by arz_on4dt; 04-29-2017 at 09:53 AM.

  6. #16
    Basic Member
    Join Date
    Dec 2016
    Posts
    598
    Quote Originally Posted by arz_on4dt View Post
    If I get "the more than 3ms warning" like 9 times for all heroes in early 9 minutes game, can it be considered as too much?
    And what is this warning mean "Attempting to call GetNearbyHeroes() on enemies when filtering by bot mode". I use that to cancel SB charge when I want to get enemy and ally info around the target.
    You passed a none - BOT_MODE_NONE - for the 3rd parameter when using "true" for 2nd arg. You cannot do that. You are not allowed to know what "mode" your enemies are

  7. #17
    Basic Member
    Join Date
    May 2014
    Posts
    226
    Quote Originally Posted by nostrademous View Post
    You passed a none - BOT_MODE_NONE - for the 3rd parameter when using "true" for 2nd arg. You cannot do that. You are not allowed to know what "mode" your enemies are
    So do I have to use GetUnitList(ally/enemy heroes) and do some loop to check how many allies or enemies within specific distance from the target since I can't pass any parameter to 3rd parameter when using "true" for 2nd arg?
    Or is it because I'm doing this
    Code:
    local myAllies = target:GetNearbyHeroes(1300, true, BOT_MODE_ATTACK)
    So instead of doing that, I have to do this
    Code:
    local myAllies = target:GetNearbyHeroes(1300, true, BOT_MODE_NONE)
    ?

  8. #18
    Basic Member
    Join Date
    Dec 2016
    Posts
    598
    Correct for last code stub.

  9. #19
    Basic Member
    Join Date
    May 2014
    Posts
    226
    Quote Originally Posted by nostrademous View Post
    Correct for last code stub.
    Yep, after I changed it to the last code there is no warning anymore. Thank you

  10. #20
    Basic Member
    Join Date
    Feb 2014
    Posts
    22
    Quote Originally Posted by Yavimaya View Post
    its dota_bot_debug_team (2 for Rad, 3 for dire, 0 for no team), use it whenever. it brings up a panel showing the bots modes and desire.
    i get the think functions showing up in console no matter what, i dont recall it being linked to when i debug_team.

    but give it a go anyway.
    i also think i remember reading something here that if your thinks are getting close to or over 3.0 then you are risking not completing the think in the same frame, so is way too long, but i constantly see 2.x and some over 3.0 and it doesnt seem to directly affect anything at the time.

    Vitor, i dont know sorry. I am a newb really, i am just relaying personal experience.
    Here are some prints I took from the game console (i'm a spectador in this test)":

    https://scontent-gru2-2.xx.fbcdn.net...3d&oe=59BA4413
    https://scontent-gru2-2.xx.fbcdn.net...26&oe=598025CF
    https://scontent-gru2-2.xx.fbcdn.net...e5&oe=59BBF629
    https://scontent-gru2-2.xx.fbcdn.net...15&oe=597D21F0

    I am using the gxcAI script in both teams.
    The slowness started from 10-12 minutes.

    I'll post the "dota_bot_debug_team" prints soon. Just a minute.

    Yavimaya, don't worry! I'm newb too - mainly in programming.
    Last edited by vitor_stwr; 04-30-2017 at 10:32 AM. Reason: Extra Information + Correct wrong information

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •