SparCraft and overcoming its limitations
MicroDK recently suggested in comments 2 ways to alter SparCraft’s input for better results.
1. Don’t feed in uncompleted units. As written, parent UAlbertaBot and the live Steamhammer will feed SparCraft our own uncompleted units when they are in the combat circle. SparCraft doesn’t know the difference and assumes that they can fight. It’s a bug. I fixed it for the next Steamhammer by not tracking our uncompleted units in MapGrid
, since we should never care. It was a waste of resources to track uncompleted units.
2. Exclude out-of-range static defense. This is not a bug, but it is an interesting idea. SparCraft predicts which side will win a battle. If you have, say, zerglings and sunkens versus zealots, SparCraft may say that zerg wins. So the zerglings confidently rush forward out of sunken range and die unnecessarily. MicroDK suggests: If the sunkens are out of range of zealots, then don’t tell SparCraft about the sunkens. The zerglings will hang back as they should, unless and until they can win on their own.
I see a lot of related misbehavior in Steamhammer, where SparCraft takes everything into account but the bot could do better by considering a more restricted part of the situation. For example, in the live Steamhammer, when mutalisks see units that they can’t beat, they retreat out of sight range, including sight range of supply depots. It would be the right behavior if the plan was to circle around and try another angle (that’s why I put it in), but instead Steamhammer sits there, unwilling to move forward and unable to see or engage anything. If it isn’t going to circle around, it ought to at least take shots at a supply depot until chased away! The mutalisks could fight better by ignoring all anti-air units that they are out of range of, not only static defense.
SparCraft accounts for all units that you tell it to, and Steamhammer tells it to include all units in a large circle. Another example of the problems this causes: Melee units which are close by air but distant by ground may be in the circle and accounted for in the simulation. Or ranged ground units which are out of range of the battle and can’t reach it soon enough to help, because the ground distance is too great (they have to go around an obstacle, or whatever). In these cases the attacker may defeat the forward forces and then retreat before the distant forces arrive, while SparCraft expects them to wait around. Then you may fight when you should retreat until your forward and rear forces join up.
I will probably implement some kind of situation pruning to help. It seems easy and likely to be effective, and some of the errors it avoids seem hard to avoid otherwise. But there is also an underlying conceptual weakness in SparCraft that I would like to solve eventually.
SparCraft answers the question “which side wipes out the other?” It is not always the question that we want answered. It is a reasonable question given UAlbertaBot’s tactical model: Draw a line from our base to theirs, move forward along the line as long as we can win, move backward along the line until we can win. But UAlbertaBot’s model is ultra-simplified and isn’t suitable for drops, or vulture raids, or mutalisk harassment, or runbys, or picking off reinforcements... or most tactical maneuvers. For all these situations, SparCraft is not a natural fit, and at best you’ll have to use it carefully to get good answers.
The underlying issue is that we want SparCraft to answer different questions in different situations. Eventually I want to have a more flexible combat predictor that can cope with more questions: “Here’s the goal, can I achieve it?” Either I will upgrade SparCraft with new goals and behaviors, or I’ll find or write another combat predictor.
- If these units run by the enemy position, how many will survive on the other side?
- Will this drop or raid do enough damage to pay for itself before it is destroyed?
- Will this harassment attempt kill at least one enemy unit and get away safely? (Mutalisks keep shooting as long as the answer remains “yes”.)
- Will the enemy be able to surround and trap this squad, or can it escape? (Should I run away or make a last stand?)
Question 4 might be too hard for SparCraft, but for 1-3 I can see how to modify it to answer the question directly. When Steamhammer’s tactics boss becomes smart enough to know what question to ask, this will move to the top of my to-do list.
Comments
PurpleWaveJadien on :
Jay Scott on :
PurpleWaveJadien on :
Jay Scott on :
PurpleWaveJadien on :
Jay Scott on :
PurpleWaveJadien on :
PurpleWaveJadien on :
Jay Scott on :
PurpleWaveJadien on :
MicroDK on :