Status
SteamPeaks
ChartsSalesUpcomingPatchesEventsCalculator
New on SteamEvery app, DLC and depot the minute Steam creates itAppsEvery app on Steam, newest change firstPackagesSubs and bundles, and what each containsDepotsDepots, manifests and install sizesTagsSteam's user tags and the games under themDevelopers & publishersCompanies and their cataloguesTechnologiesEngines, SDKs and anti-cheat found in the filesChange historyEvery PICS changelist as it lands
SignalsNineteen readings of the whole catalogueCompareAny games side by sideRecordsAll-time peaks and the days they were setReportsWeekly and monthly write-upsAlerts & newsroomWatch a game, get told when it movesSteam statusIs Steam up, right nowWeb API explorerTry the endpoints in the browser
EventsSteam's own events and the sales calendarCalculatorWhat a Steam account is worth, and its pile of shame
/
Sign in
/
SteamPeaks
The ultimate resource for Steam data.
ExploreChartsSalesSales and festsUpcomingPatchesEventsRecordsTrendingSignals
DatabaseAppsPackagesDepotsTagsDevelopersTechnologiesChange history
ToolsCalculatorCompareSearchAlertsSteam statusAPI
SiteMethodologyFAQDiscordSupportSign in via Steam
Not affiliated with Valve or Steam. Game names and artwork belong to their owners. All times UTC.
PrivacyCookiesFair useStatus
Zero-K - Bronze Donation ($10)›Events›Cold Take #38 - Avoid State Toggles
Community

Cold Take #38 - Avoid State Toggles

Zero-K - Bronze Donation ($10) · published 6 months ago

All eventsPlayers around this dateRead on Steam

Almost everything players do in RTS is done by issuing direct commands or by toggling states. Direct commands give units a temporary goal, and include classics such as "move to this location" or "shoot at this enemy until it dies". State toggles make more permanent changes to how a unit behaves, at least until the state is toggled back. Examples include auto-cast toggles, toggleable abilities, and the stance and formation buttons used in the Age of Empires series. Toggles can be fine when used sparingly, but Zero-K did the opposite, to the point that we might have more than any other RTS. The upside is that we learned a lot about how and why to avoid state toggles.

The allure of state toggles is that they seem to epitomise the idea of Fight Your Opponent, Not The UI. Players should be able to express their wishes with minimal commands; in Warcraft III you want a Priest to use its extra mana to heal, then being able to tell it to automatically heal implements that desire with one click. In Zero-K, players often want units to keep the enemy at their maximum range, which is much easier to do with a state toggle than a constant stream of redundant move commands. We can also think of state toggles in terms of the demarcation between a unit's abilities and its behaviours. For example, shooting feels like behaviour, so it makes sense to have a Hold Fire state toggle.

There are broadly two types of state toggle: ability toggles and behaviour toggles. This is a useful distinction despite the fact that, at a fundamental level, everything a unit can do is an ability, and every different way it can choose to do it is a behaviour. In practise there is a often clear difference between controlling a specific ability or generic behaviour, although some toggles end up in between.

Ability toggles are found in many games and include cloaking, burrowing and deploying. To be precise, we can define an ability toggle as a state toggle that is a necessary part of using an ability. You cannot set your tanks to siege mode without touching the siege mode toggle, but you can cast spells in Warcraft III without toggling auto-cast, so auto-cast is a behaviour toggle. On the topic of Warcraft and Starcraft, their Hold Position command is not a toggle at all since it has to be re-issued each time you want your units to stay still.

Total Annihilation was one of the earliest games which put behaviour toggles such as Hold Position front-and-centre. Everything that moves had a move toggle with three states: Hold Position, Manoeuvre and Roam, with the latter two effectively being "move around a bit" and "move around a lot". Everything with a weapon also had a fire state with three states: Hold Fire, Return Fire and Fire At Will, with return fire causing units to shoot back after they take damage. Total Annihilation also had ability toggles, such as cloaking and the ability to turn Solar Collectors on or off.

The problem with state toggles is that they are fiddly and are, for the most part, the least satisfying way to control units. Issuing orders, say to set up a flank or to unleash an ability on a group of enemies, is much more fun than fiddling around with buttons tucked into the corner of the interface. Many state toggles have subtle effects, which makes it hard for players to see that their actions had any impact. Seeing the states of units is itself a problem, as there is no good way to fully display the more abstract states. Zero-K fails to show all the different ways a state is toggled in a mixed selection of units, and while there is an option to show states overhead when shift is held, it is very messy so not something we would want to enable.

The lack of visual feedback can be solved by reflecting the state of units in the game world, and games that limit themselves to a few high-impact ability toggles tend to do this well. Think transparent cloak effects or unit deployment animations. However, this solution does not scale, as it is most effective when the entire body of the unit is transformed, so multiple states end up fighting for space. It also does little to alleviate the fiddliness of toggling the state, or the mental overhead required to make sure your units are in the right state. Units with high-impact ability toggles require more player attention, which is a recipe for fights with the UI.

Compounding these issues is the inexpressiveness of state toggles. A move command contains a lot of nuance about exactly where you want your units to go, and a line move contains even more, whereas a state toggle can only be in one of a few states. State toggles are a woefully inefficient way to communicate your intentions to your units. Admittedly there are exponentially many ways to set the states in an army of units, but toggling them all would take time better spent issuing many commands. We want to translate player intention to unit action as effectively as possible, and for this, state toggles are not the way to go.

Zero-K uses relatively few ability toggles and is a recovering behaviour toggle addict. Our use of ability toggles is curtailed by the idea that state toggles should be as optional as possible. This would seem to rule out many abilities, such as deploying to fire, but strictly speaking it only rules out versions of the ability that require a manual toggle. A toggled ability can have an automatic behaviour provided that toggling is never a bad idea. For example, our deployable units avoid state toggles by having their pack-up times tuned so that deploying is almost never wrong, so they may as well deploy automatically when idle. This restricts our design space, but removing a toggle is worth it.

We have some true ability toggles, but many of them are designed to rarely need toggling. Cloaking is one example, as beyond the very early game it is rarely a good idea to turn it off. The cloaked constructor even has free cloaking to avoid micro-optimising it in the opening. In the case of necessary toggles we try to limit them to expensive units. These include the gravity gun push/pull toggle, high/low trajectory fire for particularly heavy artillery, and the hunker down ability of heavy turrets. The most common important ability toggle is probably the Float/Sink state for amphibious units, which is like deployment, but the transition takes a bit too long and it makes units vulnerable to surface fire.

Sometimes a new ability toggle can be avoided by piggybacking on an existing one. For example a handful of light units and turrets can also hunker down to reduce incoming damage, but they do so fast enough for the behaviour to be automatic. Most of the time this lets them use the ability without touching a toggle, and in a situation where the units should stay armoured, they can be set to Hold Fire. The Float/Sink toggle works similarly since, by default, units only float to fire at the enemy. In more extreme cases we redesign units to remove state toggles, or avoid adding a toggled ability in the first place. Raven dive is an example of the former, while shield link is an example of the latter.

It is important that state toggles can only be toggled by the player. This sounds obvious, but the default engine behaviour does not adhere to it. Cloaked units used to toggle themselves to "decloak" when out of energy, but revert back to "cloak" if energy became available. I assume the intent was to have the state of the toggle tell the player the state of an ability, but consider what happens when you want to decloak some units during an energy stall. Units that seem to be told to decloak are actually in a secret "cloak when there is enough energy" state, and this state was impossible to detect, let alone toggle. Trying to turn off a group of fluctuating cloaked units was a nightmare, so the player-facing state cloak and on/off states are now handled by Lua, and always reflect what the player told their units to do.

We managed to avoid having too many ability toggles, but went a bit overboard with behaviours. Early on in Complete Annihilation we had many developers adding all kinds of behaviours, so as a form of safety, each of these behaviours got their own toggle. Many of these behaviours were meant to be strict improvements, but we were humble enough to not expect everyone to want the new behaviour. The result was a number of toggles that were designed to never be touched, since the new behaviour should be better, and more flexible, to encompass everything a player might reasonably want their units to do.

The behaviour toggle situation was dealt with in 2020. The more obscure toggles were hidden by default and the interface was changed to show at most twelve at a time, which is a limit that is very rarely reached. By this point few players could say where the engine unit AI ends and Lua takes over. The tactical AI gadget extends a lot of Attack Move and idle behaviour, including causing ranged units to stay at maximum range. Its toggle can be hidden because it is overridden by Move commands, and partially by Hold Position. Overkill prevention also has a hidden toggle, but is overridden by a Force Fire command. During the cull we also hid the mostly redundant third options for move and fire state, as a toggle with two states is much easier to use than one with three.

The acceptability of a toggle depends on how it is intended to be used. Construction priority is one of the toggles we expect players to touch the most, but it is fine because it is rarely toggled in the heat of battle, and it implements a simple decision for which there are only a few options: high, low or medium priority. Construction is a long-term action and controlling its flow manually would involve a lot of redundant commands. For faster-paced situations, such as battles, the toggles are designed to be overridden by direct commands, to let players give commands rather than fiddle with toggles.

The silver lining to all this state toggle proliferation is unmatched customisation of unit behaviour. Early on we added a section of the menu that lets players set their own default state for each unit type. Some players, including myself, like to set everything to Hold Position, while others set up preset construction priorities to make sure their metal extractors are built as fast as possible. The extraneous toggles that nobody wants to tweak in the heat of battle found their home here. Players can disable various bits of the unit AI on a per-unit-type basis, for every future battle. What started as a mess of widgets, all with their own toggles, ended up being a vast set of options to tweak unit behaviour to your liking.

Index of Cold Takes

More from Zero-K - Bronze Donation ($10)

Other announcements

All events
Community30 Aug 2026Cold Take #46 - Giving and Taking FeedbackA lot of the polish in Zero-K is driven by player feedback. A single complaint can be enough to spark a re-investigation of some part of the game to check for improvements. Case in point, the recently upgraded build icons are a result of someone complaining that the icons were too hard to see. But it takes good feedback to see this kind of result, so today it is time for some advice on how to g…Community9 Aug 2026Cold Take #45 - Automatic DodgingSimulated projectile physics is a core part of Zero-K, both for the aesthetics and as a balance tool. Rather than using armour classes, light units are nimble enough to dodge most of the projectiles meant for heavier targets. We also want to create powerful controls, so players can fight their opponents rather than the UI , and automation is part of achieving this goal. So you might expect us t…In-game event2 Aug 2026Zero-K v1.14.8.0 - Unit Icons and Magpie NerfThis update improves the command menu by adding larger build icons with a higher resolution. The bottom of the UI also has a scale setting as we move towards better support for increasingly large screens. There are also a few fixes and a setting that automatically disables cables for Linux users with ATI graphics. Anyone coming forward to reproduce, and potentially even fix, the cable bugs woul…