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

Thread: API Updates/Changes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Basic Member
    Join Date
    Dec 2016
    Posts
    733

    API Updates/Changes

    I've been finding replies and thoughts from @ChrisC in various threads and wanted to amalgamate them into a single point of checking for the latest news regarding upcoming, recently implemented, and planned for next update API changes. If I have missed any please let me know and I will update this post. I hope this will also help remind Valve developers (if there is more than one working of bot scripting API) in communicating changes when patch hits.

    PLANNED FOR NEXT UPDATE:
    • unit-scoped GetCurrentMovementSpeed() for enemy units will return real values when enemy is visible
    • GetAttackTarget() can return nil when GetCurrentActionType() returns ACTION_TYPE_ATTACK briefly, will be fixed

    PLANNED FOR THE FUTURE:
    • GetAbilityByName() and IsFullyCastable() should work with Courier, currently do not - will be fixed
    • Improve IsUsingAbility() to allow for ability/item animation canceling
    • Item Swapping and Item Pickup Code will be fixed for Mode-based bots so the "optimzie backpack" code doesn't always run
    • Update GetUnitPotentialValue() to work of PlayerID for predicting floodplane of unseen heroes
    • COURIER_STATE_AT_SECRETSHOP - to be added
    • COURIER_STATE_AT_SIDESHOP - to be added
    • Proper calculation of many missing abilities and their damages in GetEstimatedDamageToTarget() - check http://dev.dota2.com/showthread.php?...69#post1417069

    WISHLIST: These are things community members mentioned but no word on them from Valve (so no guarantee they will ever be implemented).
    • unit-scoped DamageTakenRecently( fDuration ) - returns table of damages by source (i.e., creep, hero, tower) and amount for each
    • method for setting bot global variables from console (via console commands like "set_bot_global mySuperSecretVar 7")
    • FindAoECone(bEnemies,bHeroes,vBaseLocation,fStartR adius,fEndRadius,fDistance,fProjectileSpeed,nMaxHe alth) Output: heading or normalized vector, count. To mimic FindAoELocation() for cone/line abilities.
    • add a SetPassable( vector, radius, bool) global API function that will affect the path finding code so we can try to avoid areas we don't want to pass through (would be very useful for avoiding enemy AOE zones)

    BUGS: These are current confirmed and unconfirmed bugs in the bot world
    • UNCONFIRMED Using "sv_cheats 1" and then doing "sv_cheats 0" kills the default bots from doing anything once they complete whatever queued actions they were currently doing when sv_cheats 0 was called.
    • CONFIRMED ItemPurchase:Think() gets called every frame when game is PAUSED
    • CONFIRMED Passing a non-table result to "team_desire.lua" -> UpdateRoamDesire() that's has a value greater than 0.0 will auto-crash the client to desktop. Needs to have a catch of bad parameter.

    RECENTLY FIXED/COMPLETED:
    • Fixes as of Jan 31, 2017
    • Courier Actions had an off-by-one error that was fixed
    • GetLocation() works on all buildings now - regardless if they are visible or not
    • GetExtrapolatedLocation() - now returns actual extrapolated location, rather than a delta
    • Action_Glyph() will be disabled if all bots implement a Think() function from consideration by back-end framework
    • COURIER_ACTION_BURST will be disabled if all bots implement a Think() function from consideration by back-end framework
    • COURIER_STATE_AT_BASE - now returns true when idle and in base. COURIER_STATE_IDLE now returns true when idle but not at base.
    • Full Courier Controls - movement especially
    • GetTimeOfDay() API - to help determine night/day cycles
    • API for queuing actions to the ActionQueue
    • Fix Courier/Bot interaction with regards to buying items from Secret Shop. Action_PurchaseItem() now works on courier(s).
    • Rework of Illusions and their handles to prevent bots from being able to detect real hero versus his/her illusions
    • GetEstimatedDamageToTarget() now takes magic resistance into calculation - currently only does this for armor/physical damage
    • GetEstimatedDamageToTarget() the off-by-one error for the amount of abilities/spells that could be cast in a time period is fixed
    • Fixes as of Feb 1, 2017
    • ability-scoped GetCooldown() implemented
    • unit-scoped GetAbilityInSlot( iSlot ) - implemented - I can see this as being super useful for Invoker, Rubick, Doom, KotL, Lifestealer for example. Will eliminate much management on the bot creator's side and make writing bots for heroes easier (especially if ability names ever change in a patch)
    • Handle bugs/errors - fixed - peace has spread through the realm again
    • API function - unit-scoped IsNull() has been added - will check if your unit-object is valid.
    • Fixes as of Feb 2, 2017
    • Fix for IsCourierAvailable() not counting COURIER_STATE_AT_BASE.
    • IsHeroAlive ( iPlayerID ) boolean correctly returns True/False now - STILL BROKEN
    • Fixes as of Feb 3, 2017
    • IsHeroAlive ( iPlayerID ) boolean correctly returns True/False now.
    • Renamed GetActualDamage() to GetActualIncomingDamage() for clarity
    • The return from GetNearbyHeroes() and GetUnitList() should now be consistent for any given area of the map
    • Fixes as of Feb 6, 2017
    • GetUnitList(UNIT_LIST_ENEMY_HEROES) fixed to return only visible heroes again
    • GetUnitList(UNIT_LIST_NEUTRAL_CREEPS), GetNearbyNeutralCreeps(), and GetNearbyCreeps() fixed to return neutral creep lists again
    • Fixed COURIER_STATE_AT_BASE to be set again after returning to base from a mission
    • Fixes as of Feb 8-10, 2017
    • Action Queue API was redesigned
    • Fixed Shrine usage to actually activate the shrine.
    • Fixes as of Feb 13-14, 2017
    • GetNearbyCreeps() works correctly again
    • NumQueuedActions() & GetQueuedActionType() global API are now available
    • Action*_ UseShrine/Delay() now properly terminate if pushed/queued
    • IsAncientCreep() added for units (so you know not to Iron Talon them for example)
    • Fixes as of Feb 15, 2017
    • Action_AttackUnit() and Action_AttackMove() stalling should be fixed if called every frame
    • Fixed default bots and their warding behavior and courier use behavior
    • Fixes as of Feb 17, 2017
    • ability-scoped GetDuration() added
    • ability-scoped GetAOERadius() added
    • Fixes as of Feb 24, 2017
    • global API to Pause() game
    • Actions by bot's minions that result in bot's deletion after action (example: TA's Trap use) fixed
    • Fixes as of Feb 27, 2017
    • GetFlyingCourier(hCourier) added
    Last edited by nostrademous; 02-28-2017 at 10:53 AM.

  2. #2
    Basic Member
    Join Date
    Dec 2016
    Posts
    733
    Updated

  3. #3
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    This one has shipped already in one of the updates:

    GetEstimatedDamageToTarget() will take target's magic resistance into calculation - currently only does this for armor/physical damage

  4. #4
    Basic Member
    Join Date
    Dec 2016
    Posts
    733
    Quote Originally Posted by ChrisC View Post
    This one has shipped already in one of the updates:

    GetEstimatedDamageToTarget() will take target's magic resistance into calculation - currently only does this for armor/physical damage
    Gracias, updated plus some more wishlist from other threads.

  5. #5
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    Oh we've also already fixed the off-by-one thing in GetEstimatedDamageToTarget().

  6. #6
    Basic Member
    Join Date
    Dec 2016
    Posts
    733
    Quote Originally Posted by ChrisC View Post
    Oh we've also already fixed the off-by-one thing in GetEstimatedDamageToTarget().
    Updated.

    I was going to ask the following question: Does GetEsimatedDamageToTarget() assume backswing/animation cancelling?
    However, since you already mentioned that it does not account for interleaving of abilities/right-clicks based on cast points / attack point I assume that it does not b/c you can't attack faster then GetSecondsPerAttack() (you can cancel the backswing, but you then use the extra time to move as you can't attack faster than your attack speed through animation cancelling) so the only time animation cancelling matters is when you interleave casting and right clicking.

    I haven't tested this, but I assume your hero:GetEstimatedDamageToTarget(true, target, <Fuzzed Duration>, DAMAGE_TYPE_PHYSICAL) would return a similar result to my click damage estimation I coded below when tryign various durations for when the dmg would be >= target:GetHealth().
    Code:
    function estimateTimeToKill(hero, target)
        local rightClickDmg = hero:GetAttackDamage()
        local rightClickCastPoint = hero:GetAttackPoint()
        local actualDmg = target:GetActualDamage(rightClickDmg, DAMAGE_TYPE_PHYSICAL)
        
        local numHits = math.ceil(target:GetHealth()/actualDmg)
        return hero:GetSecondsPerAttack()*(numHits-1) + rightClickCastPoint
    end

  7. #7
    Basic Member
    Join Date
    Dec 2016
    Posts
    733
    Updated original post. Couriers (at least for me) seem to not work suddenly. Just sit there and don't deliver items.

  8. #8
    Basic Member
    Join Date
    May 2014
    Posts
    270
    Try to replace IsCourierAvailable() with GetCourierState( npcCourier ) == COURIER_STATE_AT_BASE and see if it works. Maybe IsCourierAvailable() doesn't work anymore. I've been through this before since 31 January Update. I've changed it and it's working until now.

    Edit: Wups, you post it first.
    Edit 2 : @Cornbane. Thanks for helping me on searching my script error.
    Last edited by arz_on4dt; 02-01-2017 at 03:41 PM.

  9. #9
    Basic Member
    Join Date
    Jun 2013
    Posts
    276
    IsCourierAvailable() returns false at all times. I'm assuming the default bots won't use the courier because they depend on the value being true. I have the courier working by checking if it's in the At Base state.

  10. #10
    Basic Member
    Join Date
    Dec 2016
    Posts
    733
    Updates based on latest info.

Posting Permissions

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