Announcement

Collapse

Forum Rules

  • No flaming or derogatory remarks, directly or through insinuation.
  • No discussion, sharing or referencing illegal software such as hacks, keygen, cracks and pirated software.
  • No offensive contents, including but not limited to, racism, gore or pornography.
  • No excessive spam/meme, i.e. copious one liners in a short period of time, typing with all caps or posting meme responses (text/image).
  • No trolling, including but not limited to, flame incitation, user provocation or false information distribution.
  • No link spamming or signature advertisements for content not specific to Dota 2.
  • No Dota 2 key requests, sell, trade etc.
  • You may not create multiple accounts for any purpose, including ban evasion, unless expressly permitted by a moderator.

  • Please search before posting. One thread per issue. Do not create another thread if there is an existing one already.
  • Before posting anything, make sure you check out all sticky threads (e.g., this). Do not create new threads about closed ones.
  • It is extremely important that you post in correct forum section.

  • Balance discussion only in Misc.
  • All art related (such as hero model) feedbacks go to Art Feedback Forum.
  • All matchmaking feedback should go here: Matchmaking Feedback
  • All report/low priority issues should go here: Commend/Report/Ban Feedback
  • No specific workshop item feedback. These should go to workshop page of that item.
  • When posting in non-bugs section (such as this), use [Bugs], [Discussion] or [Suggestion] prefix in your thread name.



In case you object some action by a moderator, please contact him directly through PM and explain your concerns politely. If you are still unable to resolve the issue, contact an administrator. Do not drag these issues in public.



All rules are meant to augment common sense, please use them when not conflicted with aforementioned policies.
See more
See less

API Requests

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    I couldn't see anything on the wiki page about searching for units around a location. Examples of the kinds of problems this might be used to solve:
    Has my team already placed any wards near this location?
    Have I got any summoned friendly units at radiant top T1?
    How many creeps are sieging safe lane T2?
    How big is the neutral stack at location X?

    Being able to filter the query by types and flags would be really useful. I'd imagine it always being able to return a list of friendly units, but non-friendly units would only be returned if not in FoW.

    Stretch goal: Enemies and neutrals would perhaps be cached using the last seen unit information, since I can imagine this might be quite costly if the caching were to be done on the Lua side rather than in C++.

    Comment


    • #32
      Request from my side, what I wanna do. Somethings can already be done/calculated, but I list them anyway.

      Because some bots interact with trees (timber, treant, monkey)
      * Query for nearest tree
      * Query for nearest tree into a direction

      For junglers
      * Coordinates of the jungle camps
      * Query location of the nearest jungle camp
      * Query content of the jungle camp (type, health)

      For offlaners
      Use case: try to stay in XP range:
      Query to nearest creeps, pick out the range creep, get coords, distance max 1300.

      Other
      * Check if hero has tower aggro
      * Check if hero has lane creep aggro
      * Check if hero has jungle creep aggro
      * Check if hero is in lane vision.

      Areas
      I want to incorporate the risk calculation of a location. To prevent that a bot walks uphil, into fog, into a shrine. Some areas are really dangerous, maybe I map them manually.
      * Query nearest shrine
      * Query how deep he is into enemy territory
      * Query if target location is above or below
      * Query if hero or enemy is above or below
      * Patrol an area command
      Last edited by brainzap; 12-13-2016, 03:39 AM.

      Comment


      • #33
        I'm looking for the detail of API reference.
        https://github.com/lenLRX/Dota2_DPPO_bots ----My ML bot work in progress

        Comment


        • #34
          Right now it's a WIP, we all are just keeping an eye on the dev page for updates

          Comment


          • #35
            Few initial thoughts from me after reading though the docs so far; it may be I've missed things that are part of the API already, but I couldn't see obvious functions for them.

            * A way to write to a local file; so I can log data (something similar to a dota_bot_dump_state) to disk and display it on a secondary monitor (so repeatedly overwriting the same file, rather than a log file appending). Probably locked down to only occur on local servers running local (non-workshop) bots
            * Chat commands; When running a local script free text chat messages shouldn't be a problem and provide easy alerting for scripters. Although workshop bots chat is obviously open to abuse, throttling and a limited set of available messages (eg the alt click messages like 'I will purchase > Mekansm' and the message set the default bots use 'Defending mid' etc) should let players know what the bots are doing without the chatlog becoming a twichchat simulator...

            As an incentive to make faster more stable bots it'd be good if the wrapping logic caught long running loops and exceptions on the bot code and stunned the offending bot

            Comment


            • #36
              I had to make a new acount because I lost access to my old email with my old account linked to it.

              Thanks for doing this ChrisC.

              Been hoping and holding out for something like this for a long time.

              I've read over the documentation a couple of times now, but haven't really touched any of it yet. I just have a couple of questions in regards to finding out some things when querying a bot.

              It's possible to query with GetUnitName, would that return npc_dota_hero_tidehunter?

              I'd like to start creating a dynamic item system, but I'd need to run a simple script at the start of the game to determine who are core heroes and who are supporting heroes.

              I see:
              Code:
              GetBot
              GetTeam
              GetTeamMember
              Which of these would be best used to figure that out? If it's at all possible to elaborate on these calls on the wiki, that'd be great, too. As in, what variables it returns.

              The other thing I'm thinking is having using chat wheel commands, and being able to identify when a player uses the chat wheel options.
              So going back to the dynamic items, have a bot use "I will build Mekanism." once the script decides who will build Mekanism on the team.
              But also, say a player pings, "I will build Mekanism", would there be a way of identifying that, so adjustments could be made so a bot that was going to build mekanism would change their item build?

              Comment


              • #37
                Although we can view the bot visibility grid via debug commands, I can't see a way to query that grid for visibility of a location. Maybe a location + radius query that returns the percentage covered by fog of war. That could help determine what areas might need more vision.
                Last edited by SurgeonDiversion; 12-13-2016, 08:36 PM.

                Comment


                • #38
                  The bot api function docs need parameter lists and names. Action_AttackUnit has a boolean for the second arg and I've no idea what it does.

                  I haven't seen the functions available on inventory items anywhere - it'd be nice to have those with params & descriptions as well.
                  To be honest, though, I'm also not sure how to get bots to use items yet.

                  Is there a handy way in lua to define a bunch of utility functions that can be used within different files? It would be nice to have a single place for those.

                  More sample code would be wonderful as well.
                  Attached Files

                  Comment


                  • #39
                    And I need APIs to know whats my level,how much is my damage and other details.

                    local nRadius = abilityDS:GetSpecialValueInt( "dragon_slave_width_end" );

                    And how to get the key of these specialvalues
                    https://github.com/lenLRX/Dota2_DPPO_bots ----My ML bot work in progress

                    Comment


                    • #40
                      Not sure if all status feedback from 'Unit-Scoped' list are only y/n or with more specific info.(Cause it's WIP)

                      For example, if one Lina-bot query 'IsStunned' on an enemy, time remains for the stun is good-to-know for next ability casting. This info can be seen by status bar in this version, also we can check the teammate's current ability level in game so it's not cheating.

                      so
                      - a query to check the remaining time of some cureent status.
                      - also a general timer for countdown(important for many bot actions from cancelling the current casting to check Roshan refreshing time), stronger than tic-toc maybe.

                      (Actually I hope to build a support bot with function 1.placing wards 2.dewards 3.pulling 4.stacking, but seems a good timer is the top requirement now)

                      Comment


                      • #41
                        also a general timer for countdown(important for many bot actions from cancelling the current casting to check Roshan refreshing time), stronger than tic-toc maybe.
                        There's GameTime (starts at 0) and DotaTime (starts at -85 or whatever) that you can use for remembering when rosh was last killed. Not sure if that's more granular than seconds, though, so maybe not that useful for fights.

                        Comment


                        • #42
                          Thanks for the stuff in the thread so far -- we're still scrambling with post-patch bugfixing but I'll be looping back to bot scripting API additions and document updates soon.

                          Comment


                          • #43
                            Originally posted by ChrisC View Post
                            Thanks for the stuff in the thread so far -- we're still scrambling with post-patch bugfixing but I'll be looping back to bot scripting API additions and document updates soon.
                            Thanks for all of this Chris.

                            Desired API:
                            1) Ability to write/read to/from a file (necessary to due true AI via evolution and a feedback system)
                            2) Sleep (there are times I want to do nothing but wait - like waiting on humans to pick heroes so I can counter-pick them)
                            3) Shared Bot Memory or Globals - to compete with Skyped humans my bots must communicate and hive-like mindfulness, I need a way to share knowledge between the 5 bots through either a messaging interface or through stored global values. There might be a way to do this now, but I think any current implementation would just have redundancy of all information in each bot and I don't see how local target information would easily be shareable (I don't think having the bots write text message to allies for parsing would be efficient).
                            4) JUNGLING as a laning mode
                            Last edited by nostrademous; 12-14-2016, 09:15 PM.

                            Comment


                            • #44
                              Might be missing something here, but I'm looking for a way to trace things, to check what a variable gets set as once I set it.

                              Basically, I want something to print to console every frame throught a function Think(). Anyway that I can trace out what a variable is set to via console. I know the script is working, I just want to be able to see when something changes.

                              Comment


                              • #45
                                Originally posted by brainzap View Post
                                Request from my side, what I wanna do. Somethings can already be done/calculated, but I list them anyway.

                                Because some bots interact with trees (timber, treant, monkey)
                                * Query for nearest tree
                                * Query for nearest tree into a direction

                                For junglers
                                * Coordinates of the jungle camps
                                * Query location of the nearest jungle camp
                                * Query content of the jungle camp (type, health)

                                For offlaners
                                Use case: try to stay in XP range:
                                Query to nearest creeps, pick out the range creep, get coords, distance max 1300.

                                Other
                                * Check if hero has tower aggro
                                * Check if hero has lane creep aggro
                                * Check if hero has jungle creep aggro
                                * Check if hero is in lane vision.

                                Areas
                                I want to incorporate the risk calculation of a location. To prevent that a bot walks uphil, into fog, into a shrine. Some areas are really dangerous, maybe I map them manually.
                                * Query nearest shrine
                                * Query how deep he is into enemy territory
                                * Query if target location is above or below
                                * Query if hero or enemy is above or below
                                * Patrol an area command
                                I second the aggro checking requests

                                also an Action_CurrentAction would be useful (either that or isAttacking). currently trying to work out how to have logic not cancel in progress autoattacks because its sending another attack move command
                                https://github.com/ThePianoDentist/t...dentistdotabot Lina bot which pulls small camp when 'laning' (Aim to work on pulling and stacking bots initially)
                                https://github.com/ThePianoDentist/dotabots-ml-tools Parsing data from bot games

                                Comment

                                Working...
                                X