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

Thread: June 2 Bot Update

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

    June 2 Bot Update

    • Fixed damage/casting callbacks from doubling up when scripts are reloaded.
    • Fixed abilities and units being nil in damage/casting callbacks.
    • Changed GetHeroLastSeenInfo to return a table of {location, time_since_seen} values.
    • Only creeps on team neutral are now in the nearby neutral creeps list.

  2. #2
    I nagged 1 minute too late, oh well, time to fix PubSimulator again!

    Anyway:
    @ChrisC: I finally decided to implement the system I have designed for bots during the next week. I'll need the followings:

    - Another set of lane navigation tools for mid/top/bot that goes through middle of each lane (similar to the one we can access with GetLocationAlongLane, but the current ones are not going through middle of the lane): this is actually more important than you think, I had to send Timber bot both on dire and radiant solely because of this.
    - A more sophisticated navigation function than Action_MoveToLocation that avoids enemy heroes/towers (give me whatever you have for the default bots).
    - Some functions to read chat and write to chat before game starts (in the picking and strategy phases), I want this to communicate with human players

    Following item based function:
    - GetComponents() : returns an empty table if doesn't need any items.

    Following unit based functions:
    - GetTalent(X) 1<=X<=8 or GetTalent(X,Y) 1<=X<=4 and 1<=Y<=2 (I'm aware of AdamQQQ's solution for this, but I'm done implementing hacky solutions that I have to change later on)

    - GetBaseHealthRegen()
    - GetBaseManaRegen()
    - GetHealthRegenPerStr()
    - GetManaRegenPerInt()
    (you probably can guess why I need the above)

    - GetTurnRate() : (how much time it takes for a bot to turn 360 degrees)
    - GetTimeNeededToTurn(direction) : you can give me this one instead of the last one, which would make my life easier (I need this for implementing perfect LH/deny)

    API fixes:
    - Fix client crashes when there is a syntax error (for instance, dota crashes without giving any errors when you write x=y in a conditional statement instead of x==y or when the file in require/dofile doesn't exist, without giving any errors)

    It would be great if you could implement these in the following week, after around 2 weeks from now I have to go to a long period of not being able to spend much time on this again (also it would be great if you could give me an estimate of when you can impelemnt these if ever, so I plan around them!).

  3. #3
    Basic Member
    Join Date
    Dec 2016
    Posts
    684
    Quote Originally Posted by Platinum_dota2 View Post
    Following item based function:
    - GetComponents() : returns an empty table if doesn't need any items.

    API fixes:
    - Fix client crashes when there is a syntax error (for instance, dota crashes without giving any errors when you write x=y in a conditional statement instead of x==y or when the file in require/dofile doesn't exist, without giving any errors)
    I second these personally.

    Regarding client crashes... you get a crash if you try to import a file that doesn't exist (b/c you typo'ed). Console Logs are the only reason why I know what happens.

  4. #4
    Valve Developer
    Join Date
    Sep 2011
    Posts
    1,704
    The movement stuff is tricky, and turn rate is (very) nonlinear, making those pretty hard. Everything else looks fairly easy.

  5. #5
    Basic Member
    Join Date
    Dec 2016
    Posts
    684
    Quote Originally Posted by ChrisC View Post
    The movement stuff is tricky, and turn rate is (very) nonlinear, making those pretty hard. Everything else looks fairly easy.
    ChrisC - it would be amazing if you simply gave us the default movement pathing but allow us to add/remove locations from consideration. As in I can say "addAvoidArea(vLoc, fRadius)" so that when AOE's like Faceless's Chrono are happening I can easily path around it.

    Also, another API that would be amazing is if you can provide a "hasLineOfSight(vLocFrom, vLocTo)" that returns a boolean stating if there is line of sight between two location so we know when we are hiding behind trees easier for lane harassment purposes.
    Last edited by nostrademous; 06-02-2017 at 04:58 PM.

  6. #6
    Basic Member
    Join Date
    Mar 2012
    Posts
    1,861
    Quote Originally Posted by nostrademous View Post
    Also, another API that would be amazing is if you can provide a "hasLineOfSight(vLocFrom, vLocTo)" that returns a boolean stating if there is line of sight between two location so we know when we are hiding behind trees easier for lane harassment purposes.
    That wouldn't work the way you'd think. Obviously, considering "LoS" literally means line-of-sight that assumes vision. That would imply that if they turn around they would NOT have LoS even if standing next to you. I always assumed that running npcEnemyBot:CanBeSeen() means I cna't see them (because of no vision, FoW and LoS) which implicitly means that npcEnemyBot can't see npcBot (the current bot I am "using"). Isn't CanBeSeen() better for what you want ?

    Then again, while CanBeSeen() would work, I can imagine the only downside is if you have a ward or another allied hero, lane or summoned creep. Which would bring me to this suggestion: add a unit-scoped function CanBeSeenBy(hUnit).
    That means I can see npcBot:CanBeSeenBy(npcEnemyBot) and if false, then I can safely TP.


    The way I picture HasLineOfSight() would be something like if I am Pudge or Clock, I can use the function to test a direct hit with the hook. Any other intersection to the target (i.e. returning false because it is behind a unit OR behind trees) means I will not have 100% chances to hook them.

    Unless I am over-analyzing stuff at which point I will shut up
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  7. #7
    Quote Originally Posted by ChrisC View Post
    The movement stuff is tricky, and turn rate is (very) nonlinear, making those pretty hard. Everything else looks fairly easy.
    It is fine, I'll implement the navigation parts later. The turn rate one is a bit weird, I thought the second one (how much time it takes for the hero to turn towards a given direction) shouldn't be hard to implement since you have access to its backend functions.
    Last edited by Platinum_dota2; 06-02-2017 at 07:21 PM.

  8. #8
    Basic Member
    Join Date
    Oct 2016
    Posts
    219
    Quote Originally Posted by Platinum_dota2 View Post
    I nagged 1 minute too late, oh well, time to fix PubSimulator again!


    API fixes:
    - Fix client crashes when there is a syntax error (for instance, dota crashes without giving any errors when you write x=y in a conditional statement instead of x==y or when the file in require/dofile doesn't exist, without giving any errors)
    i get the errors for the require file with vconsole with no crash, i used to get require ability_usage_generic as nil sometimes - it seemed to start for no reason - and its a bit of a hassle, but adding:

    Code:
    if ability_item_usage_generic == nil then return false end;
    to each file that needed it (all hero ability_usage.lua for me) fixed it.


    @ Chris - Thanks for the "neutral minion" fix.
    Last edited by Yavimaya; 06-02-2017 at 07:33 PM.

  9. #9
    Basic Member
    Join Date
    Dec 2016
    Posts
    684
    To be more specific - I can crash the client by mid-spelling a directory name for a required file.

    Code:
    require( GetScriptsDirectory().."/helpers/vector_helper" )
    I typo'ed as the directory was helper and not helpers. Dota2 crashes though on such error.

  10. #10
    @ChrisC

    Can you change the VM so it doesn't spam "RunScriptFunction: UpdateLaneAssignments, ScriptScope 3" at the beginning? It is hard to see my debug messages!

    edit:

    - Add unit:AttackProjectileSpeed() to the list!
    - Also the rotation functions I asked for are not necessary, my laning is fine without them!

    - Jungle camps' names have issues, I'm getting 3 enemy ancient camps in radiant (haven't checked dire yet). Also, it is not clear whether a camp is small, medium or large.
    - I would suggest GetNeutralSpawners(TeamNo,StrTier) -> which returns a table of camps where each camp is a table with a name and location and StrTier is in {'Medium','Large','Small','Ancient'}, I'm not sure if the current version is useful.
    Last edited by Platinum_dota2; 06-04-2017 at 04:38 PM.

Posting Permissions

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