Think about how your spam filters work. They calculate odds by starting with a baseline of how much spam you usually get, then weigh new evidence like the word “crypto” to decide if an email belongs in the trash. That’s what’s called Bayes’ Theorem in action.
We want our bots to do the exact same thing with their decisions, whether that’s to defend a cheese or press an attack.
It starts with a baseline of the likelihood of something happening, and then updates it with every new signal of information.
When your scout sees an empty natural, it updates a running probability.
It seems so obvious to me looking back in retrospect, but the missing layer is mathematical context. The theorem is how you translate that gut feeling into bot policy.
This is the formula that makes it work:
P(H|E) = [P(E|H) * P(H)] / P(E)
But breaking that down for our SC2 Bot:
P(H) is your Prior. This is your baseline belief before you scout anything. Based on their race, MMR, the map, and past games you’ve played, what is the chance they are going to 12-pool?
P(E|H) is the Likelihood. You send a worker and see an empty natural at two minutes. If they actually were 12-pooling, how likely is it that the natural would be empty right now?
P(E) is the Normalizer. The total probability of seeing an empty natural across all possible strategies. It keeps the math grounded between 0 and 1.
P(H|E) is the Posterior. This is your updated belief. You fold the new signal into your starting baseline to get a new percentage.
Every new signal shifts that baseline. Your bot continuously updates its probability as new data arrives. It acts on the math, just like a spam filter tossing an email the moment the odds tip too high.
The biggest gains came from refactoring my heuristics to include a Bayesian filter that acts in between my bot’s observations and its decisions.