archive by month
Skip to content

where does the overlord start relative to the hatchery?

Steamhammer has a scouting feature that works in ZvZ matches: When it sees the position of the enemy’s first overlord, it tries to infer where the enemy base is. See Steamhammer’s new scouting skills. It turned out that on some maps—Icarus and Roadrunner—the inference can be wrong. The reason is that Steamhammer measures the distance from the potential hatchery location, not from the overlord’s start location, which is offset. If 2 bases are at nearly the same distance, the offset can matter.

So I came to the question: At the start of the game, where is zerg’s overlord placed relative to its hatchery?

The answer turned out to be simple. The overlord’s x position is offset by either -99 or +99 from the hatchery, and its y position by either -65 or +65. The position is chosen to be whatever is closer to the center of the map. In code:

overlord.x = hatchery.x + ((hatchery.x < 32 * BWAPI::Broodwar->mapWidth() / 2) ? +99 : -99);
overlord.y = hatchery.y + ((hatchery.y < 32 * BWAPI::Broodwar->mapHeight() / 2) ? +65 : -65);

I don’t promise that this is exactly right. It works in the cases I tested. I imagine that somebody on the OpenBW project could tell us the exact condition.

Trackbacks

No Trackbacks

Comments

Nininene on :

Can't you look at the orientation or the speed vector of the overlord when you see it for the first time? Assuming that they travel in straight line (99.99% percent of the time the case?) and that they don't see you before you see them, it should give you a very good idea of where it's coming from.

Jay Scott on :

Sure. I think that will almost always work, against both bots and humans, in practice. I rejected it because there is a risk in theory. The overlord generally sees the drone before the drone sees the overlord, so if the overlord is within range of 2 bases, it can tell a lie about which one it came from. And that is the only time we need the discriminating information.

Jay Scott on :

Drone sight range: 224. Overlord sight range: 288.

Nininene on :

Sure but the ovie is generally going for the hatchery, or at least an exctractor, a drone doesn't seem enough to conclude the base is there.
As an example, let's assume the base is in South East Corner of the map, with mineral on the east, gas in the North.
If ovie comes from West, the Hatchery will see it first, and it has the same sight range as the ovie, so conclusion can be drawn. If it comes from the north and the extractor is already up, we might not even see it (extractors have a much smaller vision range). If it tries to fake the incoming direction, it will take it more time to go around your base, and your timing computation can detect it (or be fooled equally badly, depends :) )

I'm not arguing than one method is strictly better than the other, simply that your heuristic could to some extent incorporate knowledge from both

Jay Scott on :

If it’s coming directly from the north or the west, the range calculation gives a guaranteed correct answer. It’s not a heuristic, it’s a proof: From what bases could the overlord have flown this far by this time? The overlord flight direction is a heuristic, and it’s not as safe to rely on it. Or, from the coder’s point of view, it’s not as easy to rely on it, because you have to code for the case where it is wrong. I agree with you that it’s a good heuristic, though. ZZZKBot relies heuristically on sightings of any enemy unit to make a guess about where the enemy base is, and I’m pretty sure it helps. Before I get around to best guesses, I want to teach Steamhammer that creep implies a hatchery.

Marian on :

Why is x +99 and y only +65?
Shouldn't it be the same value?

Jay Scott on :

One might imagine, and yet that is what I found! Those relative positions are correct to the pixel.

jtolmar on :

Hatcheries are wider than they are tall, and the offset was probably chosen to look good in the initial unit positions.

Jay Scott on :

Oh, you nailed it. According to BWAPI, a hatchery is 99 pixels wide and 65 high!

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.