Ceasar's Mind

Follow me: @Ceasar_Bautista

Posts Tagged ‘game design

1v1 Combat

leave a comment »

At the lowest level of the RTS, units have to be balanced against other units. Typically this is achieved by first guessing approximate values for a unit and then play-testing extensively until the unit no longer breaks the game. Play-testing anything enough should always return acceptable results.
However, there is undoubtedly a math to it all. Some laws of RTS nature. They are not at all simple however, and it’s probably impractical to figure them out, but it’s kind of fun and in certain ways useful.

Anyway, the first thing I looked at was how to balance one unit against another. To do so, I imagined a two-dimensional world that was completely empty of everything except the two units to be balanced, placed apart so that neither could immediately strike the other. From there, the idea was that if both units could kill each other at the same time, the two were balanced.

I examined only four basic attributes to start: Damage per second, Hit Points, Range, and Movement Speed. To start, I considered basic scenarios. For example, imagine the following two units:

Unit A Unit B
Hit Points 10 X
Damage 1 1
Range 10 0
Speed 0 2
What value of X will work to make things fair? Well, since Unit A has more range than Unit B, Unit B will be doing the running and with two speed it will take 5 seconds. During each of those seconds, he will take 1 damage from A, for a total of 5 damage. Then B will proceed to strike A, and with A’s 10 HP and B’s 1 Damage, it will take 10 seconds for B to kill A, during which time B will take another 10 Damage. So we add the two together and see B will take a total of 15 Damage. B should therefore have 15 HP to be balanced against A.

Furthermore, we can say that if A is balanced against B, and B is balanced against C, then A is balanced against C, even if A and C were not to kill each other at the same time. This is important because speed provides an advantage only if the unit has less range than the enemy.

Using the transitive property, the easiest way to balance units is to pit them against the Universal Unit (UU). The UU has 1 damage, 1 speed, 0 range, and infinite HP.

A general formula can be constructed, where Unit 1 has longer range than Unit 2:

Personally, I find that a bit confusing. And worse, it doesn’t fully cover everything since there is no mention of S1. The formula is incomplete and had me confused for a very long time.

The solution came as an epiphany when I was looking stats of units had I generated that were “fair.” As such, there is very little evidence besides the idea being evidence for itself. But it does in many ways make sense. So instead of that other formula, it turns out that balance can be simplified as such:


K represents an arbitrary value of the designers choice and effectively, the value of the unit (and so the price).

This formula seems to make intuitive sense. Units with high range do well with high damage, but not so well with high HP. In fact, for the most part, such a unit would plainly suck. Likewise, a unit with high damage and high speed but low HP and low Range would also suck. It would never make it to it’s enemy alive. (Such units can be useful however. It’s just that in 1v1 they aren’t at all.) On the other hand, a unit with high HP and high damage though would be pretty solid.

Now, this formula only effectively explains 1v1 match-ups and doesn’t do a good job at all when it comes to mixed units or even just group combat. But it does give a pretty solid way of balancing units at the most basic level to start.

So, we know that (H+R)*(D+S)=K, but that doesn’t exactly tell us how to counter. Fortunately, it’s really rather simple.

The basic idea is to nullify the opponent’s strength. If an enemy unit is fast, render its speed useless by attacking it with tough units that possesses little range. If an enemy unit has excessively powerful attacks, swarm it with expendable units so as to waste the enemy’s strength. If a unit has excessive hit points, employ units that deal heavy damage in short bursts so as  to minimize overkill. And finally, if an enemy unit long range, attack  it with a unit that moves quickly to make full use of the speed.

This seems to be intuitive, but a player may easily miss the fact that if units are properly balanced, then these match-ups must be in your favor- the numbers force it to be so.

Written by Ceasar Bautista

2010/06/16 at 21:14

Posted in Uncategorized

Tagged with , , , ,

The Power of Speed

leave a comment »

Speed is perhaps the single most valuable attribute a unit can have. While it’s not particularly useful without some power to back it up, speed can be nasty when utilized by an intelligent player.


At the most basic level, speed has some very direct power to it. In the picture above, let’s assume that Blue’s units move faster than Red’s and that both units are equally powerful and subsequently obliterate each other when they meet. For the most part, Blue’s speed does nothing for him except move the location of the front line. If Blue is twice as fast, he’ll control twice as much of the line. Alone, this is not particularly useful. However, in one dimensional space one there is one advantage still: For every additional unit you have, the front line will be pushed back  a certain distance proportional to your speed and the rate of general production. Effectively, each units gives you the percentage of all speed controlled (your unit speed / (your unit speed + opponent’s unit speed)) multiplied by the distance between your opponent’s units. Some implications:

  • There’s a certain strength in slow units in that the distance between allied units is relatively short, making it more difficult for an opponent to gain space. Fast units however initially control more space and capture space quicker.
  • Effectively, this means that the less quick production is, the more important each individual unit becomes. This is rather obvious when production is slowed down to an extreme, to a point where a single extra unit could travel unopposed to the enemy base.

In isolation, this is not particularly useful. But when combined with multiple control points it’s really extremely powerful.


The real strength of speed is made apparent when batteries are available or can be formed. In the picture to the right, Blue will be able to strike Red’s left node and defeat him before the right node can move in to suppress Blue’s advantage.

The real beauty here though is that each node connected through allied nodes can always trade space in order to reinforce another node. The slower your opponent is or otherwise the more distance between you two, the more resources can be directed elsewhere. And by temporarily redistributing resources, a player can conceivably strengthen a particular node enough to knock out an enemy one, and subsequently use the extra production to win the game.

More to come…

Written by Ceasar Bautista

2010/06/07 at 23:51

Distance is Money

leave a comment »

Consider this thought:

At the start of the game, the most aggressive option your opponent has before him is to immediately start streaming units. The stream, however, takes time to arrive. When it does arrive, you can simply stop moving units from the point of attack and simply match his stream. What’s important though is what happens in the meantime: any resources generated are free to be spent as you please. (Furthermore, your opponent, in producing units to attack, does not collect any free resources, or otherwise does so after he stops streaming.)

The implications are rather important. Effectively, whether or not a player can expand to uncontested points is based entirely on whether or not he has enough free resources to pay the price. Or more simply, in maps where the bases are closer, more resources have to be spent on directly fighting the opponent, while in maps where the bases are farther apart, players are more free to use their resources for other means (such as research, upgrades, or expansions).

Cutting the Distance

This central idea also means that when a buffer is destroyed, a bunch of resources that were free instantly become locked up, since the “distance” is now shorter. It now takes less time to get through the buffer since the stream can move through unopposed. This locks up units on both sides, which can be absolutely devastating if your opponent is not prepared. (Think, proxying.)

Consider the StarCraft 2 map Scrapyards. In the center, there are breakable rocks that otherwise obstruct ground movement. Upon their destruction, a player who has recently expanded could be utterly destroyed, while in general, the cost of expansion will be much higher for both players.


Air Units

Since air unit’s don’t deal with any physical obstruction, the distance between them and the opponent is significantly shorter. Make sure to invest in defenses as appropriate!


Mobile Factories

sandtrap-1.jpg image by YakZSmelk

In games with mobile factories, for example Halo 3’s Sandtrap (the one with the Elephants), this means that the freedom of units can be adjusted by adjusting the distance. For those of you unfamiliar with Halo 3, Sandtrap is a unique map where players can drive around Elephants, slowing moving, indestructible bases, which house the Flag objects for Capture the Flag, and influence where players spawn. If for example, the Elephants are driven near each other, then both teams will be constricted to fighting rather directly. On the other hand, if the Elephants are kept at a distance, then players are more free to search for vehicles and weapons.

Written by Ceasar Bautista

2010/05/12 at 00:04