Welcome back to Cold Takes for 2025. The goal this year is to post one every three weeks, but to not fight for space with patch notes.
Just about every real time strategy game has fog of war. Without it, you could watch the enemy base and start countering anything they do. This dynamic can work - there are whole genres built around perfect information - but it seems ill-suited for games with incremental real-time decisions that take time to pay off. But before delving into the role of vision, it is worth taking a look at how it works.
Fog of war can be dead simple. All you need to do is draw a circle around each unit and structure, then declare everything within a circle to be visible. Plenty of games stop there, but I suspect the majority take the extra step of considering terraces and trees. A terrace sight system has clearly defined levels of terrain, with units on lower levels unable to see onto higher ones, and games often block sight with opaque static features, such as trees and buildings. And such simplicity works great, up until the simulationists get involved.
Games of the TA lineage are more simulationist than your Starcrafts or Command and Conquers. That is, they care more about mechanics that match reality, or at least seem to match reality. Zero-K often downplays this aspect, but it is still a bit too simulationist to use a terrace-and-tree sight system. For one thing, we care too much about terrain to approximate the expressiveness of hills and mountains by a series of plateaus with ramps between them. This makes the simulationist route attractive, but it is hard to know where to stop without clear guidance from other design goals.
Before thinking about those goals, it is instructive to consider what fully realistic sight looks like. Such a system would involve drawing straight lines between the "eye" of each unit, and everything the unit might want to see. If the line has a clear unobstructed path, then the unit can see the target, and we can even draw lines to the edges of units to see them when they poke around corners. This is a general technique called ray tracing, and it reflects how light behaves in the real world. But would such a system work for Zero-K, what does the rest of the design have to say about it?
To cut the chase, we will appeal to fight your opponent, not the UI. In short, the interface is your friend, it should not get in the way, and it should tell you everything you need to know about your forces. This includes information about what your forces can or cannot see. An interface that fulfils this promise has to be clear and simple, which is a problem for realistic sight. The crux of the matter is that you need to know what you don't know.
Any old sight visualisation can tell you what you know you know. If you can see a giant robot peeking over a cliff, then the UI just has to draw the giant robot. But how do you rule out the existence of a sneaky medium-sized robot? The UI has to tell you whether you would be able to see one if it were present. The standard solution - spooky black fog - is a great representation of the unknown, but it breaks if you try to do too much with it. Fog is inherently fuzzy, so how is it going to tell you that you could spot a giant robot, but not a medium-sized one? Shifts in opacity are hard to make out to any degree of accuracy, and clearer cues such as contouring or colour coding would be quite busy. So Zero-K straight-up avoids having the visibility of a unit depend on its size.
Here is the trick to line of sight, used by many games: units never actually see each other, they only ever see parts of the terrain. The line of sight shader blurs this fact, but vision works on a grid, with the visibility of a square determined by ray traces to the middle of each square. The ray starts at the "eye" of each unit, so tall units are better at seeing over terrain, while the end hovers a fixed distance above the terrain (or the surface of the ocean). Units are visible if they are on visible terrain, which makes the potential visibility of enemy units very easy to tell the player.
Zero-K sight is still a bit janky compared to simple terrace-and-tree. Smooth terrain makes it difficult to precisely predict what one of your own units will be able to see when it reaches a given location, but this is significantly better than not even knowing what it can see once it arrives. To ameliorate this further we tune the heights of the hover ray trace targets to be fairly forgiving, although in theory they represent the height of an "average" unit.
So there you have it, sight detection in Zero-K is based on whether a unit of "average" height would be visible, because doing it this way allows for simple binary fog of war to tell the player everything they need to know. Except, this is only actually true for ground units. It is time to talk about the exceptions.
Projectiles, explosions, and non-landed aircraft ignore the usual sight rules, instead, using a circular sight system called air line of sight. This is a parallel sight system, but we make sure the air line of sight range of everything matches their standard line of sight range. The system is a nod to realism, since it lets you see planes without being able to see the terrain underneath. On the visuals side, it is nice to have projectiles not blip out of vision when they are fired over a ravine. Why not add air line of sight for particular giant robots? Consistency and clear thresholds; a plane is clearly a plane, but there is no clear cutoff between giant and non-giant robot.
Except, that is not quite true either, as giant robots can often be seen by air line of sight. In fact, anything that has fired a weapon in the last few seconds is visible to air line of sight. This is sensible, since muzzle flares are hard to hide, but it also solves a few edge cases. Without this mechanic you would be able to position turrets behind tall cliffs, making them very hard to target, but still able to shoot at approaching units. As a bonus, a giant robot that spots your base over the edge of a cliff is likely to start shooting at you, so it is almost as if it were visible to air line of sight to begin with.
Sometimes I wonder how many people know about air line of sight. It is one of those mechanics that smooths things over in the background, making the game look good and make sense. Being unaware of it seems fine, and there is a cost to making it more visible. I know from experience that varying the opacity of fog does not look great, because air line of sight used to be drawn as a lighter form of fog. The engine default for air line of sight is 150% of sight range, but we override it to match sight range so that we can avoid needing to draw it (see above). I picked a map with good contrast for these images, but in general it is hard to make half-opacity fog of war sufficiently visible on all maps.
Zero-K also has radar and sonar, but they are nothing new to someone who understands line of sight. Radar is just a form of sight, ray tracing to the same points hovering above the terrain, while sonar is a simple circular system. It turns out the engine developers did not want to implement a full acoustic wave propagation and detection system. That is it for sight. Why units would want to see each other will have to wait, but at least there is now a record of how.
Index of Cold Takes
[ 2025-01-25 23:53:39 CET ] [ Original post ]
Commander wanted! Construct giant robots, build an army of a thousand Fleas. Move mountains if needed. Bury the enemy at all cost!
- Traditional real time strategy with physically simulated units and projectiles.
- 100+ varied units with abilities including terrain manipulation, cloaking and jumpjets.
- 70+ mission galaxy-spanning campaign to be enjoyed solo or co-op with friends.
- Challenging, (non-cheating) skirmish AI and survival mode.
- Multiplayer 1v1 - 16v16, FFA, coop. ladders, replays, spectators and tournaments.
- PlanetWars - A multiplayer online campaign planned to start in May.
- Really free, no paid advantages, no unfair multiplayer.
Fully Utilized Physics
Simulated unit and projectile physics is used to a level rarely found in a strategy game.
- Use small nimble units to dodge slow moving projectiles.
- Hide behind hills that block weapon fire, line of sight and radar.
- Toss units across the map with gravity guns.
- Transport a battleship to a hilltop - for greater views and gun range.
Manipulate the Terrain
The terrain itself is an ever-changing part of the battlefield.
- Wreck the battlefield with craters that bog down enemy tanks.
- Dig canals to bring your navy inland for a submarine-in-a-desert strike.
- Build ramps, bridges, entire fortress if you wish.
- Burn your portrait into continental crust using the planetary energy chisel.
Singleplayer Campaign and Challenging AI
Enjoy many hours of single player and coop fun with our campaign, wide selection of non-cheating AIs and a survival mode against an alien horde.
- Explore the galaxy and discover technologies in our singleplayer campaign.
- Face a challenging AI that is neither brain-dead nor a clairvoyant cheater.
- Have some coop fun with friends, surviving waves of chicken-monsters.
- Cloaking? Resurrection? Tough choices customizing your commander.
Casual and Competitive Multiplayer
Zero-K was built for multiplayer from the start, this is where you can end up being hooked for a decade.
- Enjoying epic scale combat? Join our 16v16 team battles!
- Looking for a common goal? Fight AIs or waves of chicken-monsters.
- Prefer dancing on a razor's edge? Play 1v1 in ladder and tournaments.
- Comebacks, betrayals, emotions always running high in FFA.
- Want to fight for a bigger cause? Join PlanetWars, a competitive online campaign with web-game strategic elements, diplomacy and backstabbing (currently on hiatus pending an overhaul).
Power to the People
We are RTS players at heart, we work for nobody. We gave ourselves the tools we always wanted to have in a game.
- Do what you want. No limits to camera, queue or level of control.
- Paint a shape, any shape, and units will move to assume your formation.
- Construction priorities let your builders work more efficiently.
- Don't want to be tied down managing every unit movement? Order units to smartly kite, strafe or zig zag bullets.
Plenty of Stuff to Explore (and Explode)
Zero-K is a long term project and it shows, millions hours of proper multiplayer testing and dozens of people contributing ever expanding content.
- Learn to use all of our 100+ units and play on hundreds of maps.
- Invent the next mad team-tactics to shock enemies and make allies laugh.
- Combine cloaking, teleports, shields, jumpjets, EMP, napalm, gravity guns, black hole launchers, mind control and self-replication.
- Tiny flea swarm that clings to walls?
- Jumping "cans" with steam-spike?
- Buoys that hide under water to ambush ships?
- Mechs that spew fire and enjoy being tossed from air transports?
- Carrier with cute helicopters?
- Jumping Jugglenaut with dual wielding gravity guns?
- Meet them in Zero-K!
- OS: Ubuntu 13.04 or equivalent
- Processor: 2.0 GHz dual core CPU with SSE (Intel Core 2 Duo or equivalent)Memory: 4 GB RAM
- Memory: 4 GB RAM
- Graphics: 512 MB graphics card with OpenGL 3 support (GeForce 8800 or equivalent)
- Storage: 6 GB available spaceAdditional Notes: 64bit only. Big Picture mode is not supported
- OS: Ubuntu 17.10 or equivalent
- Processor: 3.0 GHz quad core CPU (Intel Core i5 or equivalent)Memory: 8 GB RAM
- Memory: 8 GB RAM
- Graphics: 2048 MB graphics card with OpenGL 3 support (high GT 500 series or equivalent)Network: Broadband Internet connection
- Storage: 8 GB available spaceAdditional Notes: 64bit only. Big Picture mode is not supported
[ 6133 ]
[ 1851 ]