Page 1 of 5 1 2 3 ... LastLast
Results 1 to 10 of 51

Thread: February 9 Bot Update

Hybrid View

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

    February 9 Bot Update

    General Changes:
    • Added support for a GetBotNames() function in hero_selection.lua which can return a table of names that the bots will pick from. Bots using names from this will have (Bot) postfixed to their name.
    • Added IsLocationVisible() function to the global bot script API.
    • Added GetGlyphCooldown() function to the global bot script API
    • Added GetRemainingLifespan() function to the unit bot script API.
    • Added GetNetWorth() function to the unit bot script API.
    • Added GetLastHits() and GetDenies() functions to the unit bot script API.
    • Added GetModifierRemainingDuration() function to the unit bot script API.
    • Fixed bad calculation in the offensive power of Focus Fire (off by a factor of 100).
    • Added some smoothing to GetOffensivePower() and GetRawOffensivePower().
    • GetHeroLastSeenInfo() will now return a valid table when you haven't seen the hero yet, rather than nil.
    • Fixed GetStunDuration(), GetSlowDuration() to take into account whether you have mana to cast.
    • Updated builds for 7.02.
    • Added ABILITY_BEHAVIOR_* constants.
    • Added GLYPH_COOLDOWN constant.


    Action Queue Changes

    Significant changes have been made to how bots manage their actions. There are now three variants of a number of Action functions:
      • Action_AttackMove
      • ActionPush_AttackMove
      • ActionQueue_AttackMove
      • Action_AttackUnit
      • ActionPush_AttackUnit
      • ActionQueue_AttackUnit
      • Action_DropItem
      • ActionPush_DropItem
      • ActionQueue_DropItem
      • Action_MoveToLocation
      • ActionPush_MoveToLocation
      • ActionQueue_MoveToLocation
      • Action_MoveToUnit
      • ActionPush_MoveToUnit
      • ActionQueue_MoveToUnit
      • Action_PickUpItem
      • ActionPush_PickUpItem
      • ActionQueue_PickUpItem
      • Action_PickUpRune
      • ActionPush_PickUpRune
      • ActionQueue_PickUpRune
      • Action_UseAbility
      • ActionPush_UseAbility
      • ActionQueue_UseAbility
      • Action_UseAbilityOnEntity
      • ActionPush_UseAbilityOnEntity
      • ActionQueue_UseAbilityOnEntity
      • Action_UseAbilityOnLocation
      • ActionPush_UseAbilityOnLocation
      • ActionQueue_UseAbilityOnLocation
      • Action_UseAbilityOnTree
      • ActionPush_UseAbilityOnTree
      • ActionQueue_UseAbilityOnTree
      • Action_UseShrine
      • ActionPush_UseShrine
      • ActionQueue_UseShrine
      • ActionPush_Delay (new action for pushing or queuing a delay between other actions)
      • ActionQueue_Delay


    These variants allow you to interact with the action queue. Any of the ActionPush_ variants will set the specified action as the currently active action, but existing action will resume when it completes. ActionQueue_ allow you to queue a number of actions in sequence. The existing Action_ functions will clear the queue entirely and set the specified action as the active action.

    So for example, if you did this:

    Action_MoveTo( X )
    ActionPush_UseAbility( A )
    ActionPush_UseAbility( B )
    ActionQueue_UseAbility( C )

    Your bot will UseAbility B, UseAbility A, MoveTo X, and UseAbility C.

    After each function, the queue will look like this:
    X
    A X
    B A X
    B A X C

    On the other hand, if you did this:

    Action_MoveTo( X )
    ActionPush_UseAbility( A )
    Action_MoveTo( Y )

    Your bot will simply MoveTo Y, because it clears the queue when executed.


    Additionally, some of the Action_ functions don't interact with the queue at all, and are simply immediately executed. They have been renamed to have a ActionImmedate_ prefix:
    • ActionImmediate_Buyback
    • ActionImmediate_Chat
    • ActionImmediate_Courier
    • ActionImmediate_DisassembleItem
    • ActionImmediate_Glyph
    • ActionImmediate_LevelAbility
    • ActionImmediate_Ping
    • ActionImmediate_PurchaseItem
    • ActionImmediate_SellItem
    • ActionImmediate_SetItemCombineLock
    • ActionImmediate_SwapItems


    And there were some revisions to the API related to this change:
    • Removed HasQueuedAction() from the unit bot script API.
    • Removed SetActionQueueing() from the unit bot script API.
    • Added NumQueuedActions() and GetQueuedActionType
    Last edited by ChrisC; 02-09-2017 at 05:36 PM.

  2. #2
    Wow nice. Thanks for these updates Chris.

  3. #3
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    Awesome. Can't wait to put this new Action system to use.

    Does the Delay action take a float input?

  4. #4
    Basic Member
    Join Date
    Oct 2016
    Posts
    247
    will these new action functions affect norm functions?

    I.E. do we have to go through every script we have and manually replace "UseAbilityOnEntity" with Action_UseAbilityOnEntity??

  5. #5
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Cornbane: Yep it takes a float, in seconds.

    Yavimaya: All of the Action_* calls should be the same as before. Some functions that used to be Action_* are now ActionImmediate_*, and those will need to be updated in everyone's scripts.

    The wiki has been updated with today's changes.

  6. #6
    Basic Member
    Join Date
    Oct 2016
    Posts
    247
    ok, so basically any time we arent using action queues in our scripts we dont have to reference them?
    so all the bots that use
    if ( castSDesire > 0 )
    then
    npcBot:Action_UseAbility( abilityS );
    return;
    end
    dont need to be updated because they arent queued?

    : phew :

  7. #7
    Basic Member
    Join Date
    Jun 2013
    Posts
    274
    In your case no, you won't need to update your Action_UseAbility if it doesn't use the queue.

  8. #8
    Basic Member
    Join Date
    Dec 2016
    Posts
    123
    This update is sooooo important! I'm glad it's coming before my next move.

    Did GetNetWorth() and GetModifierRemainingDuration() works on enemy hero?

    Also, I replace my bot code with all the new "ActionImmediate_" and leave those "Action_" where they used to be and now bot not working, with no error message
    Last edited by lunarbreez; 02-09-2017 at 07:04 PM.

  9. #9
    Quote Originally Posted by lunarbreez View Post
    This update is sooooo important! I'm glad it's coming before my next move.

    Did GetNetWorth() and GetModifierRemainingDuration() works on enemy hero?

    Also, I replace my bot code with all the new "ActionImmediate_" and leave those "Action_" where they used to be and now bot not working, with no error message
    Would it be unfair if you know the networth of an enemy? Since it takes into account their current gold + total item cost(in stash/inventory/backpack/courier)

  10. #10
    Basic Member
    Join Date
    Dec 2016
    Posts
    123
    Quote Originally Posted by ninjabunny View Post
    Would it be unfair if you know the networth of an enemy? Since it takes into account their current gold + total item cost(in stash/inventory/backpack/courier)
    let's check what's in enemy hero's inventory when bot saw them maybe more useful. I can calculate the networth of enemy hero myself and we will know if enemy hero has dust/ sentry while bot has invi ability.

Posting Permissions

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