Page 1 of 6 1 2 3 ... LastLast
Results 1 to 10 of 57

Thread: SUMMARY OF ISSUES

  1. #1
    Basic Member
    Join Date
    Dec 2016
    Posts
    180

    SUMMARY OF ISSUES

    Hi
    I create this post to summarize currenlty bugs, suggestions and tips if anyone wants to share with others. let me start with a few:

    - GetRespawnTime() returns incorrect values, not actually time remaining until bot respawn but also death time. and it never be updated after bots death(?) and after buyback( i checked this one )

    - IsSilenced() works fine on all entities in game if team has a vision on them.

    - Detect successful or unsuccessful actions:
    Nomad describe well the title, breifly if actions returns the results of requested action, handling situations will become better. see here

    - HasBuyback() return inverse result: this function never checks the last status of buyback time remaining or gold cost correctly, "not HasBuyback()" present more correct values in game rather than "HasBuyback()"

    -GetNearby functions does not trigger on enemy or N. creeps

    also there is some kind of misundertanding in api here hope anyone could clarify me about that
    Last edited by SIKIM; 09-11-2017 at 12:27 AM.

  2. #2
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,013
    The unit tests that I think should be considered for GetRespawnTime() are:
    • Necrophos ultimate
    • Bloodstone
    • Aegis/WK ultimate
    • WK Aghanim Scepter
    • buyback (you already mentioned it, but I thought I should group them all )


    One workaround I can think of for calculating buyback time is using GetRespawnTime() + the buyback penalty modifier duration (untested!). But this means that you have to catch the hero respawn moment and save the gold penalty duration in advance so you can then catch the death event for the hero and add the penalty duration to the respawn for obtaining a correct value. (that also means we need a hook event for unit death/respawn - but we need Chris on this one - or we just use the Think() function, however, that is more inefficient)
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  3. #3
    Basic Member
    Join Date
    Dec 2016
    Posts
    180
    - GetRuneTimeSinceSeen( rune ) does not count from real last time seen. for powerup runes( and I think bounty runes ) returned value always refresh and change to 0 when time stand on even minutes( 2:00, 4:00, 6:00 ). for example if player does not see specific rune( from the first minute ), in 1:30 function returns "90" but when game time reaches 2:01, GetRuneTimeSinceSeen return "1" not "121".

  4. #4
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,013
    Quote Originally Posted by SIKIM View Post
    for example if player does not see specific rune( from the first minute ), in 1:30 function returns "90" but when game time reaches 2:01, GetRuneTimeSinceSeen return "1" not "121".
    This sounds right. Human players have the same counter cos they see the rune drawn on the map. So a new respawn will "reset" the last time they saw a rune. It was never supposed to count from GameTime() or DotaTime(). When it used to, it was a bug.
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  5. #5
    Basic Member
    Join Date
    Dec 2016
    Posts
    180
    of course it is not a bug just want to mention what will be better.
    anyway, I realize what is going on this function. thanks for your help

  6. #6
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,013
    OK testing in more detail I did find an issue.
    Chris it seems the starting GetRuneTimeSinceSeen() (the one in PRE_GAME) rememebrs the setting from the previous game.

    Unit test:
    • start a game

      Code:
      function Think ()
      	for i = 0, 5 do
      		print("rune " .. i .. " * " .. tostring(GetRuneTimeSinceSeen(i)))
      	end
      end
    • all timers are identical
    • wait for at least 4 minutes without "seeing" any rune
    • go to one and "look" at the rune so the timer for that rune is 0
    • type restart in the console
    • the timer for the rune you saw last game is now 0, the others are 30+


    Seems to me that while you are in PRE_GAME the timer should always be 0, correct? No runes have been spawned yet.
    You can imagine the implications: 3 consecutive games for bots relying on this function will have 3 different inconsistent and incorrect behaviors.

    This little find makes me paranoid about the powerup timer reset SIKIM mentioned too now. Can you confirm that it's a correct behaviour (after 0:00 so while in GAME_IN_PROGRESS).

    Thanks!
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

  7. #7
    Basic Member
    Join Date
    Dec 2016
    Posts
    180
    what I think about this incorrect behavior is just about not refreshing values when we use "restart" command. I had same problem about some internal values I used for following up coach commands in each frame. some actions were performed earlier than the commands were sent by coach and that happens because tables were not refreshed after using "restart" command. for debugging I used to create lobby again and start the game manually.

    Unfortunately the inside of this API does not interact with current DOTA2 client commands

  8. #8
    Basic Member
    Join Date
    Sep 2017
    Posts
    56
    luas require() crashes the client on parse errors for some modules (seems to be the ones required in team_desires and hero_selection, but not the ones in bot_generic)

    GetNearbyHeroes(), GetNearbyTowers() etc sometimes return heroes that can't be seen (near the edge of the vision field). It causes bugs because not all functions are available on the handles and some return weird values. Also allows a bit of cheating because we can tell someone is near. Strangely GetUnitToUnitDistance works on these handles

    GetUnitPotentialValue() is broken, it's pointless using handles of heroes you can see, it doesn't work on cached unit handles or playerids or something, and we (usually) can't get handles to heroes we can't see.

    GetRespawnTime() is broken in that because we cant get handles to dead enemy players, we cant use this on enemies. a global scope function based on playerid would be better


    Documentation wise, this page https://developer.valvesoftware.com/...ing#Rune_Types has wrong descriptions for:
    GetOpposingTeam() mentions parameters that dont exist
    GetNeutralSpawners() which mentions a different set of return values than whats actually returned
    Last edited by Siesta Guru; 09-29-2017 at 07:42 AM.

  9. #9
    Basic Member
    Join Date
    Dec 2016
    Posts
    180
    maybe, you are using require for 2 modules inside each other in each run, or using a chain require of some lua files that made an infinite loop. check this first.

    Im not sure about GetNearbyTowers but Heroes, you are right. just in some frames when u are losing vision on specific entity, for few frames that one were included in returned value of function. I recommend to store last position of every enemy hero in global values.

    GetRespawnTime() still have problem even for allies.

    documentation is still unupdated. seems developers are working on new heroes and dota new updates and patches, rather than bot scripting

  10. #10
    Basic Member
    Join Date
    Mar 2012
    Posts
    2,013
    Quote Originally Posted by SIKIM View Post
    I recommend to store last position of every enemy hero in global values.
    If you want to kill your FPS maybe

    Never use global variables. Perhaps you mean to cache them in a persistent local table, but never ever inside a global value.
    The easiest way to kill your frames is to use global functions and global values.

    Your code should have MAYBE 2-3 global functions which are helpers that are executed in specific points (I'd average maybe a max of 10 calls in 2 minutes), not in time-critical places like Think()
    As for global items, maybe you need an object that is supposed to mimic OOP. But even so, there are ways that you can use to create public objects from private classes

    So for short... if you have more than 3 global functions and maybe 1-2 global objects which are rarely used, then that might be a reason for high memory usage, intensive overhead and low FPS.
    Explanations on the normal, high and very high brackets in replays: here, here & here
    Why maphacks won't work in D2: here

Posting Permissions

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