Results 1 to 5 of 5

Thread: human understanding vs bot's understanding of the game

  1. #1
    Basic Member
    Join Date
    Jan 2017
    Posts
    6

    human understanding vs bot's understanding of the game

    Hello guys, I am just starting on writing bots. I have read through the API but some questions still seem a little unclear to me:

    1. How does a bot know a spell is cast from the fog? For example how does a bot know mirana shoots an arrow towards him if mirana is hiding in the fog and an arrow is flying towards him?

    2. How does a bot know the enemy's action? For example whether the enemy is casting a spell, which spell the enemy is casting, whether the enemy is attacking, etc.? Could a bot tell which raze the SF is using?

    3. Does a bot know about the animation / attack target of an enemy unit?

    4. Does a bot know the opponents' current skill build?

  2. #2
    Basic Member
    Join Date
    Dec 2016
    Posts
    18
    Hi, to answer your questions:

    1. I'm not sure if there's already a capability for this. Hopefully someone will correct me, but I think Mirana's arrow can be considered as a unit. If that's the case, you can detect it but still needs effort in coding.

    2. As far as I know, you can't tell which raze SF is doing. But there's a method IsUsingAbility and IsChanneling. I only tried them using my own bot and not the enemy so I'm not sure if those method will work on them.

    3. There's a method GetAttackTarget if that's what you need. But last time I tried it, it only works on ally units.

    4. No

  3. #3
    Basic Member
    Join Date
    Jun 2013
    Posts
    275
    The defaults have their limits but you can make custom scripts to account for most of these. The main thing is it will be next to impossible to script the bots to think like we do.

    There is some way to detecting things like Arrow, Hook and Illuminate. I don't know how in the API, but I've done a lot of testing and have seen that default bots do make an attempt to move out of the way when these abilities appear from out of sight. Most times there isn't enough time to get out of the way, but they make the attempt and have gotten out of the way. Full on moves as well, not just luck via the standard lane jerking. If they see the cast in plain sight they just move instantly.

    With Raze: Whenever a SF is going to Raze, you never KNOW which one it's going to be. You can ASSUME which one, but you won't know. The SF user could get them mixed up and use the close range instead of far range, and you wouldn't know until after the animation. We don't have the psychic ability to identify which one of the 3 is being cast, so it's reasonable to say that bots shouldn't either. You can put it in your script to assume the right one will be cast. In terms of different spells and attacks, you can detect nearby units, a specific target, etc and use API elements to detect what they're doing.

    Knowing the attack target of an enemy is something you also don't KNOW. You, once again, can assume. If there are multiple creeps within last hit range, it would be unreasonably unfair for a bot to know each time which one is being targeted.

    Knowing the skill build at face value isn't available and probably shouldn't be. There are ways to script bots knowing which levels they could after seeing them used. Though it's not completely accurate, much like human assumption.

  4. #4
    Basic Member
    Join Date
    Jan 2017
    Posts
    6
    Thanks guys for the responses! I would like to follow up on the following points:

    1. Spell cast from out of sight: Mirana's arrow might be a unit, but what about other spells that have visual effects such as dragon slave, light strike array, etc.? I don't think they are all modeled as units. In that case, Cornbane's suggestion might work, but still seems tedious and pron to error (compared to how easy and clear it is from a human's perspective).

    2. Spell casting animation: Could a bot identify spell casting animation? Could a bot know, for example, that lina is casting light strike array before the spell takes effect?

    3. Attack animation: Could a bot identify the start and end of an attack animation? This concept is crucial in human players' laning phase: if a unit is within two hits range, whoever finishes attack animation first might indicate that he is attacking that unit.

  5. #5
    Basic Member
    Join Date
    Jun 2013
    Posts
    275
    Quote Originally Posted by 3kmmr View Post
    Thanks guys for the responses! I would like to follow up on the following points:

    1. Spell cast from out of sight: Mirana's arrow might be a unit, but what about other spells that have visual effects such as dragon slave, light strike array, etc.? I don't think they are all modeled as units. In that case, Cornbane's suggestion might work, but still seems tedious and pron to error (compared to how easy and clear it is from a human's perspective).

    2. Spell casting animation: Could a bot identify spell casting animation? Could a bot know, for example, that lina is casting light strike array before the spell takes effect?

    3. Attack animation: Could a bot identify the start and end of an attack animation? This concept is crucial in human players' laning phase: if a unit is within two hits range, whoever finishes attack animation first might indicate that he is attacking that unit.
    1. Sacred Arrow is technically a unit, like Earthshaker's wall. They have bounding and collision sizes. Abilities like Hook and Illuminate don't, so I'm still trying to figure out how the default bots identify them from the shadows. The thing is, too, some of the abilities like Dragon Slave move so fast and have a shorter range limit that if they came from the shadows there would be no possible way of moving out of the way by the time they become visible. So a bot MAY react, but once the spell hits they go back to normal. So it's really hard to tell if they actually begin to dodge them or not. At least from what I've tried to test. But there has to be something there, because that something needs to collide with unit hit boxes to determine if the spell hit or not.
    2. Yes. It requires a few if statements and for loops but it is doable. Functions like IsChanneling() and IsUsingAbility() start returning once a hero commits to an ability.
    3. The API functions that get info based on attacks work only for allies from what I've tried.

Posting Permissions

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