most skills are hard
I think most Brood War skills are hard to implement well. Every skill I add seems to give me some difficulty or other.
stim
Krasi0 noted that most bots which use stim tend to overstim so that the medics are constantly low on energy. That didn’t seem all so hard to avoid, I thought when I first considered it. Add up the total medic energy, and stim more freely when you have more medics or they have more total energy. Well, it can make sense to stim when you have no medics at all. And how many marines do you want to stim when one zergling runs in as a scout? Hmm, it’s tricky....
The right way to make the decision is to weigh the cost and benefit. The cost is 10 hit points per unit stimmed over the time period until the damage is healed, plus the medic energy to heal it—something like that. The benefit is faster movement and faster shooting until the stim ends, whose value depends on the whole situation. Both cost and benefit should take into account what you expect to happen next (“better save some energy for the next fight”). Tricky is not the word, it’s infeasible to do it optimally! Tradeoffs must be made.
For now, I followed a simple plan not far from my first thought. Steamhammer adds up the medic energy, counts down the amount used by each unit stimmed, and stims more conservatively when it is gone. It overstims, like most bots, but at least not to the point that it runs down its hit points.
Even with poor decisions, stim makes Steamhammer’s infantry stronger. It’s a net gain.
merging an archon
Stim is hard for gameplay reasons. Merging an archon is hard simply because it’s unreliable. Sometimes the two high templar you’ve ordered to merge end up circling around each other and never get together. Sometimes they start to approach each other, run into obstacles, and give up. If you try again, they are likely to run into the same obstacles and give up again, so you have to move them somewhere else first—but where?
Steamhammer doesn’t support psionic storm yet, so I don’t have to worry about the tradeoff between keeping high templar and making archons. I added a micro manager for high templar, with the sole job of merging archons. After high templar learn how to storm, maybe the strategy manager should decide when to merge high templar.
It took me hours to get archons to merge reliably. At least, I hope, mostly reliably. I check templar->getLastCommand(), templar->getLastCommandFrame(), and templar->getOrder() in different combinations to recognize different cases. I picked a point next to a corner of the main nexus as a gathering place for high templar that get stuck and need to be told to move first. Of the high templar ready to merge, I find the closest pair and merge only them, then call it a day for that frame. The combination of measures seemed to be enough.
In one test game, an archon merged at the gathering point and between two other high templar. The archon could not escape because it was trapped among buildings and high templar, and the high templar could not merge because an archon was between them. I didn’t fix this case, I arranged for it to be rare enough that I hope it doesn’t hurt much. Meanwhile, there are failure modes that I didn’t run into in tests....
Comments
PurpleWaveJadien on :
That's a problem I've aimed to solve. Instead of asking "who will win this fight" PurpleWave simulates the battle using different combinations of tactics. SparCraft min-maxes individual unit strategies; PurpleWave uses the same tactics across all the units. It then weighs the various outcomes based on units. killed/damaged. That approach would also allow consideration of whether stim is a net positive tradeoff. https://github.com/dgant/PurpleWave/blob/master/src/Information/Battles/BattleTypes/BattleGroup.scala#L21
PurpleWaveJadien on :