Except you missed the most important mechanic in this game that overshadows all your mathematical calculations. Morale drains twice as fast when you attack compared to when you defend. Therefore the mathematically optimal way to play is to sit there doing nothing. There, i've solved War of Dots!
Well, not quite. For once, a recent update changed that value (I think it's only 1.5x as fast when attacking?), and second, I assumed fixed enemy damage rate (a stable situation, whether because the enemy is out of morale or because of averaging over a longer time than the enemy's typical cycling speed).
War of Dots is a free minimal RTS on Steam.
The gameplay is simple enough to be described in its entirety in a blogpost, but I'm too lazy to do so, so I'll only consider what I need for my analysis. This article will describe the main mechanics identified to this day, and use maths to elaborate an effective strategy (with a brief discussion of real-game application).
A winning manoeuver for red during a War of Dots match
Introduction
You control dots, which fight when in contact with enemy dots. Your goal is to capture cities (which provide funds to buy dots) and kill enemy dots. There is a mild snowball effect such that the game is usually decided by the time the first city (out of typically 5) switches sides, or an army controls ~20% more troops than the other.
The main concepts to master to become an excellent War of Dots player are:
The economy and combat are very slow, leaving ample time to think, such that by far the two most important mechanics are cycling (how to weave troops in and out of combat) and encirclement (which quickly destroys large amounts of enemy troops). It is enough to master either concept to beat >80% of players imo.
Introductory considerations on cycling
Here, I will solve cycling to the best of my ability, because it's reasonably easy to formalize and find a satisfying answer for. I won't tell you about the rest, sue me.
An artist's view of cycling. The yellow dot is a city, the arrows represent orders. In this depiction, a healthy blue dot held in reserve is ordered to take the place of a bruised blue dot on the frontline, which is itself ordered to retreat to a city.
A dot has health and morale. While fighting (i.e. in contact with an enemy dot), it deals a certain amount of damage per second, according to the following formula:
Its morale and health regenerate at certain rates , respectively when out of combat. While fighting, it loses morale and health at certain rates , respectively.[1]
To simplify, I'll assume all these rates are fixed.[2]
Damage is proportional to , but if you want health to have linear value, you can consider it to be proportional with an additional "virtual health" bolstering the attack when damaged. In a sense you get the most bang for buck when units are at 1/4 health; in other words, 1/4 is when your units have the most virtual health contributing to the fight.
optimum over
This tells us how efficiently we are preserving attack when losing health depending on the unit's health: until 1/4, you're producing virtual health; afterwards you're losing it. The derivative of that tells us when we're producing the most virtual health, and we can see that whenever you must take a fixed amount of damage, you will preserve the most attack (i.e. produce the most virtual health) by distributing the loss equally among your healthiest units.[3]
More generally though, you are not taking a fixed amount of damage, but a fixed rate (which mostly depends on your enemy's micro capabilities and the overall strategic goodness of your chosen space of engagement), and what you need is to deal as much damage using healthy, high-morale units, and regenerate as much health and morale as possible with your disengaged units.
This practice is called cycling. It is the most important skill to get good at War of Dots imo.[4]
Cycling consists in swapping injured dots for healthy ones, so the healthy ones fight and the injured ones regenerate.
Red cycles their frontline. Credits to ★ Frostbite ★
When should you cycle units away from the frontline and cycle back your reserve in? Common wisdom holds that you should cycle out low-hp and low-morale units to let fresh units in, but that is woefully underspecified since units can be low-hp without being low-morale and vice-versa. In what circumstances should you cycle a low-hp high-morale unit for a high-hp low-morale one?
I won't answer that question.
The optimal single unit's cycle
Instead, I'll consider an individual unit's cycle: assuming it spends some fraction of its time fighting, and the rest regenerating, when should you pull back and when to go back in?
Our problem is an average-reward control problem:
Integrated over the time we're fighting, normalized over time. Since we're assuming fixed enemy damage and regen rate, the time we're fighting is the fraction that balances the two, so we only need to worry about maximising damage during engagement and never stay idle when health is max (and not reach at which point the dot would die which would break our model, but it's fine since and so we just shouldn't go there).
Can you see the issue yet? (If you do, skip to there.) Let's be more explicit.
An artist's view of phasespace, confusingly squiggly despite the math being straight. Red parts are fighting, green parts are regenerating.
Under mild assumption, it's easy enough[5] to prove that the optimal strategy is a closed-curve (including potentially a fixed point).
The average reward is then the integral of over the red parts, divided by the integral over the entire cycle (length weighted by speed of traversal).
But consider that health and morale are coupled: they deplete and regen together (except in border cases, when either is 0 or 1, since they're clamped)! Also, since depletion and regen rates are constant, any movement must follow a straight line. So actually, our trajectory looks more like:
A more accurate artist's view of phasespace, confusingly crossing the same part of phasespace multiple times during a single cycle.
But now, you object, there are two ways this could go: the slope of depletion is either steeper or not than the slope of morale. As it turns out, morale depletes and recovers much faster than health, but more relevantly, it recovers a certain amount of depletion faster than health. .[6]
In this regime, one can easily show[5] that the optimal strategy is a fixed point at where epsilon amounts of time are spent alternatively fighting and regenerating, in proportion equal to .
However, since I initially made no such assumption about the respective slopes, I had to solve the general case, in which we find a second optimum when , where the fixed point is at : you fight with no morale, but regenerate health so fast compared to morale that it'd be a waste to sit around, since even at no morale you have 0.2 combat efficiency.[7]
(No such optimum is found in the other two corners because combat efficiency drops to 0 with health.)
There are switching costs
The solution we found has our dots rapidly vibrating in and out of combat to maintain maximum efficiency. This cannot happen in the game because of the proximity rule:
When an enemy unit is close by (even if not in contact), you don't regenerate health.
An artist's view of a red dot asserting its proximity rule over blue dots. One blue dot has cleverly distanced itself from the red dot to regenerate.
You couldn't have known that from my premises[8], but it's fine: as the god of this post, it is within my power to introduce more premises!
The switching cost is a fixed amount of time, for both disengaging or reengaging, during which no damage is dealt or received, health does not regenerate, but morale does regenerate, yielding a curve kinda like this:
A lazy but self-aware artist's view of a different problem which is easier to visualize at the cost of not being the one we're interested in.
In yellow: the switching cost. Note that traversal speed is different over each coloured segment.
How simple and optimizable life would be if morale regenerated slowly! Alas the real world cares not for mathematical beauty, and we find ourselves instead stuck with this ugly thing:
I may not like it, but this is what peak gameplay looks like.
Bottle-necked as we are on health rather than morale, the switching cost reduces to a plain temporal penalty, whose only function is to guarantee that we deviate from the previous solution by balancing healing efficiency (by spending proportionally little time switching) against combat efficiency (by spending fighting time at high health).
The solution
We can, with relative ease[5], show that this disturbing cycle is indeed optimal when passing through , and simple calculus[9] finds the optimal time of fighting:
(There's no dependency in because we recover all of it whenever we regenerate health anyway.) is left as an exercise for the viewer.)
(The case where the slopes are almost equal relative to
Unfortunately, I don't have the exact values of the parameters to tell you how to translate that into gameplay, but we can get an intuition of this equation's meaning using dimensional analysis:
and are depletion rates; their inverse is how much time it takes to completely destroy the unit/drain it of its morale. The right factor of the denominator is thus dominated by how much time it takes to destroy the unit twice over.
Take the geometric average with the time to weave out of combat (which is the arithmetic average in logtime), and divide by how difficult it is to restore health compared to losing it, and you get it!
If it takes 2s to extricate the dot from combat, and 200s to top it back to full health, leave it fighting maybe 10s.
Me playing War of Dots. (They don't know I'm mathematically winning.)
Conclusion
Did you not read the above? Well, I can hardly blame you. The upshot is that, contrary to common wisdom, you should not keep units fighting until they've lost a significant fraction of their hp. Peak efficiency is achieved when you're constantly cycling even negligibly injured units, as long as you've got better to replace them. This is especially true in the early game: start cycling before you even deplete all your morale!
...
...Except this analysis only considered a single dot; it says nothing about multi-dot replacement strategy! It is easy enough to conjecture that you should greedily maximize your attack surface then cycle the rest as fast as possible, but is that true? Also, realistically, what does optimal cycling look like when you take into account a limited action-per-minute budget (i.e. how to cycle smarter, not harder)? How bad is it to deviate slightly from the optimal cycling strategy?
I don't know, I haven't looked into it. I'm pretty sure the answers are easy enough to come by though.
See you around, and I hope we have the occasion to answer all of that in a later post, as well as "solve" the other mechanics!
For a fuller breakdown: A unit's damage is multiplied by a terrain modifier if applicable, and by its type modifier (units can be either light, heavy, light ship or heavy ship).
A unit regenerates health twice as fast on a city than off, and doesn't regenerate health when in proximity to an enemy unit, even without fighting. It always regenerates morale at a fixed rate when not fighting.
Morale depletion happens at a fixed rate when not fighting, health depletion is proportional to incoming enemy damage. Damage is dealt to a single target (the first enemy encountered) even when multiple enemies are in contact.
In practice, controlling is a significant part of high-level micro, i.e. having high attack surface compared to the enemy. Also, you technically control by sending units to cities where they regen twice as fast, but it's simple enough to work at maximum capacity with regard to this mechanic.
I'm not considering morale here because there is no special intuition to build: attack damage is proportional to morale, and it decreases/increases at a fixed rate when fighting/not fighting. If you must lose a fixed amount of morale for no gain (and lose negligible health), prioritize losing it on your weakest units, but in practice that will rarely be relevant happen.
It's possible to win without cycling, using only your starting troops, good tactics and good strategy, but any half-decent player can block you and force a cycling game.
See this helpful document for a full proof, courtesy of Claude Opus 4.8.
The astute among you will notice that this cannot possibly be true since can be arbitrarily high or low depending on the enemy. But remember that I assumed was fixed; for the purpose of this analysis, I'm taking a representative fight, in which is almost always small compared to .
In principle, you could find this useful when fighting enemy dots with extremely low health, but if yours have full health, you're in a degenerate case anyway, since this analysis only applies in the equilibrium: when you have such a stark advantage, you will be gaining ground and performing various strategic manoeuvers, not just cycling back and forth in a mindless grind.
Unless you read the footnotes, in which case, if you did deduce this issue, congrats! Here's an Internet cookie: (っ˘ڡ˘ς) (° .)
By which I mean uni-level first-order approximation for small and which will be fiendishly hard to grasp for non-mathematicians. I'm pretty sure there's no closed form because integrals ar eugh. Your favorite clanker can probably explain it to you using the proof document in [5], though.