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

what the usage of actionDelay? #45

Closed
sijiaxu opened this issue Jan 21, 2019 · 3 comments
Closed

what the usage of actionDelay? #45

sijiaxu opened this issue Jan 21, 2019 · 3 comments

Comments

@sijiaxu
Copy link

sijiaxu commented Jan 21, 2019

I'm curious about what type of action need some delay before executing this action?

for _, action in pairs(data.actions) do
if action.player == player_id then
if action.actionDelay == nil then
-- Make sure this defaults to 0 if not present
action.actionDelay = curr_step
else
action.actionDelay = curr_step + action.actionDelay
end
table.insert(actions, action)

@Nostrademous
Copy link
Collaborator

@TimZaman he introduced that to allow bots to do delayed actions (currently not enabled or used). The reason is that we communicate with the bots every X frames (depending on setting). So when we tell the bot to attack a unit he could do it immediately, or wait 1 frame and do it, or wait 2 frames and do it ... after 5 frames (if that is X) we send it a new action to do.

The code supports this, we just don't currently use it.

@TimZaman
Copy link
Owner

TimZaman commented Jan 21, 2019 via email

@sijiaxu
Copy link
Author

sijiaxu commented Jan 22, 2019

ok. I got it, thanks!

@sijiaxu sijiaxu closed this as completed Jan 22, 2019
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

No branches or pull requests

3 participants