Squadron Tower Defense is an interesting twist on the TD format that pits two teams of 4 players against each other. Each player must attempt to balance their own economy and defense such that they receive the maximum income without leaking (other builds employ teamwork to favor econ or defense, but that is irrelevant for this topic).
To improve one's economy, the player can either build additional SCVs or upgrade the movement speed of the SCVs.
In this guide, I demonstrate the optimal strategy for scheduling the addition and upgrade of SCVs.
Fundamentals
A player starts with 1 SCV and can add an additional 30 SCVs, at a cost of 50 minerals per SCV.
A player can also upgrade the speed of all mining SCVs by 40% up to 5 times. The cost of this upgrade increases by 60 minerals each time, starting at 60 minerals for the first upgrade. Hence:
- Upgrade 1: 60 minerals
- Upgrade 2: 120 minerals
- Upgrade 3: 180 minerals
- Upgrade 4: 240 minerals
- Upgrade 5: 300 minerals
The primary question raised: in what order should one choose to upgrade or build additional SCVs in order to optimize income?
Analysis
+ Show Spoiler +
For my analysis, I rate the value of adding and upgrading as the ratio of that action's benefit to cost, where the benefit is defined as the rate of increase in mining, and the cost is defined as the amount of minerals required for the action.
benefit
benefit of upgrading speed = 0.4
- The speed increase is always 40%, regardless of the number of SCVs currently mining.
benefit of adding SCV = 1/(number of total SCVs)
- For example, adding an SCV when only one is mining improves mining rate by 100%. Adding an SCV when two are already mining improves mining rate by 50%, and so on.
cost
cost of upgrading speed = [60,120,180,240,300]
- Depends on the upgrade step.
cost of additional SCV = 50
- An additional SCV is always 50 minerals.
value = benefit/cost
value of upgrading speed = 0.4/[60,120,180,240,300]
value of additional SCV = ((number of total SCVs)^-1)/50
I evaluated the value of each action in a series of decision steps, choosing the action with the highest value at each step. I performed this evaluation until all SCVs were mining at the maximum speed.
benefit
benefit of upgrading speed = 0.4
- The speed increase is always 40%, regardless of the number of SCVs currently mining.
benefit of adding SCV = 1/(number of total SCVs)
- For example, adding an SCV when only one is mining improves mining rate by 100%. Adding an SCV when two are already mining improves mining rate by 50%, and so on.
cost
cost of upgrading speed = [60,120,180,240,300]
- Depends on the upgrade step.
cost of additional SCV = 50
- An additional SCV is always 50 minerals.
value = benefit/cost
value of upgrading speed = 0.4/[60,120,180,240,300]
value of additional SCV = ((number of total SCVs)^-1)/50
I evaluated the value of each action in a series of decision steps, choosing the action with the highest value at each step. I performed this evaluation until all SCVs were mining at the maximum speed.
Results
+ Show Spoiler +
Optimal order of adding/upgrading:
Step: 0 - Add SCV
Step: 1 - Add SCV
Step: 2 - Add SCV
Step: 3 - Upgrade SCV
Step: 4 - Add SCV
Step: 5 - Add SCV
Step: 6 - Add SCV
Step: 7 - Upgrade SCV
Step: 8 - Add SCV
Step: 9 - Add SCV
Step: 10 - Add SCV
Step: 11 - Upgrade SCV
Step: 12 - Add SCV
Step: 13 - Add SCV
Step: 14 - Add SCV
Step: 15 - Upgrade SCV
Step: 16 - Add SCV
Step: 17 - Add SCV
Step: 18 - Add SCV
Step: 19 - Add SCV
Step: 20 - Add SCV
Step: 21 - Add SCV
Step: 22 - Add SCV
Step: 23 - Add SCV
Step: 24 - Add SCV
Step: 25 - Add SCV
Step: 26 - Add SCV
Step: 27 - Add SCV
Step: 28 - Add SCV
Step: 29 - Add SCV
Step: 30 - Add SCV
Step: 31 - Add SCV
Step: 32 - Add SCV
Step: 33 - Add SCV
More detailed output:
+ Show Spoiler +
Step: 0 - Add SCV
Total SCVs: 2
Speed: 1.00
Speed Cost: 0
Step: 1 - Add SCV
Total SCVs: 3
Speed: 1.00
Speed Cost: 0
Step: 2 - Add SCV
Total SCVs: 4
Speed: 1.00
Speed Cost: 0
Step: 3 - Upgrade SCV
Total SCVs: 4
Speed: 1.40
Speed Cost: 0
Step: 4 - Add SCV
Total SCVs: 5
Speed: 1.40
Speed Cost: 60
Step: 5 - Add SCV
Total SCVs: 6
Speed: 1.40
Speed Cost: 60
Step: 6 - Add SCV
Total SCVs: 7
Speed: 1.40
Speed Cost: 60
Step: 7 - Upgrade SCV
Total SCVs: 7
Speed: 1.96
Speed Cost: 60
Step: 8 - Add SCV
Total SCVs: 8
Speed: 1.96
Speed Cost: 120
Step: 9 - Add SCV
Total SCVs: 9
Speed: 1.96
Speed Cost: 120
Step: 10 - Add SCV
Total SCVs: 10
Speed: 1.96
Speed Cost: 120
Step: 11 - Upgrade SCV
Total SCVs: 10
Speed: 2.74
Speed Cost: 120
Step: 12 - Add SCV
Total SCVs: 11
Speed: 2.74
Speed Cost: 180
Step: 13 - Add SCV
Total SCVs: 12
Speed: 2.74
Speed Cost: 180
Step: 14 - Add SCV
Total SCVs: 13
Speed: 2.74
Speed Cost: 180
Step: 15 - Upgrade SCV
Total SCVs: 13
Speed: 3.84
Speed Cost: 180
Step: 16 - Add SCV
Total SCVs: 14
Speed: 3.84
Speed Cost: 240
Step: 17 - Add SCV
Total SCVs: 15
Speed: 3.84
Speed Cost: 240
Step: 18 - Add SCV
Total SCVs: 16
Speed: 3.84
Speed Cost: 240
Step: 19 - Add SCV
Total SCVs: 17
Speed: 3.84
Speed Cost: 240
Step: 20 - Add SCV
Total SCVs: 18
Speed: 3.84
Speed Cost: 240
Step: 21 - Add SCV
Total SCVs: 19
Speed: 3.84
Speed Cost: 240
Step: 22 - Add SCV
Total SCVs: 20
Speed: 3.84
Speed Cost: 240
Step: 23 - Add SCV
Total SCVs: 21
Speed: 3.84
Speed Cost: 240
Step: 24 - Add SCV
Total SCVs: 22
Speed: 3.84
Speed Cost: 240
Step: 25 - Add SCV
Total SCVs: 23
Speed: 3.84
Speed Cost: 240
Step: 26 - Add SCV
Total SCVs: 24
Speed: 3.84
Speed Cost: 240
Step: 27 - Add SCV
Total SCVs: 25
Speed: 3.84
Speed Cost: 240
Step: 28 - Add SCV
Total SCVs: 26
Speed: 3.84
Speed Cost: 240
Step: 29 - Add SCV
Total SCVs: 27
Speed: 3.84
Speed Cost: 240
Step: 30 - Add SCV
Total SCVs: 28
Speed: 3.84
Speed Cost: 240
Step: 31 - Add SCV
Total SCVs: 29
Speed: 3.84
Speed Cost: 240
Step: 32 - Add SCV
Total SCVs: 30
Speed: 3.84
Speed Cost: 240
Step: 33 - Add SCV
Total SCVs: 31
Speed: 3.84
Speed Cost: 240
Total SCVs: 2
Speed: 1.00
Speed Cost: 0
Step: 1 - Add SCV
Total SCVs: 3
Speed: 1.00
Speed Cost: 0
Step: 2 - Add SCV
Total SCVs: 4
Speed: 1.00
Speed Cost: 0
Step: 3 - Upgrade SCV
Total SCVs: 4
Speed: 1.40
Speed Cost: 0
Step: 4 - Add SCV
Total SCVs: 5
Speed: 1.40
Speed Cost: 60
Step: 5 - Add SCV
Total SCVs: 6
Speed: 1.40
Speed Cost: 60
Step: 6 - Add SCV
Total SCVs: 7
Speed: 1.40
Speed Cost: 60
Step: 7 - Upgrade SCV
Total SCVs: 7
Speed: 1.96
Speed Cost: 60
Step: 8 - Add SCV
Total SCVs: 8
Speed: 1.96
Speed Cost: 120
Step: 9 - Add SCV
Total SCVs: 9
Speed: 1.96
Speed Cost: 120
Step: 10 - Add SCV
Total SCVs: 10
Speed: 1.96
Speed Cost: 120
Step: 11 - Upgrade SCV
Total SCVs: 10
Speed: 2.74
Speed Cost: 120
Step: 12 - Add SCV
Total SCVs: 11
Speed: 2.74
Speed Cost: 180
Step: 13 - Add SCV
Total SCVs: 12
Speed: 2.74
Speed Cost: 180
Step: 14 - Add SCV
Total SCVs: 13
Speed: 2.74
Speed Cost: 180
Step: 15 - Upgrade SCV
Total SCVs: 13
Speed: 3.84
Speed Cost: 180
Step: 16 - Add SCV
Total SCVs: 14
Speed: 3.84
Speed Cost: 240
Step: 17 - Add SCV
Total SCVs: 15
Speed: 3.84
Speed Cost: 240
Step: 18 - Add SCV
Total SCVs: 16
Speed: 3.84
Speed Cost: 240
Step: 19 - Add SCV
Total SCVs: 17
Speed: 3.84
Speed Cost: 240
Step: 20 - Add SCV
Total SCVs: 18
Speed: 3.84
Speed Cost: 240
Step: 21 - Add SCV
Total SCVs: 19
Speed: 3.84
Speed Cost: 240
Step: 22 - Add SCV
Total SCVs: 20
Speed: 3.84
Speed Cost: 240
Step: 23 - Add SCV
Total SCVs: 21
Speed: 3.84
Speed Cost: 240
Step: 24 - Add SCV
Total SCVs: 22
Speed: 3.84
Speed Cost: 240
Step: 25 - Add SCV
Total SCVs: 23
Speed: 3.84
Speed Cost: 240
Step: 26 - Add SCV
Total SCVs: 24
Speed: 3.84
Speed Cost: 240
Step: 27 - Add SCV
Total SCVs: 25
Speed: 3.84
Speed Cost: 240
Step: 28 - Add SCV
Total SCVs: 26
Speed: 3.84
Speed Cost: 240
Step: 29 - Add SCV
Total SCVs: 27
Speed: 3.84
Speed Cost: 240
Step: 30 - Add SCV
Total SCVs: 28
Speed: 3.84
Speed Cost: 240
Step: 31 - Add SCV
Total SCVs: 29
Speed: 3.84
Speed Cost: 240
Step: 32 - Add SCV
Total SCVs: 30
Speed: 3.84
Speed Cost: 240
Step: 33 - Add SCV
Total SCVs: 31
Speed: 3.84
Speed Cost: 240
Graph of values for adding SCV vs upgrading speed at each step
![[image loading]](http://i.imgur.com/SLYJ7.png)
Assumptions/Considerations
+ Show Spoiler +
- If the value of adding an SCV equals the value of upgrading SCVs, then I gave preference to adding an SCV. This is because the cost of adding an SCV is always less than upgrading, therefore there is a greater chance that the player will have enough money for the upgrade at a given wave in the game.
- This build order assumes that the player will always have enough money for the optimal upgrade when it comes time. This may not always be true, so the player must evaluate, for example, if it would be better to skip a 240 mineral upgrade in favor of adding 1 or 2 SCVs and waiting till the next round to upgrade. The additional income may be better than following the order precisely, but these variables are too difficult to model, e.g. round times completely vary depending on how quickly both teams kill waves.
- This build order assumes that the player will always have enough money for the optimal upgrade when it comes time. This may not always be true, so the player must evaluate, for example, if it would be better to skip a 240 mineral upgrade in favor of adding 1 or 2 SCVs and waiting till the next round to upgrade. The additional income may be better than following the order precisely, but these variables are too difficult to model, e.g. round times completely vary depending on how quickly both teams kill waves.
Matlab Code
+ Show Spoiler +
![[image loading]](http://i.imgur.com/cYFyr.png)
How to find this map (tested on NA)
- Starcraft 2 -> Multiplayer -> Join A Game -> By Category -> Tower Defense (usually top hit)
- Or search for "Squadron Tower Defense"
http://www.squadtd.com/ by tsjnsn