Skip to content
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

[LUA CODE] Complex Actions TODOs #3

Open
Nostrademous opened this issue Jun 2, 2017 · 10 comments
Open

[LUA CODE] Complex Actions TODOs #3

Nostrademous opened this issue Jun 2, 2017 · 10 comments

Comments

@Nostrademous
Copy link
Owner

They are enumerated here:
https://github.com/Nostrademous/Dota2-WebAI/blob/master/actions/complex_actions/TODO_complex_actions.md

@Nostrademous Nostrademous changed the title Complex Actions TODO Complex Actions TODOs Jun 2, 2017
@Nostrademous Nostrademous changed the title Complex Actions TODOs [LUA CODE] Complex Actions TODOs Jun 2, 2017
@ThePianoDentist
Copy link
Contributor

I had pulling and double-pulling in my bot. Ill try and implement them here.

Might be better to code stacking first as will be some code overlap (you attack creeps then run away)

@ThePianoDentist
Copy link
Contributor

ThePianoDentist commented Jun 3, 2017

For some of these complex_actions.
Will we want to have the backend server doing the stitching of the simple_actions?

i.e for stacking/pulling:

  • backend server has made the decision it would be nice to stack the camp next to us based on world state.
  • backend server then sends the lua NOOPs/wait until right time
  • at correct time, backend sends a simple AttackMove camp-location
  • Lua sends world-state back to server with info that creeps have aggroed us
  • backend server tells bot ActionMoveTo(lane/away from camp)

I think implementation could be a lot simpler if it's left to the backend.
Im not going to do anything on this issue, until have more of the world state in the backend server and can try and give as much work to that as possible

EDIT; I can see that have actually come quite far with sending world-state to the backend. has Neutral creep info, and allied lane creep. so Ill try and get myWorlD.decision() to tell bot to do what I described above

@Nostrademous
Copy link
Owner Author

I don't think we will want to "stitch" simple_actions on backend server. I anticipated the backend server just giving directives to front-end about what to do at the high-level and the front-end being able to interpret that through complex action definitions and maneuvers.

@ThePianoDentist
Copy link
Contributor

kk, Im not sure I agree, but it's hard to predict best way without trying. So as the project is still at an earlyish stage...

Im going to prototype both implementations on 2 separate branches

  • First Ill do where front end gets told to stack, with parameter of which camp
  • Second Ill try front-end being told to just AttackMove -> Move

so can compare having actual code

@Nostrademous
Copy link
Owner Author

Great. I am not opposed to it, I just worry about speed. Backend only communicates every 0.25 sec to front end. Test will tell.

The hard part is seeing it work as currently the bots don't do anything yet.

@ThePianoDentist
Copy link
Contributor

I completely overlooked that. Great point.

I've written the stacking lua function, I just need to test calling it.
work so far ThePianoDentist@199a8ea

Took the jungle parts from constants.lua in your full-override. made a jungle.lua inside /constants.
Think this assumed a melee bot though, so going to have to dynamically work out timings for ranged bots.

So far my implementation assumes Stack() will not just be called once, it will have to be called by each successive think until the stack is 'done'. because when you first call stack, you do not have all the information necessary to queue all the needed actions.
The main issue is that if you cannot see the neutrals you are about to try and stack (maybe its night or there's trees from your angle), then you cannot get a handle on them. so for ranged heroes who want to aggro by attacking...you cannot queue this action.

@ThePianoDentist
Copy link
Contributor

tested and fixed my stacking.

can be tested by overriding X.HeroThink with

    local Stacking = require( GetScriptDirectory().."/actions/complex_actions/action_stacking" )
require( GetScriptDirectory().."/constants/jungle" )
local camp_location = RAD_OFF_ANCIENT
local camp_timing = RAD_OFF_ANCIENT_STACKTIME
local camp_wait_at = RAD_OFF_ANCIENT_PRESTACK
local camp_pull_to = RAD_OFF_ANCIENT_STACK
if s == nil or s ~= 1 then
    s = Stacking:Call(camp_location, camp_timing, camp_wait_at, camp_pull_to)
    print(s)
end

still to do:

  • handled ranged properly
  • some of the jungle constants data is a bit sketchy (i.e the stack_from can cause you to accidentally aggro creeps if approach from wrong direction). may need to rewrite-ish this handling
    I heard Chris may be adding some stuff to getNeutralSpwaners so Im going to halt work here until next update

@Nostrademous
Copy link
Owner Author

Implemented a generic complex action. Instead of having to copy/paste multiple variants of basically the same thing for things like "go here and place ward", "go here and get rune", "go here and buy item", "go here and attack unit", "go here and cast spell on this loc", etc. I wanted to create a flexible template function which will just take the action to perform when at location. We still will have to create specific implementations of all the above, but it will just call the "approach_and_execute_action_on_location" implementations with the final argument being "Action_UseAbilityOnLocation( hWard, vLoc) for warding for example.

@ThePianoDentist
Copy link
Contributor

just an update.

I had asked for a small addition to API in a june update thread, which would make implementation of pulling/stacking a lot more reliable.
(basically if you approach the camp from the 'wrong direction' you are fogged by trees and everything is awkward. currently no way to tell from api where camp 'opening' side is)

hasnt been added so im going to repost in api request thread.

I also had some offlaner/hero-zoning stuff in my bot.
I can try porting it to here if you want

@Nostrademous
Copy link
Owner Author

Sure, just use basic actions to do those (if any missing let me know)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants