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

Don't spam the training queue with zealots #32

Open
alkurbatov opened this issue May 15, 2020 · 3 comments
Open

Don't spam the training queue with zealots #32

alkurbatov opened this issue May 15, 2020 · 3 comments

Comments

@alkurbatov
Copy link
Owner

Happens when we have open gates which report idleUnit event each turn.

@ImpulseCloud
Copy link
Contributor

Currently, ChargelotPush::OnIdle caps the Zealots in the schedule at 8.

if (builder_->CountScheduledOrders(sc2::UNIT_TYPEID::PROTOSS_ZEALOT) >= 8)
        return;

Does this satisfy the "don't spam" issue?

I assume the WarpGates show as Idle because they have an ability cooldown instead of a Training order, so Builder tries to send a command and it fails, which triggers another OnIdle next turn.

ChargelotPush::OnIdle could be made smarter and ignore WarpGates on Cooldown. But then, if OnIdle is not called next turn, then the gates won't produce anything. We'd need a ChargelotPush::OnStep to check when Warpgates' cooldowns are done before scheduling another Zealot.

Or maybe the WarpGate OnIdle issue should be handled somehow in Cpp-Sc2 instead, so it only is triggered after warp-in cooldown is finished.

@alkurbatov
Copy link
Owner Author

No, it doesn’t. The problem with warp gates is that we don’t track cool downs so it is assumed that gates are not busy. Skipping turns is barely workaround which slowdown the spamming, but it still happens.

@alkurbatov
Copy link
Owner Author

As it was pointed out recently the good way would be to check availability of particular abilities, e.g. take whole list of warp gates, do the call and verify what we have in response.

m_unitsAbilities = m_bot.Query()->GetAbilitiesForUnits(units);

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