Difference between pages "Cold Takes/12 - Mighty Morphing" and "Cold Takes/10 - The Smartest Unit in Zero-K"

From Zero-K
(Difference between pages)
Jump to navigation Jump to search
(Init. transfer)
 
(Some image sizes tamed.)
 
Line 1: Line 1:
{{blog post}}
+
{{blog post||20 Apr 2024}}
  
Players coming from other strategy games often find classic conventions broken and common systems missing. The three focused on improving units - morphing, veterancy, and research - are largely absent from ZK. Today is the first of a series of guest articles by Sprung that will talk about them.
+
Most player actions in real time strategy boil down to giving commands. After all, these are games about telling units what to do. But there is a subtle difference between RTS and most other genres, in that players tend to act indirectly, by assigning goals to units. The game world itself is only ever affected by units as they try to achieve their goals. This takes a certain level of unit intelligence, and the stakes are high. The fantasy of commanding an army can be shattered by a single unit wandering off in a weird direction.
  
First, let's talk about the unit improvement system that still exists vestigially in ZK: morphing. Morphing is often called upgrading, but I won't use that term to avoid confusion since it can also mean research. Very generally, morphing lets you improve or modify a single unit, as opposed to upgrading all existing and future units of that type, like research does. This can be as little as paying three seconds of time to deploy a Terran siege tank; or as drastic as changing two Protoss Templar into an Archon. Of course you can have morphing as a major part of faction identity and aesthetics, but let's talk gameplay. When to have morph instead of just letting players build things normally?
+
Issuing commands also has to feel good, since it is your primary way of interacting with the game. This implies that common commands should be small and simple, like short words. In fact, commands can be thought of as the language used by players to tell their units what to do. This analogy turns unit control into a communication problem; how can the player communicate their grand plans to the fragile bundles of code that stand-in for the brains of their units?
  
[[File:110756504e95530061768e4c82a43bb3c4d71372.png]]
+
The units of Zero-K are relatively smart. Here are some examples.
An easy answer is that sometimes you already decided not to let players build more of the unit. In ZK you only get one commander, and there's a limited number of geothermal spots. Accordingly, they are the only two cases where morphing is just a straightforward upgrade. The astute reader may have noticed that metal spots are also a limited resource, and indeed mexes used to morph into Moho mines for a short period before [[Cold Takes/5 - Making Metal|overdrive]] was instated. Here morphing lets you decide to get more mileage while working within the limit.
+
*Units in almost all games know how to close range with the enemy, but Zero-K units also know how to step backwards when the enemy gets uncomfortably close.
 +
*They can be told to hold their fire against cheap targets, and know how to stop short of firing enough missiles to kill something twice over.
 +
*They can be told to repair or reclaim everything in an area, rather than requiring that the player point out each target individually.
 +
*Some can be told to avoid wasting their precious reload time on wobbly radar dots, while others can be told to fire in the general direction of distant targets.
 +
*Units even know how to spread themselves out along a line.
  
A nice example from another game would be the Chinese Overlord tank from C&C Generals. It has a soft limit by virtue of simply being too expensive to field many of them, but you can add extra weaponry on top for even more firepower. Allocating skill points for WC3 heroes can also be thought of as a form of morphing, and it's no accident that allocating modules for ZK commanders looks so similar.
+
[[File:Line move.gif]]
  
[[File:0fd658cf4b6965cae07941ead5a02e4af6e8b19d.png]]
+
The examples above hardly seem earth-shattering, but that is by design. Zero-K units are only much smarter than average because they understand a wider range of commands. The more complicated behaviours, such as the ability to move away from enemies, are optional. Set a unit to hold position and avoid telling it to Attack Move, and it will stay put. This is vital because the principle ''fight your opponent, not over-automated ingrained unit behaviours'' is just as important as [[Cold Takes/3 - Fight your opponent, not the UI|fight your opponent, not the UI]].
The flip side of a unit limit is flexibility. RTS is, among other things, about making the correct units to adjust to a quickly changing battlefield. The flexibility of morphing lets players continue making choices about their unit composition in face of a limit. Warcraft heroes, Generals Overlords, and ZK Commanders all present multiple morph choices for this reason. Similarly, in Dawn of War earlygame, forcing the player to choose between Flamers or Bolters for their first tactical marine squad, blindly, would not be good design. Morphing some marines to equip weapons lets players make that choice later, while still having a squad on the field to capture points, scout, and do other tasks that don't yet involve picking a specific unit composition. Then, when you scout Orks? Brother, get the Flamer. The Heavy Flamer.
 
  
Back to ZK though, since we don't really put any pressure on the player in the form of unit limits, there is barely any need for the flexibility. Ramping economy means that even the most expensive units can become somewhat affordable over time, and by that point you have all the flexibility in the world anyway. Would it hurt to have a little extra?
+
In short, Zero-K units are smart by virtue of their expanded command vocabulary, rather than by making decisions themselves. Units should not be making significant decisions, those are for the player to make, because otherwise we start diluting the "Strategy" in RTS. To this end, the complexity of each command has to be quite limited. Notice how the examples above were explained in about half a sentence? You have to be able to to describe your intention when giving commands, otherwise unit control becomes a process of clicking random buttons while hoping for a good result. So unit behaviours need to be predictable. For example, the "keep enemies at a distance" aspect of Attack Move only considers the closest enemy, since a whole-battle view would be too chaotic.
  
The problem with flexibility is that it creates a sort of Schrödinger's unit that occupies multiple spots in design space at once, to be resolved into one of them when observing the enemy. The danger ZK sees here is that a [[Cold Takes/11 - The Atomic Solution to Monospam|monospammed unit could become a composition]] thanks to its own flexible morphs. Everything becomes much simpler when you can do Just-In-Time reinforcements of the correct type without having to do lame nerd stuff like "logistics" or "foresight". No travel time from the factory. Less risk of overbuilding a variant. Of course these can be adjusted via other stats, but that would all come with a reduction in flexibility.
+
[[File:UI command design.png|thumb|upright=2|Command design.]]
  
[[File:1a136c2b5fad221386fcfc5adf6dac0c93b39ceb.png]]
+
Commands are great, but how do they relate to the smartest unit in Zero-K? Well, players assign goals to units, which the units then try to execute. Achieving goals seems like a good measure of intelligence, so we can think of the smartest unit as the one that is the best at using its abilities to achieve goals. This includes goals that the player has trouble communicating due to a limited command vocabulary, so as to not give a free pass to abilities that are trapped behind poor UI. Also, since we are talking about game AI, it is more useful to think in terms of "least stupid", where stupidity is the misuse of an ability in pursuit of some goal.
What about "inflexible" morphs, where there isn't really a composition to talk about and you just want to add more stats? Say, why doesn't a factory have a +10 Buildpower upgrade? It would be more atomic than a Caretaker, who can also do other tasks such as repair! Or, if I want to upgrade Felon battery recharge rate, I have to either get Convicts and have to pay for buildpower I didn't sign up for, or Thugs with inefficient guns thrown in. Meanwhile, a +15 shield regeneration morph would be atomic while remaining a choice! Part of the answer is that [[Cold Takes/6 - Physics vs. Formulas|units are physical entities]] in the world and thus there is more interaction between them. In particular, Convict buildpower and Thug guns nudge the player into using them, which then cascades into the usual complexity of the game when the enemy has to respond in turn. The other part is emergence. Felon wasn't initially designed to work as a standalone unit and get "batteries" added; rather, it was designed to itself be added to a shieldball as a way to spend charge. Batteries are a player discovery, if an extremely obvious one.
 
  
[[File:b12fa40e432ba1d741ddfe03a96467c578c2b98e.png]]
+
The stupidity formulation of smartness turns abilities into liabilities. For example, if you tell a unit to move East and it ends up walking West, then we would say it uses its movement stupidly. But if the unit has no legs, so fails to move at all, we can hardly blame its failure to achieve the goal on its inbuilt AI. Thus, the only units with "perfect" pathfinding are those with the inability to move. And being incapable of failing is almost like intelligence.
An interesting feature of morph is that it provides its own buildpower and can have different tech requirements, which then can be used to adjust the appeal of different options. If you require a unit to be built "normally" then it competes for infrastructure (buildpower, logistics) with other units that you may rather be building. Morphing is a way to avoid this, which makes the unit more attractive, or the usual infrastructure less attractive. To put this in concrete terms: say you want to encourage mobile cloakers, because cloaking is cool. If you require people to build them from a cloaky factory, then sometimes they'd rather build a different factory as a secondary, or if they already have a cloaky factory, they'd rather build a different cloakybot. Morph lets a unit be its own little temporary factory, and the elegance of this is that much like [[Cold Takes/9 - Energy as Supply|energy requirements]], it touches just the infrastructure and not the unit itself. The morphs for mobile cloaker and shield, while originally created just as a way to let them redeploy, fall under this category. We try to avoid this type of morph outside of utility units since infrastructure exists for a reason, and while it is [[Cold Takes/8 - Smoothly Flowing Economy|easy to manage]] it should not be obsoleted.
 
  
[[File:05acba603f1c69bfc4eeac0022b589261bad2dac.png]]
+
[[File:Smartest storage wins.png|frameless|left]]
At the beginning I mentioned Siege Mode as an example of morph. In ZK, a handful of units - for example Crab, Fencer and Emissary - have a soft siege mode where standing still gives them some sort of benefit. They deploy so fast that not doing so would mostly be a matter of not having the APM, so rather than make the players [[Cold Takes/3 - Fight your opponent, not the UI|fight the UI]] by spamming Deploy every time they want to move, the units deploy on their own. To let this happen, there is a deliberate large gap in unit design space where nothing has a deployment mode that would be long enough not to automate, yet short enough to make you miss the automation by being commonly desirable. On the other side of this gap we have Desolator, which can deploy into an armoured form, but it takes long enough to make it a rare decision that can afford to be manual. Thus, unit intelligence, or rather [[Cold Takes/10 - The Smartest Unit in Zero-K|avoiding situations that would create unit stupidity]], is what prevents sufficiently cheap morphs from existing.
 
  
A final way morph can be used is to randomly change a unit into a completely different unit, apparently for no good reason. Why does Lurker morph from Hydralisk? The answer seems less to do with any explicit unit design, and more with how it just had to be crammed somewhere given there were no empty slots on Larva build GUI. Hydra was the least awkward place to put it. Surely ZK would not do something as silly as, say, let Knight morph into Crab without an extraordinarily good reason, right?
+
So there you have it. The smartest unit in Zero-K is the humble Storage. It has a single ability - to blow itself up - and it is very rarely a good idea. Consider some alternative candidates. Most energy structures have impressive explosions, so it is more conceivable that a player would want to give them some sort of Fire At Will stance. Solar Collectors are out due to the wealth of agency bestowed upon them by the ability to armour up. But perhaps you have a more normal, less technical, definition of unit. One that involves the ability to move. In that case, I might have to argue for Aspis, the mobile shield generator, for the title of smartest unit. But if you have alternative candidates, be sure to post them.
  
[[File:b12d3548246ba30ee5d2a24567a71ac779dfef3a.png]]
+
So let's take stock of Aspis's abilities. Being unarmed is a good start, since deciding where and when to fire is a whole can of worms. Then there is the issue of pathfinding, which I could have avoided by nominating a plane or gunship. However, with great mobility comes great responsibility, so even Owls need to be pretty smart to not fly into an untimely end. No, a slow ground unit is safer, as its low speed makes it less responsible for its fate. And besides, the pathfinding in Zero-K is pretty good.
...right?
 
  
But that is a topic for another week.
+
Aspis can also charge its shield, float, morph, and self-destruct. Floating and morphing are niche options for Aspis, and self-destructing is very rarely good. That leaves charging, which can be toggled on or off, and is integrated into the [[Cold Takes/8 - Smoothly Flowing Economy|priority system]]. So Aspis has a pretty good command vocabulary in this area. Remember, it is not on Aspis to optimise its energy drain for the overall economy, it just needs to have a rich set of ways for the player to tell it what to do. So Aspis is very good at using its abilities. Now, those of you with some shield experience might be wondering, what about shield link? Aspis can share its shield charge with nearby shields, and there are some well known ways to exploit this ability.
 +
 
 +
[[File:Shield decisions.png|frameless|center|upright=3]]
 +
 
 +
Aspis' bid for the title of smartest unit hinges on the fact that shield link is a passive ability. Think back to Storage, is it "smart" or "stupid" for blocking projectiles? No, being hit by projectiles is part of being a Storage, it is a passive rather than an active ability. So too with shield link. If two allied shields touch, they share charge. Nobody can control it, and this sort of thing is a powerful technique for making units seem smart. Simply avoid giving units opportunities to be stupid.
 +
 
 +
Imagine if Aspis could control when to link, it would be an absolute AI nightmare. Linking is great when you need to pump charge into a Felon, but it can send a shield cluster below the threshold required to block tacnukes. The decision to link or not would take global information into account, and the best course of action would change too fast for players to manually control. A configurable linking stance would be unwieldy and riddled with edge cases, making it unpredictable. So it is better to keep linking innate, and let both sides of a battle work its straightforward behaviour into their plans.
 +
 
 +
[[File:Ogre vs Dirtbags.png]]
 +
 
 +
Shield link is the highest-profile case of making an ability passive to avoid tricky optimisations, but we have many other more subtle ones. For example, Snitch and Imp have the ability to hide themselves by burrowing when stationary. If they took a significant amount of time to unburrow, then whether to burrow would be a decision with many strategic factors. Rather than make this decision, or make players manually press the burrow button, we made unburrowing near-instantaneous. Here are a few more examples.
 +
*Bulkhead and Fencer pack up quickly for similar reasons.
 +
*Units cannot hurt themselves with area of effect damage, as firing safely has tradeoffs.
 +
*Vehicles are very bad at moving in reverse, so that they do not seriously consider doing it.
 +
 
 +
To sum up, unit intelligence has three parts; vocabulary, competence, and not expecting too much. Think about what is going on next time you encounter a stupid unit. Does it lack the command language to understand what you are trying to tell it, does it lack the competence to achieve the goal, or do its abilities mean it has to solve complex optimisation problems which lack a satisfactory answer?

Latest revision as of 14:35, 28 September 2024

Cold Take #10 - The Smartest Unit in Zero-K

Posted April 20, 2024


Most player actions in real time strategy boil down to giving commands. After all, these are games about telling units what to do. But there is a subtle difference between RTS and most other genres, in that players tend to act indirectly, by assigning goals to units. The game world itself is only ever affected by units as they try to achieve their goals. This takes a certain level of unit intelligence, and the stakes are high. The fantasy of commanding an army can be shattered by a single unit wandering off in a weird direction.

Issuing commands also has to feel good, since it is your primary way of interacting with the game. This implies that common commands should be small and simple, like short words. In fact, commands can be thought of as the language used by players to tell their units what to do. This analogy turns unit control into a communication problem; how can the player communicate their grand plans to the fragile bundles of code that stand-in for the brains of their units?

The units of Zero-K are relatively smart. Here are some examples.

  • Units in almost all games know how to close range with the enemy, but Zero-K units also know how to step backwards when the enemy gets uncomfortably close.
  • They can be told to hold their fire against cheap targets, and know how to stop short of firing enough missiles to kill something twice over.
  • They can be told to repair or reclaim everything in an area, rather than requiring that the player point out each target individually.
  • Some can be told to avoid wasting their precious reload time on wobbly radar dots, while others can be told to fire in the general direction of distant targets.
  • Units even know how to spread themselves out along a line.

Line move.gif

The examples above hardly seem earth-shattering, but that is by design. Zero-K units are only much smarter than average because they understand a wider range of commands. The more complicated behaviours, such as the ability to move away from enemies, are optional. Set a unit to hold position and avoid telling it to Attack Move, and it will stay put. This is vital because the principle fight your opponent, not over-automated ingrained unit behaviours is just as important as fight your opponent, not the UI.

In short, Zero-K units are smart by virtue of their expanded command vocabulary, rather than by making decisions themselves. Units should not be making significant decisions, those are for the player to make, because otherwise we start diluting the "Strategy" in RTS. To this end, the complexity of each command has to be quite limited. Notice how the examples above were explained in about half a sentence? You have to be able to to describe your intention when giving commands, otherwise unit control becomes a process of clicking random buttons while hoping for a good result. So unit behaviours need to be predictable. For example, the "keep enemies at a distance" aspect of Attack Move only considers the closest enemy, since a whole-battle view would be too chaotic.

Command design.

Commands are great, but how do they relate to the smartest unit in Zero-K? Well, players assign goals to units, which the units then try to execute. Achieving goals seems like a good measure of intelligence, so we can think of the smartest unit as the one that is the best at using its abilities to achieve goals. This includes goals that the player has trouble communicating due to a limited command vocabulary, so as to not give a free pass to abilities that are trapped behind poor UI. Also, since we are talking about game AI, it is more useful to think in terms of "least stupid", where stupidity is the misuse of an ability in pursuit of some goal.

The stupidity formulation of smartness turns abilities into liabilities. For example, if you tell a unit to move East and it ends up walking West, then we would say it uses its movement stupidly. But if the unit has no legs, so fails to move at all, we can hardly blame its failure to achieve the goal on its inbuilt AI. Thus, the only units with "perfect" pathfinding are those with the inability to move. And being incapable of failing is almost like intelligence.

Smartest storage wins.png

So there you have it. The smartest unit in Zero-K is the humble Storage. It has a single ability - to blow itself up - and it is very rarely a good idea. Consider some alternative candidates. Most energy structures have impressive explosions, so it is more conceivable that a player would want to give them some sort of Fire At Will stance. Solar Collectors are out due to the wealth of agency bestowed upon them by the ability to armour up. But perhaps you have a more normal, less technical, definition of unit. One that involves the ability to move. In that case, I might have to argue for Aspis, the mobile shield generator, for the title of smartest unit. But if you have alternative candidates, be sure to post them.

So let's take stock of Aspis's abilities. Being unarmed is a good start, since deciding where and when to fire is a whole can of worms. Then there is the issue of pathfinding, which I could have avoided by nominating a plane or gunship. However, with great mobility comes great responsibility, so even Owls need to be pretty smart to not fly into an untimely end. No, a slow ground unit is safer, as its low speed makes it less responsible for its fate. And besides, the pathfinding in Zero-K is pretty good.

Aspis can also charge its shield, float, morph, and self-destruct. Floating and morphing are niche options for Aspis, and self-destructing is very rarely good. That leaves charging, which can be toggled on or off, and is integrated into the priority system. So Aspis has a pretty good command vocabulary in this area. Remember, it is not on Aspis to optimise its energy drain for the overall economy, it just needs to have a rich set of ways for the player to tell it what to do. So Aspis is very good at using its abilities. Now, those of you with some shield experience might be wondering, what about shield link? Aspis can share its shield charge with nearby shields, and there are some well known ways to exploit this ability.

Shield decisions.png

Aspis' bid for the title of smartest unit hinges on the fact that shield link is a passive ability. Think back to Storage, is it "smart" or "stupid" for blocking projectiles? No, being hit by projectiles is part of being a Storage, it is a passive rather than an active ability. So too with shield link. If two allied shields touch, they share charge. Nobody can control it, and this sort of thing is a powerful technique for making units seem smart. Simply avoid giving units opportunities to be stupid.

Imagine if Aspis could control when to link, it would be an absolute AI nightmare. Linking is great when you need to pump charge into a Felon, but it can send a shield cluster below the threshold required to block tacnukes. The decision to link or not would take global information into account, and the best course of action would change too fast for players to manually control. A configurable linking stance would be unwieldy and riddled with edge cases, making it unpredictable. So it is better to keep linking innate, and let both sides of a battle work its straightforward behaviour into their plans.

Ogre vs Dirtbags.png

Shield link is the highest-profile case of making an ability passive to avoid tricky optimisations, but we have many other more subtle ones. For example, Snitch and Imp have the ability to hide themselves by burrowing when stationary. If they took a significant amount of time to unburrow, then whether to burrow would be a decision with many strategic factors. Rather than make this decision, or make players manually press the burrow button, we made unburrowing near-instantaneous. Here are a few more examples.

  • Bulkhead and Fencer pack up quickly for similar reasons.
  • Units cannot hurt themselves with area of effect damage, as firing safely has tradeoffs.
  • Vehicles are very bad at moving in reverse, so that they do not seriously consider doing it.

To sum up, unit intelligence has three parts; vocabulary, competence, and not expecting too much. Think about what is going on next time you encounter a stupid unit. Does it lack the command language to understand what you are trying to tell it, does it lack the competence to achieve the goal, or do its abilities mean it has to solve complex optimisation problems which lack a satisfactory answer?