alkurbatov / suvorov-bot

Starcraft 2 rule-based bot capable to play for all races.
MIT License
18 stars 6 forks source link

fix: Fix gas saturation, #34 #60

Open ImpulseCloud opened 3 years ago

ImpulseCloud commented 3 years ago

If gas oversaturated, remove from busy_workers and call DistributeWorker. If gas under-saturated and any base is mineral-oversaturated, send one of those mineral workers to that gas.

I think this can be accepted separately from Repair and AttackScout?

ImpulseCloud commented 3 years ago

May want to accept this before #61, as there's prolly conversation about what scout-worker attack should do.

ImpulseCloud commented 3 years ago

Give this a look -- it's the best I can do without making a Plugin.cpp or making functions with bodies in Plugin.h

alkurbatov commented 3 years ago

There is nothing bad in adding Plugin.cpp. Plugin should stay pure virtual, the rest is not so valuable.

ImpulseCloud commented 3 years ago

Here's a stab at what might work. I added worker-training in Miner::OnIdle since it won't check every frame anymore (Miner::OnStep called every 7 frames), and losing 7 frames (at most) after each worker training is a little too long.