archive by month
Skip to content

coping with map blocks

On 2-player maps, some games of Steamhammer against strong bio terrans, LetaBot and Tyr by Simon Prins, have gone like this: Steamhammer opens with mutalisks and, seeing defenses at the front and not knowing how to fly around them, falls into a standoff. Both sides build up for a while. The terran moves out with an infantry force. That’s a head-to-head fight that the zerg flyers understand, and they clean up the terrans before serious damage is done to zerg bases—not without losses, of course. Meanwhile, Steamhammer has long since sent out a drone to take a 3rd base, but the drone was confused by the blocking buildings on Benzene, or the blocking minerals on Destination or Heartbreak Ridge, and is still wandering back and forth looking for the way. Steamhammer has a mineral excess but does not make macro hatcheries because it is waiting for the new base to start. Zerg can’t keep up in production and loses to the next attack.

Map blocks are causing too many losses. I have to do something soon. Most bots stronger than Steamhammer already take measures (I think only Bereaver still suffers losses to map block issues). What are the options?

  1. Fix pathing: Go around the blocks.
    1. Goal monitoring: Detect units which seem stuck and reroute them.
    2. Detect that paths may go through blocks and (somehow) take extra care.
    3. Switch to BWEM. I want to, but maybe later?
  2. Clear the blocks.
    1. Clear blocks near our bases unconditionally. I think some bots do.
    2. Clear blocks which are adjacent to the main, or to an expansion we want.
    3. Goal monitoring: Clear blocks near stuck units. The units themselves can often do it.
    4. Hypothetical path analysis: Clear a block if it makes a path that we want to take shorter.
    5. Strategic analysis: Open paths which are more valuable to us than to the enemy.
  3. Work around it in some cheesy way.
    1. Take bases in an order that doesn’t run into map blocks.
    2. Hardcode, or add to the config file, a list of maps with blocks and what to do about them.
    3. Get vision of the base first, and then mineral walk to it, passing through blocks.

Obviously the ideal is to both fix pathing and clear the blocks, as in 1C plus 2E. Goal monitoring has some value, but not much value if the goals hardly fail.

To analyze from general principles whether it’s a good idea to clear a given block, you need hypothetical reasoning: If I clear this block, then that path opens, or that shorter route becomes available. I don’t notice direct support for hypothetical reasoning in either BWTA2 or BWEM. It doesn’t seem all too difficult to cobble something together if you can find out what choke each blocking mineral/building blocks and the choke-to-choke distances.

For now I don’t want an ideal solution, I want something simple that solves enough of the problem. I expect I’ll start with 2B and adjust as needed.

What do others do? Are there tricks or pitfalls?

Update: I should have talked about mineral walking. Quite a few competitive maps are designed with small mineral patches on one or both sides of a block. A worker at the block can see the minerals on the other side, right-click on them, and pass through the block, but another kind of unit cannot. Electric Circuit in the SSCAIT map pool has the feature, but the map is not used, because too many bots get units trapped behind the blocks. Of course, as long as the map is not used there is no incentive to fix the bugs....

And that suggests an idea for zerg bots: First send an overlord to any base that you want to take. With vision of the minerals, you can mineral walk the expansion drone to the base. Having vision also gives some assurance that the base is safe and worth taking, and it lets you deal with spider mines. I’ve added the idea to the post as 3C. I hadn’t thought of it before, but now I’m seriously considering it.

Trackbacks

No Trackbacks

Comments

PurpleWave on :

I think krasi0 premptively clears out all neutral blocks/buildings. BWEM's pathing understands them, so I imagine Iron bot clears them out on demand.

krasi0 on :

So just make sure you're playing against me and your bots will not have any long term issues with getting stuck behind neutral buildings. I will take care of the latter for you ;)

Sq on :

1B+2D is easy if you're willing to write your own pathfinding (a fairly large "if," I know). Make a list of blockers (neutral buildings and mineral patches with under 10 minerals) from the map's starting state and remove them whenever you see that spot with nothing in it. Then always find your paths ignoring blockers first, check if blockers are on the path, and use a heuristic of your choice to determine whether to clear it or redo the path without ignoring blockers.

Heuristics could be mixes of things like "always clear for workers" or "clear it when 100 paths are sent around the block" or "never clear stacked buildings without lurkers."

You could also run both path finders and weigh decisions based on the difference, but I don't think that's useful unless you're trying to expand the concept into anti-wall-off code, because the neutral blockers are placed by hand by humans trying to make big differences.

Jay Scott on :

Thanks, I hadn’t realized that it was that simple!

Jay Scott on :

BWEM has some extensibility. Does BWEM’s extensibility make hypothetical reasoning easy or doable? I haven’t looked at it closely enough to know, so if anybody can say....

krasi0 on :

In case you finally decide to switch from BWTA2 to BWEM, please describe the whole process in a blog post for the other poor souls like us who are on the same path. :)

Jay Scott on :

If I switch to BWEM, I imagine that the process will be gradual: 1. Add BWEM to the project so there is no separate dependency. 2. Add code to follow BWEM paths and start using it. 3. Over time, on a case-by-case basis, replace BWTA2 code for other features, bases and regions and ground distances. Each change has to be tested to understand how it affects the rest of the program. 4. Eventually, some versions later, I may replace all the BWTA2 code. Then I can drop BWTA2. The strong module boundaries inherited from UAlbertaBot should mean that it doesn’t matter that, say, regions here are BWTA2 regions and regions there are BWEM regions. I think only InformationManager will have to be reworked as one piece.

MicroDK on :

I would use BWTA2 when its the right tool and BWEM when this is the right tool for the job. In this case BWEM might be the right tool to deal with blockings. I would not rewrite the whole bot so that it can use another map library.

Igor Dimitrijevic on :

The BWEM library provides some ways to add user specific information to the Areas, the ChokePoints... Nothing more.
Paths and ground distances take into consideration minerals and static buildings that block ChokePoints. With EnableAutomaticPathAnalysis() called at the initialization, Paths and ground distances will be updated accordingly each time you inform BWEM that any mineral or static building has been destroyed. So, in order to get the new shortest paths IF some blocking neutral got destroyed, you could just pretend this happened. But I don't recommend this, as it is not undoable, and it is better if BWEM's state reflects reality. Good news is that I may add a new feature, that support a more general "hypothetical reasoning" about paths : one will be able to set/unset any ChokePoint as "disabled", and BWEM will update its paths and ground distances. Any ChokePoint could be enabled/disabled, not only those actually blocked by Neutrals: this will help some tactics like: "give me a path from here to this enemy Base, but I don't want to go through this ChokePoint, because I know there are ten sieged tanks there". This feature could also help in the case where there are several good paths from A to B, and you want to secure both paths.

Jay Scott on :

Good info, thanks! Presumably it could also tell you “sorry, there is no path without that choke.” Then you can enumerate paths by closing off chokes one at a time.

Joseph Huang on :

I worked around this in my bot based on yours by allowing expo and macro hatcheries to be placed at the same time, regardless of other constructing hatcheries. This is a cheap workaround but it works, only 2 drones got stuck when I tested it.

Jay Scott on :

Correction: The little minerals next to the blocking buildings on Electric Circuit are not for mineral walking. You can’t mineral walk through a building!

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.