-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve farming #119
Improve farming #119
Conversation
1. Remove commented out code 2. Remove debugging code for faceless void 3. Remove obsolete shrine / is T3 destroyed code
Will add again in another commit; this makes the diff more readable
1. Move refresh to before ancient check so it always runs when it should 2. Simplify 0:30 time check 3. Change starting value of numCamp and add clarifying comment 4. Remove unused variables, including "minute"
1. Consolidate conditions required for farming 2. New function Unit.WasRecentlyDamagedByEnemy in MiraDota.lua - Checks if unit was damaged by enemy team - Fixes issue with (incorrectly) detecting self damage interrupting farming 3. Removed unhelpful conditions - check for channeling - check if current action is "idle" 4. Remove setting preferredCamp = nil in GetDesire, this is handled in OnEnd 5. Add comments 6. Use constant BOT_MODE_DESIRE_NONE instead of "0.0"
1. Replace obsolete manual stack points with simple calculation - Fixes running off and tp'ing instead of stacking - Fixes runtime error for camp index > 18 2. Uses new function utility.GetUnitsTowardsLocationGeneric that works on raw locations - Update GetUnitsTowardsLocation to work based on GetUnitsTowardsLocationGeneric
Fixes: 1. Mostly fixes leaving tree-heavy camps uncleared (while still farming) 2. Fixes leaving baby mud golems behind 3. Fixes stacking issues Code Changes: 1. Instead of farmState = 0 or 1, now there are four statuses: - FARM_STATE_TRAVELLING: beyond 800 range, standard move - FARM_STATE_NEAR: Between 800 and 400 range, attack move in case creeps are outside camp - FARM_STATE_FARMING: Attack creeps using FindFarmedTarget - FARM_STATE_STACKING: Run to stack location so camp will stack 2. Moved camp clear/update check earlier so that it's easier to understand 3. Have to be within 200 range of camp to clear because trees often block visibility of creeps even when the camp location is visible - Fixes leaving tree-heavy camps uncleared 4. Checking camp clear now requires #neutralCreeps == 0 - Fixes baby mud golem issue 5. To support #neutralCreeps == 0 check and other edge cases, if camp not clear, but no available target, keep moving toward camp 6. Going into stacking state requires a recent attack - Fixes "stacking" without creeps
Reviewing
Feature Status
|
Thank you very much for your continued contribution. |
Thanks for your contribution. Farming has been a problem for this bot. I reviewed the code and I think the code are functional and logical. Can you try to test the GPM improvements for these bots? If the bots can farm as fast as human players do, then they would be more challenging to play against. |
No worries. Definitely no urgency from my end. |
It's definitely not (good) human level, but it's pretty consistently higher than non-farming heroes. Some sample game scoreboards below (Alchemist: 690gpm, Bloodseeker: 632gpm, Bloodseeker: 775 gpm). These games happen to all be wins, but the farming hero generally does not carry the game. |
if not (bot:IsAlive() | ||
and campUtils.IsStrongJungler(bot) | ||
and bot:GetLevel() >=6 and bot:GetLevel() < 30) | ||
or IsHumanPlayerInTeam() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this condition necessary? I don't quite understand the difference when human players are present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That logic was already there and I assume working as intended. I'm guessing the intent is that the human player may want to farm, and the bot farming as well could interfere with that. That check can be removed if unwanted; nothing else depends on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JoshdanG Now we only have 2 heroes with farming mode enabled? If so, it is indeed possible to remove this condition, it affects human players less.
-- | ||
-- Currently works by just going a fixed distance away from camp location | ||
-- in the bot's current dirction. | ||
function X.GetCampMoveToStack(bot, camp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is really helpful, thanks!
Improve Farming Desire Calculation
Improve Farming Behavior
Misc Cleanup