archive by month
Skip to content

rare bugs

I thought Steamhammer would always locate the enemy. If the early game scout gets killed, the ground forces have orders to visit any unscouted bases. If the ground forces are held at bay, the recon squad will check the rest of the map, locating the enemy by eliminating other possibilities. Only if Steamhammer loses quickly should it be unable to find the enemy base, and then it doesn’t matter.

Today it happened, and it caused a bug. I was testing map analysis with a particularly difficult map. Steamhammer was terran, so scouting was on the ground only, and everything that left Steamhammer’s base got caught behind map obstacles. The strategy was vulture drop, and when it came time to drop, Steamhammer loaded up the dropship and... had nowhere to send it. It started throwing an exception over and over. It’s a basic bug, but it had never happened before.

The question is, how do I fix it? The simplest plan would be to disband the drop squad if there is no target. Maybe I should do that, since it’s a rare case. It would be more effective to use the dropship itself to scout for targets, since everything else failed. It’s a skill that will be needed anyway when drops start to happen later in the game, but on the other hand it would take time. Hmm....

Another fix needed, of course, is pathing so units don’t get stuck. It’s easy enough to implement, but I keep putting it off because it seems to add architectural complexity and invite bugs. I need to think of a clean way to do it.

Map analysis, by the way, is working great. I have eradicated all the bugs I could find, and now in the rare cases where it does something unexpected, it always turns out to be good enough. The one base on Match Point is still on the far side of the minerals; I think it’s reasonable. The upper left island on Lost Temple gets 2 bases because the resources are so far apart; it seems reasonable. On almost all maps, even large and irregular old Blizzard maps, every base is placed as expected.

Now I have to start the work of actually making use of the map analysis. BWTA is explicitly written into the code in a ton of places. I don’t think it’s smart to rewrite them all at once, big bang style, so I’ll do them a little at a time.

Update: I decided to follow a plan similar to the PurpleWave idea mentioned in a comment. Steamhammer now calculates a drop target instead of simply aiming for the enemy main base, and if there are no enemy bases or buildings known, the target will be an unexplored place. I’m still updating MicroTransports so it can recognize when the target changes, which could happen at any time. It turns out that the map edge following code is far more complicated than it needs to be. I think Dave Churchill must have originally written it for another purpose, and dropped it in with little simplification.

Trackbacks

No Trackbacks

Comments

Dan on :

PurpleWave uses a concept of "most baselike enemy position" as a backup for when an enemy base position is called for and none are available. It first tries to find an enemy building, and failing that, chooses the least-recently-seen base, with some tiebreaks between them. It's been a useful concept -- I introduced it in the first couple of weeks of development and have been happily using it since.

jtolmar on :

I don't know your architecture so this might not make sense, but could you make it so squads fall back to the recon squad's behavior if no enemy position is known? Or reassign the units to the recon squad, though I think that's not quite as good (ideally a dropship doing recon would keep its contents and know it's time to drop the instant it finds something).

Jay Scott on :

Combat squads fall back to exploration if no enemy is known. They look everywhere, unlike the recon squad, which only tries to look at empty bases. The drop squad (in the current version) has a fixed target because that is what the code supports, and I wanted to minimize the work put into getting drop to function. Now I’m trying to make the drop target changeable, and make it drop the units only when there’s something to hit. So it is close to your idea. It’s work that won’t pay off much in the short run, though.

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.