Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 25

Thread: June 20 Bot Update

  1. #1
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704

    June 20 Bot Update

    • Added dota_bot_long_frame_limit convar for specifying the ms threshold to complain in the console. Defaults to 2.0 ms.
    • Added GetAnimActivity() bot script function. Returns an activity index.
    • Added GetAnimCycle() bot script function. Returns the amount through the current animation (0.0 - 1.0).
    • Added a number of constants for common animation activities. (see wiki for list)
    • Fixed an issue where scripts running on dedicated servers were failing to install correctly if they contained an empty directory.
    Last edited by ChrisC; 06-20-2017 at 03:48 PM.

  2. #2
    Basic Member
    Join Date
    Jan 2012
    Posts
    42
    Quote Originally Posted by ChrisC View Post
    • Added GetAnimActivity() bot script function. Returns an activity index.
    • Added GetAnimCycle() bot script function. Returns the amount through the current animation (0.0 - 1.0).
    Whoooo!

  3. #3
    Quote Originally Posted by ChrisC View Post
    • Added GetAnimActivity() bot script function. Returns an activity index.
    • Added GetAnimCycle() bot script function. Returns the amount through the current animation (0.0 - 1.0).
    OMG, LHing 80 creeps in 10 minutes is actually possible!!! BTW. is there any difference between "ACTIVITY_ATTACK" an "ACTIVITY_ATTACK2" other than how it looks? (i.e do they have different timings?)

    Edit: what is ACTIVITY_ATTACK_EVENT?
    Last edited by Platinum_dota2; 06-20-2017 at 04:40 PM.

  4. #4
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    The difference should just be cosmetic.

  5. #5
    Quote Originally Posted by ChrisC View Post
    The difference should just be cosmetic.
    Good to know, thanks!

  6. #6
    Basic Member
    Join Date
    Oct 2016
    Posts
    219
    Added dota_bot_long_frame_limit convar for specifying the ms threshold to complain in the console. Defaults to 2.0 ms.
    how does this work please?

    will it just remove the warnings and allow long scripts to slow the game but with no warning?
    or will it change the frame length so that long scripts can be completed within each frame?

    if no.2, will it have any real effect on the way the game is played / timings, etc?

  7. #7
    Another question: Do towers have attack animation?

  8. #8
    Damn it! Still can't get to 80:

    LaningRange10MinUpdate.png

    Turn rate and buying items/picking runes are still on the way (if I add enemies that would probably be another 10-20 LH misses)!

  9. #9
    Basic Member
    Join Date
    Dec 2016
    Posts
    684
    I wrote a recursive Item Components Flatten Function.

    The Function:
    Code:
    function InventoryHelper:GetComponents( sItemName )
        local variants = GetItemComponents(sItemName)
        
        -- first container is number of ways to build the items (e.g., Power Treads has 3)
        local comps = {}
        if #variants == 0 then
            table.insert(comps, sItemName)
        elseif #variants == 1 then
            comps = variants[1]
        else
            dbg.pause("[ITEM BREAKDOWN INTO COMPONENTS ERROR]: WE DO NOT HANDLE VARIANT BUILDUPS YET. ", #variants)
            comps = variants[1]
        end
        
        local finalComps = {}
        self:FlattenComponents(finalComps, comps)    
        return finalComps
    end
    
    function InventoryHelper:FlattenComponents(output, input)
        local input_map  -- has the same structure as input, but stores the
                         -- indices to the corresponding output
      
        --print("Input Size: ", #input)
        for indx = 1, #input do
            --print("Input: ", input[indx])
            local components = GetItemComponents(input[indx])
            if #components > 0 then
                --print("Recursive...")
                for i = 1, #components do
                    input_map = {}
                    -- forward DFS order
                    input_map[#input_map+1] = self:FlattenComponents(output, components[i])
                end
            else
                --print("Non-Recursive...")
                input_map = #output + 1
                output[input_map] = input[indx]
            end
        end
        return input_map
    end
    The Test Case:
    Code:
    function Think()
        local hBot = GetBot()
    
        local cmps = inv:GetComponents( "item_tango" )
        print("Components of: 'item_tango'")
        for k,v in pairs(cmps) do
            print(k,v)
        end
        
        local cmps = inv:GetComponents( "item_poor_mans_shield" )
        print("Components of: 'item_poor_mans_shield'")
        for k,v in pairs(cmps) do
            print(k,v)
        end
        
        local cmps = inv:GetComponents( "item_dagon_5" )
        print("Components of: 'item_dagon_5'")
        for k,v in pairs(cmps) do
            print(k,v)
        end
    end
    The Result:
    Code:
    [VScript] Components of: 'item_tango'
    [VScript] 1	item_tango
    [VScript] Components of: 'item_poor_mans_shield'
    [VScript] 1	item_slippers
    [VScript] 2	item_slippers
    [VScript] 3	item_stout_shield
    [VScript] Components of: 'item_dagon_5'
    [VScript] 1	item_staff_of_wizardry
    [VScript] 2	item_circlet
    [VScript] 3	item_mantle
    [VScript] 4	item_recipe_null_talisman
    [VScript] 5	item_recipe_dagon
    [VScript] 6	item_recipe_dagon
    [VScript] 7	item_recipe_dagon
    [VScript] 8	item_recipe_dagon
    [VScript] 9	item_recipe_dagon

  10. #10
    Mine considers if you have bought some of the components beforehand and removes the branches from the tree. If you want to fix some of the priority problems (for instance buying arcane before mek for greaves, or boots before energy booster for arcane boots), and not buy some items early game items (like bracer/nulls) more than you actually need, I suggest doing that!

Posting Permissions

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