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

implementing action processor #40

Merged
merged 6 commits into from
Jan 17, 2019
Merged

Conversation

Nostrademous
Copy link
Collaborator

This is a start of implementing a system for easier addition of various commands and the ability to send multiple commands to a bot.

Currently supports same code as before (plus some more if the messages are sent).

@TimZaman
Copy link
Owner

Related to #39

Some stuff:

  • Multiple actions
    Entirely ok with me, as the proto supports it:, eg
    repeated .CMsgBotWorldState.Action actions = 2;
  • Speed
    It's a tad more overhead but I don't see any red flags really.
  • Structure
    Looks excellent as you've made it.

The only thing I wonder, is how we can make the debugging of things prettier. Currently, the debug visuals are written on 1 tick. It would be really awesome if we could make them persist until the next debug frame. I am worried the proposed structure could make this more complicated. See what I mean? Suggestions?
Other than that, great pr.

@Nostrademous
Copy link
Collaborator Author

Related to #39

Some stuff:

  • Multiple actions
    Entirely ok with me, as the proto supports it:, eg
    repeated .CMsgBotWorldState.Action actions = 2;

Yeah, I thought the same thing.

  • Speed
    It's a tad more overhead but I don't see any red flags really.

I haven't noticed any speed degradation running locally honestly. In reality, I think I noticed a slight speedup when I switched to my dotaworld module inside the agent, but that's a whole separate thing.

  • Structure
    Looks excellent as you've made it.

I would have preferred not having to transforming protobufs to Lua nested tables to make the action processor be argument count based (meaning this stuff here: https://github.com/TimZaman/dotaservice/pull/40/files#diff-1dc9657ec8a150b40c6d3350a3b2e7c9R15) but I think it's okay.

The only thing I wonder, is how we can make the debugging of things prettier. Currently, the debug visuals are written on 1 tick. It would be really awesome if we could make them persist until the next debug frame. I am worried the proposed structure could make this more complicated. See what I mean? Suggestions?

Would have to implement our own debug draw class that re-draws every frame until a new draw event comes in.

Other than that, great pr.

Thanks

@Nostrademous
Copy link
Collaborator Author

By the way, it is worth pointing out that under-the-hood my implementation works a tiny bit different than how yours worked.

Example:
in your code the "DOTA_UNIT_ORDER_ATTACK_TARGET" would check for attack distance range and only do the action if within range. In my code, we do the action regardless of if we are in range or not. In the Dota2 world - you can right-click attack a target across the entire map and it is valid... just under the hood the behavior is "move into attack range, then attack" - which is what I'm allowing now.

@TimZaman
Copy link
Owner

TimZaman commented Jan 16, 2019 via email

@Nostrademous
Copy link
Collaborator Author

Implemented "DOTA_UNIT_ORDER_BUYBACK" and "DOTA_UNIT_ORDER_STOP"; bumped version to 0.3.4; removed a DebugPause() I had in there since we would never want to do that in a distributed env; actually wrote pass-through code into generic_bot.lua for allowing all the new DOTA_UNIT_ORDER functions.

Something on the agent-side just has to send them now.

@TimZaman
Copy link
Owner

TimZaman commented Jan 16, 2019 via email

@Nostrademous
Copy link
Collaborator Author

Okay, I added ability use functions for targeting of "entities, locations, trees".

We really should only allow legal actions by the agent though.

@Nostrademous
Copy link
Collaborator Author

okay, added UseAbility and ToggleAbility actions - that should cover all the action types.

need to test them now by having agent some of them over to see that they work (after we level the ability)

@TimZaman
Copy link
Owner

🎉

@TimZaman TimZaman merged commit fd4fb06 into TimZaman:master Jan 17, 2019
@TimZaman
Copy link
Owner

Removed some of your debugging printing. Going to slap a few commits on top

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

Successfully merging this pull request may close these issues.

2 participants