Cold Takes/18 - Terrain Matters

From Zero-K
Revision as of 17:16, 29 September 2024 by RandomX (talk | contribs) (Changed image names.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Cold Take #18 - Terrain Matters

Posted September 7, 2024


Zero-K maps set surprisingly few hard restrictions on unit movement. Instead, many of them mainly use terrain to influence the value of locations, as well as how easy they are to reach and defend. There is also plenty of space for huge cliffs and vast seas, but what really sets our terrain apart is the subtle effect of each hill and valley. This is before even considering how explosions and terraforming change the terrain during the game. Terraforming elevates terrain, but it requires a strong foundation of important and nuanced terrain to make any sense. So for now it is time to look at how Zero-K uses terrain.

Hill saves Com.png

Maps can be decomposed into three main parts.

  • Shape: How high the terrain is at each point on the map.
  • Texture: The colour, reflectivity, and graphical roughness painted onto the terrain.
  • Resources: The metal spots, geothermal vents, and reclaimable rocks and trees.

The shape defines how units interact with the map, while the resources provide overall strategic goals. Well-designed terrain also gives players instrumental goals, such as to hold an important hilltop. The texture is purely visual, but vital for making the map look good and be easy to understand.

One of the more striking features of Zero-K terrain is how solid it is. Very little can pass through a wall of solid rock, but in most strategy games units are able to shoot through cliffs with ease. But beyond physical projectiles, there is also the sense that the three-dimensional shape of terrain really matters. Terrain in the average strategy game amounts to little more than a binary mask that neatly splits the map into walkable and non-walkable. A sense of height is often limited to layers of plateaus, with ramps between them, which may block sight or impose a penalty for shooting up to a higher level. Zero-K terrain is not divided into levels, it varies smoothly, and the penalties flow from natural features of terrain, such as hills being opaque and difficult to climb.

Hill saves Reavers.png

Weapons being blocked by terrain is so important that many are designed around whether they fire in an arc or need a direct line of fire. Lasers travel in straight lines, so are blocked by small hills, while a large mountain might block all but the highest-trajectory plasma cannons and missiles. This effectively gives us a dynamic and directional cover system, one which depends on understanding the shape of the map rather than a more gamey type of bonus. This form of cover gives shorter ranged armies ways to close in on their targets, for example, by walking in a ditch or hugging the lee of a cliff. Cresting hills and ramps is also really impactful, since units climbing a hill can only shoot at the other side once they reach the top. However, everything in the valley below can shoot as soon as a target appears against the horizon. This creates shifting asymmetries all over the map, resulting in a complex system of positional advantages.

Confused Mace.png

Units at the top of a hill are quite exposed, but the upside is that they can see everything around them. Terrain blocks line of sight and radar, which makes high places ideal for scouts and radar towers. Ridges create radar shadows that allow for stealthy army movements until they are crested. Even units that can shoot over terrain will need something to spot targets on the other side. A seemingly empty hill may actually be home to a cloaked scout, spotting for artillery below.

Hills are also a good place to put many units, since a common weapon type, the plasma cannon, has ballistic trajectory. This gives it a range bonus when shooting down and a penalty when shooting up. Lasers do not fare so well, since their spherical 3-dimensional range causes them to lose range while shooting up or down, while missile range is unaffected by height. This is important for deciding which units to use where. When attacking up a ramp you might want to use missiles, while attacking downwards is best done with plasma cannons, all else being equal.

Fencer positioning.png

Units suffer a speed penalty when climbing terrain, which makes hills even more attractive. This can be a doubled-edged sword, as retreating back up a hill after a downhill assault is also more difficult. In addition to the tactical uses, bumpy terrain also slows units down while moving around the map. Terrain can also form hard boundaries by having slopes that are too steep for units to climb. This depends on the slope tolerance of the unit: vehicles have low slope tolerance, bots (walking robots) have moderate slope tolerance, and spiders are able to climb everything.

Slope tolerance is a hard threshold in an otherwise smooth system, which is a dangerous thing to expect players to handle. We only use two thresholds, one for bots and one for vehicles, to keep things simple. As far as I am aware these values are unchanged since Total Annihilation. Maintaining compatibility across maps is too important and any change would break a lot of maps. Mappers need to be careful to stay away from the slope tolerance thresholds, lest we end up with frustrating pathfinding on spotty or ambiguous ramps. These thresholds can cause trouble for highly realistic terrain, since walkability can be quite hard to parse. Ideally the map texture helps players understand the terrain, and avoid misleading them. Many maps navigate the pitfalls without issue, and they tend to use slope rockiness to delineate the slope thresholds.

Units moving downhill.png

One of my favourite things about our terrain is that it makes the whole map playable. Every minor bump is potentially relevant to how units behave, there are no purely aesthetic set pieces off in the distance, away from the game. For example, a craggy cliff has more surface area than a smooth cliff, so it takes longer for a spider to climb. If terrain looks different, it plays different. This lack of "pure asethetics" may be seen as limiting artistic freedom, but I see it as tying art and mechanics together in a way that benefits both. The precise cragginess of a cliff rarely matters, but when it does, it emphasizes the mapper's stylistic choices. It makes the map feel like a distinct landscape, rather than a mere picture of a landscape. The mountains in Zero-K are not just eye candy that units have to walk around; their shapes really matter when the artillery starts flying.

The result of all this is that two maps can have a similar resource layout, be fully walkable by bots, and play completely differently. Many 1v1 maps fit this description, with the differences coming from how hills slow movement and block weapons as well as line of sight. The natural battle lines and strong points created by hills and valleys give each map a distinct feel. We have even considered a mapping contest based on a single resource layout, and with the restriction that bots must be able to walk everywhere. Vehicles are rarely able to drive everywhere on maps, since their slope tolerance is so low, but this in itself is an important part of giving the factories different roles.

Buried defenders.png

Working through the implications of solid and nuanced terrain was a long process, with blocking weapon fire alone introducing many broken interactions. Not the fun type of "broken", such as putting Outlaws in holes, but uninteresting exploits such as making turrets effectively invulnerable from certain angles. It took a lot of attention to detail to sort out all the edge cases, and I have not heard of any for years, so perhaps we got them all. The process was greatly accelerated by terraforming, as a player with the ability to freely manipulate the map is nowhere near as benevolent as the original mapper. We get a lot more out of terrain manipulation, but that topic needs its own article.