archive by month
Skip to content

the overlord shuffle

Let’s suppose there are two safe spots where you want to station overlords to watch for enemy movement, a nearer one A (perhaps near the entrance to your natural) and a farther one B.

    *     A     B
    1

Overlord 1 hatches. Of course you send it toward A. It’s slow, so it takes a while to get there.

    *     A     B
      --> 1

Then overlord 2 hatches. You could send it toward the next spot B, but that’s silly.

    *     A     B
    2     1

It’s faster to send overlord 1 from A to B and replace it with overlord 2 at A.

    *     A     B
      --> 2 --> 1

Humans do this kind of overlord shuffling all the time. Here’s a TeamLiquid post showing the overlord repositioning patterns of a few pro games. I don’t know of any bots that do it. It seems like it might be tricky, no? But in fact the problem of assigning overlords, or scouting units in general, to locations is an example of the mathematical assignment problem, and there is no shortage of known algorithms to solve it either exactly or approximately. I’m still thinking about how I want to solve it in Steamhammer.

Scouting in the presence of an enemy is not as simple. To do it optimally you’d have to understand how scout timings interact with possible timings of the opponent’s build, and consider the risk to the overlord from early marines, and take into account that an enemy that sees your overlord learns something about you too—and they might actively look for the overlord, humans often do (“if you’re at that base and scouting the most efficient way to the closest natural, your overlord will be here at this time; if I see it I found you, and if not, I ruled out one base”). The optimal strategy is surely a mixed strategy, meaning that you don’t play the same every game, and there’s no way it’s possible to calculate it on the fly. You have to either pre-calculate a plan or figure it out heuristically.

Trackbacks

No Trackbacks

Comments

Dan on :

I've encountered a lot of N! assignment problems in bot development. Right now in PurpleWave there's gatherer-to-resource, unit-to-squad, unit-to-formation-position, collision-free threat-aware pathfinding, and probably others I'm forgetting.

I've used the same heuristic approach for mostl of them: Greedy element-wise assignment, after sorting the elements (usually to assign the most needy element first), and sometimes with hysteresis to ensure stability. For example, I micro my units in order from closest-to-enemy-range to furthest, letting the most endangered units choose retreat paths first and then adding additional cost to highly-trafficked tiles when considering retreat paths for less-endangered units. This (in principle if not perfectly in practice) lets the most-threatened units take a beeline out of danger while safer units are encouraged to move to the side to let them through.

Gathering works similarly: It's most expensive for workers already on resources to get reassigned, so I greedily assign workers to the best resource starting with workers *closest* to starting their mining cycle. Hysteresis (encouraging workers to stay on the same patch) was necessary to avoid the occasional catastrophic waffling due to latency and due to workers taking wobbly paths when changing directions.

Jay Scott on :

There should be a lot! It is literally a game of agents and tasks. Not all the tasks are so straightforward, though....

jtolmar on :

Are there enough assignment problems that it would be worth building a bot around an assignment solver? Apparently the problem can be brought down to roughly O(n^2 log(n)) with fancy enough algorithms. Too involved for a one-off system, but if enough things use it then maybe. And that run time seems reasonable if different subsystems do it on different frames.

My gut feeling is that it'd be an endless rabbithole of hysteresis problems, but maybe worth it.

Jay Scott on :

Maybe. My intuition is that some issues may look like good candidates to model as assignment problems, but turn out not to be because the assignments interact. But that is only a guess.

Jay Scott on :

Another point is that we don’t know the gain of getting a good or optimal solution, compared to getting an OK solution very fast with a greedy algorithm. Would it be worth it?

Bryan on :

I just reworked my scout manager and was noticing how deep the rabbit hole went, so this is timely.

I currently randomly select locations based on distance from their perceived base and scout those.

If a scout hits its destination, I reassign it a new location, but it can't be currently seen or being scouted towards.

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Form options

Submitted comments will be subject to moderation before being displayed.