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.
Comments
Dan on :
jtolmar on :
Jay Scott on :