-
Notifications
You must be signed in to change notification settings - Fork 19
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
WIP - hero selection #51
Conversation
Dotaservice is ready for solving #50 Need Dotaclient to write the |
dotaservice/lua/hero_selection.lua
Outdated
|
||
-- Function below sets the lane assignments for default bots | ||
-- Obviously, our own agents will do what they belive best | ||
function UpdateLaneAssignments() |
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.
Why do we care about lane assignments?
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's only if we plan on playing with the default bots. It forces the default bots to not try and assume the mid-lane is empty for example when all your bot (or you as a human) did was go get the off-lane rune at spawn time.
If we are just doing 5v5 full-agent (or 1v1 self-play) than it doesn't matter to us at all.
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.
Yeah i would love to have 1v1 against default bot working to validate my self play. I actually want that ASAP.
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.
Btw can you add what you just said as comment
dotaservice/lua/hero_selection.lua
Outdated
@@ -16,25 +61,67 @@ function GetBotNames () | |||
} | |||
end | |||
|
|||
local bot_heroes = {"npc_dota_hero_nevermore"} | |||
local function mode1v1() |
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.
Why are there per-mode picks?
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.
I did it this way as if we ever want to extend to non AllPick game modes we will have the flexibility.
Captain's Mode - the traditional tournament mode is - has Ban, Pick, Ban, Pick, Ban, Pick sequence which is not present in All Pick for example. Hence why the logic would have to be different. Additionally, only in Lobby's can you pick all the heroes at once and not worry about pick order.
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.
If we generalize abilities enough we could support Ability Draft game modes too which would be super amazing.
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.
Well yeah but its often easier to work in small chunks of work at a time to unblock. If you get this working it'd amazing though. It will involve a bunch of back and forth between dotaservice and the agent.
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.
my worry is that I don't think the protobuf messages during hero selection work properly though. In all my testing a year ago they did not notify you of hero selections performed thus far... all the protobuf parameters were empty..... :(
I need to see if that's been fixed. If not, might be a good question to ask OpenAI since they had it working.
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.
I think OpenAI has their own addon
What's your high level view and flow of things? |
I don't think we can do only a one-time in any mode other than generic bot mode. We should not be picking heroes already picked by the other side for one (so we need to be able to send updated picks in response to enemy picks); for two the concept of counter-picking can only be achieved through iterative picks; for three under Captain's Mode there is also the concept of bans (which should be strategic). Obviously, some of these are way out there in the future as we are not ready yet, but I tend to architect for the future case if it doesn't detract or distract from the current need. |
For most my immediate needs i often want to mirror heroes picked though.
…On Thu, Feb 7, 2019, 11:38 Nostrademous ***@***.*** wrote:
I don't think we can do only a one-time in any mode other than generic bot
mode. We should not be picking heroes already picked by the other side for
one (so we need to be able to send updated picks in response to enemy
picks); for two the concept of counter-picking can only be achieved through
iterative picks; for three under Captain's Mode there is also the concept
of bans (which should be strategic). Obviously, some of these are way out
there in the future as we are not ready yet, but I tend to architect for
the future case if it doesn't detract or distract from the current need.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHXSRNPUJJ1Vy4i9zWkSrWreBMClUfYZks5vLIChgaJpZM4anbvr>
.
|
For now i think it would be fine if we just make all selections ourselves.
…On Thu, Feb 7, 2019, 11:48 Nostrademous ***@***.*** wrote:
***@***.**** commented on this pull request.
------------------------------
In dotaservice/lua/hero_selection.lua
<#51 (comment)>:
> @@ -16,25 +61,67 @@ function GetBotNames ()
}
end
-local bot_heroes = {"npc_dota_hero_nevermore"}
+local function mode1v1()
my worry is that I don't think the protobuf messages during hero selection
work properly though. In all my testing a year ago they did not notify you
of hero selections performed thus far... all the protobuf parameters were
empty..... :(
I need to see if that's been fixed. If not, might be a good question to
ask OpenAI since they had it working.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHXSRHYsCm-Uo1605mzNMgCbSLpk9wNoks5vLIMHgaJpZM4anbvr>
.
|
I think we have no choice for now. I did verify and all the world-state protobufs during Hero Selection (game_state == 2) are basically empty and do not contain hero_selected values. So I have no way of knowing what heroes were picked (short of reading the console.log) |
Sounds good to me
…On Thu, Feb 7, 2019, 15:34 Nostrademous ***@***.*** wrote:
I think we have no choice for now. I did verify and all the world-state
protobufs during Hero Selection (game_state == 2) are basically empty and
do not contain hero_selected values. So I have no way of knowing what
heroes were picked (short of reading the console.log)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHXSRNLiE2jytBZp2te8oiU21b2ZXFd5ks5vLLgBgaJpZM4anbvr>
.
|
Got the data extracted from our monitor_logs() function.
|
For now I'm just printing them... need help in the software architecture side of how you would want to "record" them or "store" them. |
@TimZaman Implemented a gRPC Hero Selection protobuf Message format. Still need to hook it up to dota_game actions but the messaging format should be done barring objections or recommendations from you |
setup.py
Outdated
@@ -5,7 +5,7 @@ | |||
|
|||
setuptools.setup( | |||
name="dotaservice", | |||
version="0.3.7", | |||
version="0.3.8", |
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.
leave this to me
dotaservice/protos/DotaService.proto
Outdated
SELECTION_TYPE_PICK = 0; | ||
SELECTION_TYPE_BAN = 1; | ||
// For Ability Draft | ||
SELECTION_TYPE_ABILITY_PICK = 2; |
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.
Only add this in if it actually works, otherwise comment out of not add
dotaservice/protos/DotaService.proto
Outdated
message Empty {} | ||
|
||
message HeroSelection { |
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.
I think this is really great to get us started - how do you envison the information of the opposite pick to be returned?
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.
Also, how do we specify how we set up the game? How do we specify if we want to control the bots, or if we want to use default bots?
Looks great. I'm hoping to add ability usage to the dotaclient this weekend. Also, I tested the optimizer on a Titan Volta, and I can train 20.000 steps/s (in CPU I currently max out at ~300 steps/s). Notice that at 2 ticks per second, that's 3 hours of dota per second (!). The bad thing is, that the agents go at ~15 steps/s. That saturates around 150% CPU. So to saturate 20.000 steps/s, i need something in the order of 1300 CPUs. |
Can you hold off on abilities if possible? I want to have a discussion on embedding parameters for units and abilities first. Not sure if you enabled the wiki extension for this github project but please if you can so we can discuss without having to use issues to have a conversation. |
Starting writing some notes here: |
Probably better to make a designdoc/ folder with some .md files in there
outlining thr desigm instead of a wiki
…On Sat, Feb 9, 2019, 11:33 Nostrademous ***@***.*** wrote:
Starting writing some notes here:
https://github.com/Nostrademous/dotaservice/wiki/Discussions
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHXSRMs4nU5HZsBEOsTvo6rcyiZrD4_Xks5vLyKkgaJpZM4anbvr>
.
|
Your design is fair, but it's too ambitious for now, I want to just take incremental steps while maintaining sanity and make sure that things work, and not to add too much complication. Your suggested new rewards help with that, but I like to have independent rewards because that really helps debugging. |
So I have tested this and it works, but not at 10x timespeed... the drafting ends before we can make enough decisions going pick, wait for other team to pick, then pick, then wait, then pick... |
Hmm thats going to be a problem. It shouldnt be if your implementation is
blocking.
Alternatively, the setup can be entitely static beforehand, which will work
fine for the dotaclient.
…On Tue, Feb 12, 2019, 09:33 Nostrademous ***@***.*** wrote:
So I have tested this and it works, but not at 10x timespeed... the
drafting ends before we can make enough decisions going pick, wait for
other team to pick, then pick, then wait, then pick...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHXSRKOo0ijtica-Kx66XmBPy3g9guYAks5vMvrugaJpZM4anbvr>
.
|
I agree with you, but I'm not as familiar with async io in Python 3.7 and all you can do with it. Perhaps you can take a look? I will do a PR on the dotaclient side as well that works with this dotaservice |
If its not blocking (on the lua end) its not deterministic so we cant trust
the execution putting the resiliency of the system at risk.
If i were to do this, i literally would have added a message to the Config
protobuf which includes all the picks, and wether or not we are going to
want to control which bots.
…On Tue, Feb 12, 2019, 09:42 Nostrademous ***@***.*** wrote:
I agree with you, but I'm not as familiar with async io in Python 3.7 and
all you can do with it. Perhaps you can take a look?
I will do a PR on the dotaclient side as well that works with this
dotaservice
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHXSRNI-0BtLw6M5uR3dqEJlBN4iILncks5vMv0DgaJpZM4anbvr>
.
|
Did you do |
Yep.. well.. Its the only way to make the system deterministic.
…On Tue, Feb 12, 2019, 09:51 Nostrademous ***@***.*** wrote:
Did you do while True to force blocking in Lua? I feel like that's why
you did that and now I get why... although I don't like it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHXSRL0YAuEJ1xp7YUEQ_4WQSTgDRl3Aks5vMv8MgaJpZM4anbvr>
.
|
Okay, using same type of setup (meaning I'm blocking) I can support individual hero drafting at any time-speed. |
@TimZaman pushed working hero selection system. The way it works is that currently it picks a randomly (I did this for future fun, it can be made non-random, but it is deterministic across the complete selection) un-picked player index slot on RADIANT TEAM (default - we can have it randomly choose which side picks first in the future) and picks a hero for that slot. For 1st slot on each side Nevermore is chosen, for all other slots it's Sniper. Once a RADIANT pick is detected, the DIRE team then picks a hero following same rules. This goes back and forth like this until 10 heroes are chosen and accounted for. Code was written like this so that future pivots to Captain's Mode which include Ban Phases is trivial. Example of DotaService INFO:
|
Moving code to a branch until you are ready for it so I can continue working on other stuff. |
Let me know i have time
…On Fri, Feb 15, 2019, 09:46 Nostrademous ***@***.*** wrote:
Moving code to a branch until you are ready for it so I can continue
working on other stuff.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHXSRGL2N5I0iVDbeHjeXyqgUzRa7R2Yks5vNvJqgaJpZM4anbvr>
.
|
WIP for now. Starts setting us up for better hero selection and various game modes other than 1v1.
This works and does not break current code but is not fully complete yet in terms of providing us a way to specify hero selections through API.