#### Archived

This topic is now archived and is closed to further replies.

# Visibility systems in RTS

This topic is 5509 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''ve been thinking about how best to implement visibility systems in an RTS. It seems to me that there are a wide variety of options... Fog of war Unexplored terrain is blacked out, explored terrain which is not currently visible is greyed out. Limited vision This is the system used by 99% of RTS games. Each unit has a ''vision range'' which determines how far it can see. Enemy units can only be seen if they are within range of one you your units. Limited visibility Rather than each unit having a different ''vision range'', units have a different ''visibility range''. A tank has a larger visibility range than a soldier for example, and therefore it will be visible from a greater distance. Terrain might also have an effect on a units visibility range. Line of sight only Visibility is not limited by distance, but line of sight only. All visible All units on the map can be seen at all times. I''m curious to hear people''s thoughts on how these systems effect the gameplay in a real time strategy game. Also, are there any other systems that need to be included? Other features, e.g directionality? (with all the systems above, a unit is just as likely to spot someone standing behind him as he is likely to spot someone standing in front)

##### Share on other sites
I never liked the All Visible system. Its the one thing that I didn't like about C&C: Red Alert. Sneak attacks and manuevering was impossible, because you could see the enemy from across the map without needing to do any recon (although you did need to explore the map once).

In a fantasy game, I would like a combination of the first four. In a modern game, the middle three would be more appropriate due to the presence of satellites, spy planes, radar, etc.

Directionality of vision could be appropriate for an RTS on a smaller scale, where each individual soldier's stance, morale, etc. were all modeled in detail. If the strategy game was more focused on large armies, then focusing on each individual soldiers facing as anything more than aesthetics would probably not be necessary. You could assume that they are scanning the area all around them on their own.

-Mike

[edited by - doctorsixstring on January 20, 2003 10:15:02 AM]

##### Share on other sites
There''s also:

Player vision
For 3d games the likes of Shogun or Myth. The camera''s movement is restricted around a commander unit, limiting the player''s visibility. Interesting twists like seeing rising dust over a hill, but not the army that created that dust, or the active use of 3d shadows or other graphical effects are possible.

The scouts in Dark Reign that could morph in any game sprite around them also fit here, because they depend on how believable their cover is to the player.

Total Annihilation. Enough said.

The effect of a visibility system is very dependent on the other gameplay rules. What it all boils down to is how difficult it is to get information and how useful is the information. Both of these are determined to a large extent by the rest of the rules. For instance, extensive use of units with longer firing range than view range in TA makes constant scouting vital. Counter-units in AoE and very long range cannons or nuclear weapons in TA make even a peek of the enemy base very important. Anti-scouting defense measures such as walls in AoE or arrays of Missile Towers and fighter patrols or the Radar-AntiRadar game in TA become important.

I think there must be a balance between what is known and what isn''t known in a game. Knowledge isn''t solely defined by the game-state (what units are where), but also by the plans of the enemy. In a game like chess for instance, even if the game state is completely known, the enemy plans are hidden, and very hard to discover. In a RTS, there is a lot more knowledge in the game state, and that''s why limiting visibility becomes important. If you see a large army moving in the direction of your base, you more or less know what the enemy wants and what you must do as a response. Games like RISK or Panzer General where luck is very important can also live without a lot of visibility limits, because even with complete information of the game state the future of the game isn''t predictable.

##### Share on other sites
quote:
Original post by Diodor
In a RTS, there is a lot more knowledge in the game state, and that''s why limiting visibility becomes important. If you see a large army moving in the direction of your base, you more or less know what the enemy wants and what you must do as a response.

Why do you say there is more knowledge in the game state in RTS games? This sounds like a symptom of missing depth to me.

Imagine a game in which visibility is limited only by line of sight - distance is irrelevant. Units are able to hide in certain types of terrain however.

Player 1 parks his artillery on top of a big hill, so that it has a commanding view of the terrain.

Player 2 parks his artillery behind a hill, so it is harder to spot. Of course, they have a fairly crummy line of sight in this spot, so he uses hidden infantry units to spot for them.

It''s hard to say which is better, since a great deal of it depends on the exact layout of the map, the placing of hills and the concealing terrain etc, although I''d probably put my money on player 2. His artillery and scouts are all hidden, so player 1 will have to send his own scouts out, or else guess their location, in order to win. In the meantime, player 1''s artillery will be taking a pounding.

The purpose of this example is to show that a high visibility system (ie, a system which hides relatively little from the players) can add a level of subtlety and strategy which is lost with a low visibility system.

##### Share on other sites
quote:

Original post by Sandman

Why do you say there is more knowledge in the game state in RTS games? This sounds like a symptom of missing depth to me.

Lack of depth is exactly what I implied. I don''t think I need to prove the original comparisson between chess and a RTS. Limited visibility makes up for lack of depth. Your own example of an interesting choice is based on (lack of) visibility. In a game with complete visibility, both players would just fire their guns at each other.

That being said, I prefer games with high visibility. Risk, chess, go, Z are some examples.

Z?

##### Share on other sites
quote:
Original post by Diodor
Your own example of an interesting choice is based on (lack of) visibility. In a game with complete visibility, both players would just fire their guns at each other.

Well, yes and no. The example was of a high visibility game. Take the same example in a FULL visibility game and it becomes uninteresting: as you say, both players just shoot each other. Take the example in a very low visibility game (e.g the standard fog of war + limited vision) and it also becomes uninteresting - it''s just a case of wandering your scouts around blindly until they walk into the enemy base.

##### Share on other sites
In an RTS I''m working on (still thinking it out, but planning on eventually actually creating it) I''m planning on creating a hybrid of complete and limited vision. The minimap will show the location of every unit, but instead of showing where they are, it will show where they where X seconds ago. It will only show that something is there and not what unit(s) or exactly how many (aka if many units are positioned close together it will just be a larger dot than normal).
Since I think I''ll have something simmilar to the creeps of warcraft 3 (which are computer controlled units hostile to all players that can''t build structures or more units), it won''t be easy to know if a dot on the minimap is the enemy player, a creep, a bird flying around, an animal running through a forest, etc. I will probably have the dots dissapear one in a while to reappear Y seconds later, to make it impossible to track enemy units perfectly. Some units might even be able to ''hide'' to avoid being shown at all on the minimap.

Each unit will also have a vision cone (more like the field of vision in an FPS than the normal circle of vision, but it will start slightly behind a unit to simulate ''feeling a presence nearby''), and you can only see units/structures on the actual map if it falls inside a vision cone of a unit you control or an allied unit. Unit facing will actually matter, and it will be easy to change facing in-game. Anything visible in a vision cone will be shown in the current position on the minimap in a special color depending on its owner (in addition to being shown in its old location as a generic something)

##### Share on other sites
quote:

Original post by Iron Chef Carnage

Z?

Z Steel Soldiers is an old RTS (a DOS game) without any kind of fog of war. The terrain is divided in areas (4x4 areas on the large maps), capturing an area also captures all the factories in the area. As I''ve said, to have game you need a combination of certainty and uncertainty. If there is too much uncertainty, you have nothing to base decisions on. If there is too much certainty, there is no game anymore. Obviously, removing the fog of war removes a lot of uncertainty. Z managed to make up for this uncertainty loss in more ways. All the factories were pre-built, and more factories couldn''t be built, only captured (each area has a factory or two). Each factory could build units in a certain time frame. This time decreases with the number of areas the player controlls, so controlling more areas was extremely important. Capturing a factory one second before the production time is up means the unit is produced for the other player. The combat model which is fairly random adds a lot of uncertainty as well. All these possible twists keep the game in the "everything can happen" area.

Another great thing about Z is the way the end-game is handled. Many games lose uncertainty at some point, yet the game keeps on going on and on until the final victory is achieved. As an example, in Dune II the uncertainty ended soon after the game start (if you can survive the initial onslaught, you most likely win eventually). Actually achieving the win takes a lot of pain. In Z, at the point where the uncertainty is lost (typically after a larger fight), you have a player owning twice as many land areas and twice as many units as the other. The first player already produces four times as many units, and this difference increases a lot more in a very short time. The end-game in Z is almost a triumph march. Short and glorious as it should be.

So what has losing the fog of war done for Z? Instant reaction to enemy actions and a lot more planning ahead.

##### Share on other sites
Returning to categorising visibility systems. I think the micro-management involved is often the most important gameplay element in a visibility system (it directly determines how much is known). I hate when games force me to handle all the scouting by hand. It''s one of those annoying things that turn the RTS genre into action arcades. Here''s where Total Annihilation really shines. The share brilliance of guarding a combat unit with a scout plane to have the scout circle around the combat unit and follow it around the battle field. Or the patrol routes. Or the perfect radar/sonar system (with static radars as well as dynamic radar).

The cost of scouting units, their strength and speed are other significant factors that can make the difference between low and high visibility games.

##### Share on other sites
I remember having a conversation on this topic a while ago, probably involving Dauntless, Diodor and Sandman. Considering a modern timeframe, we came to the concensus that it wasn''t merely a question of the means and mechanics of information acquisition, but also of the propagation of said information. Say you, the gamer, are a general bunkered well away from the front lines (because your primary contribution is strategic rather than tactical). Scouts, satellites and reports are your ears and eyes on the battlefield, but the veracity of their reports is affected by the time interval between the data acquisition and its arrival at your desk. In other words, even though a satellite image may show a convoy of enemy supplies at a certain position at 0600h, you can only surmise an ever-widening radius for their current location based on the current time and their maximum speed.

I think this is one much underrepresented aspect of information warfare - the degradation of data over time. In medieval terms, if it takes a rider a whole day''s journey to get to you from the front lines of battle and he reports that the southern flank is weakening, do you immediately order reinforcements given that it will take the slower cavalry and footsoldiers perhaps two days to reach the front, that the front may have been lost or sudden courage, cunning or external factors may have swung the battle in your favor... A game that incorporates this level of strategic reasoning will really draw the gamer into the experience.

##### Share on other sites
Oluseyi, even though information is generally acquired immediately, there is a certain time delay before action can be taken based on that information. This delay can be produce the data degradation effect to some extent without further changes to gameplay. Taking a peak at the enemy commander unit in Total Annihilation and seeing it unprotected is an example. You must break off your scouting unit from the commander fast enough that the enemy doesn''t find out about your discovery and rushes his commander to safety, and make an attack based on (degrading) information.

It''s easy to imagine more complicated visibility systems.
- Scanners that can offer only partial information: in VGA Planets distant space-ships only offered a mass reading. Because the mass could be modified a lot by fuel and cargo identifying a ship type was quite difficult but it could be done. Likewise, one can make an educated guess on what unit types give the radar signals in Total Annihilation, based on their patterns and speed.
- Deceptions: fake units (used a lot in WWII).
- Silent runs: turning off the units search lights in Outpost (less viewing range but also less visibility); deep sea run orders for submarines (no contact with headquarters until the submarine surfaces again, but almost undetectable)
- Active vs Passive scanning. The sonar uses active scanning: it reveals the position of the scanning ship, but it can scan a lot better than passive scanners (microphones), and it can detect even stopped submarines.

The question is what kind of game rules can make the extra trouble with scouting worthwhile. What can be known in a game that can have a significant, non-immediate and non-local effect on the game? I believe the best answer to this questions is knowing an enemies thoughts and plans. Problem is, not many RTS''s have much planning ahead, or the plans are pretty obvious and unsophisticated. That''s why visibility systems, espionage, &c. cannot really evolve too much.

##### Share on other sites
Diodor:

Agreed, scouting is a very high maintenance task in most RTS games. It''s an uninteresting task, yet essential if you want to be any good at the game.

I don''t want to remove scouting altogether, but I''d like to make it more interesting. Certain terrain locations offering good lines of sight become tactically important - similarly valleys and forests which offer cover can also be valuable. Large units are harder to hide, and so tank swarms can be spotted from miles away, whereas a small group of infantry units could get very close without being spotted.

Oluseyi:

I can imagine a strategy game based on such a system could be incredibly interesting, even with only simple game rules. However, it does seem suited more a slow paced (or turn based) game modelling an entire war, rather than individual battles.

I''d also like to consider the implications of different visibility systems on technical and interface aspects.

For example:

Line of Sight Only: Implementing a true line of sight system with unlimited vision range is an algorithmic nightmare. Something like O(N2M2) - correct me if I''m wrong - where N is the number of units in the game, and M is the size of the terrain. And that is just to determine basic visibility for units. If you want to be able to show the player which areas are visible and which areas are not (ie by making the non-visible terrain darker) it gets worse.

Limited Visibility: For implementing this method, how do you display to the player which parts of the terrain are visible and which parts are not? Does he even need to know?

##### Share on other sites
quote:
Original post by Diodor
The question is what kind of game rules can make the extra trouble with scouting worthwhile. What can be known in a game that can have a significant, non-immediate and non-local effect on the game? I believe the best answer to this questions is knowing an enemies thoughts and plans

Good question. It has occurred to me that in a game where the weapons are very deadly, playing the hide and seek game is more important - the best way to avoid getting your units killed is to not let your opponent see them. Conversely, once you''ve spotted your opponent''s forces, they''re as good as dead.

##### Share on other sites
quote:

Original post by Sandman

Agreed, scouting is a very high maintenance task in most RTS games. It''s an uninteresting task, yet essential if you want to be any good at the game.

I don''t want to remove scouting altogether, but I''d like to make it more interesting. Certain terrain locations offering good lines of sight become tactically important - similarly valleys and forests which offer cover can also be valuable. Large units are harder to hide, and so tank swarms can be spotted from miles away, whereas a small group of infantry units could get very close without being spotted.

I wouldn''t want scouting removed, just automated and cheapened. I''m thinking of group orders like "search area", "return to base", "resume search", with all the details the likes of tailing an enemy without engaging handled by AI (if I have the choice of search strategy so much the better).

quote:

Line of Sight Only: Implementing a true line of sight system with unlimited vision range is an algorithmic nightmare. Something like O(N2M2) - correct me if I''m wrong - where N is the number of units in the game, and M is the size of the terrain. And that is just to determine basic visibility for units. If you want to be able to show the player which areas are visible and which areas are not (ie by making the non-visible terrain darker) it gets worse.

Well, you could probably cheat your way to building such a system. Let''s take a tile based game with maps as large as 128x128 (largest maps in Warcraft 2 I think) You can precalculate the visibility for each game tile. There are 16K tiles. You can store the bit map for the visibility of a single tile as 16K bits, that is 2K bytes. The total precalculated data is 2K * 16K = 32 MB. To calculate the visibility of enemy units, you have O(N*N) complexity (for each enemy unit check whether it''s tile is visible in the tile visibility map of each of your units). To calculate the entire map visibility, you have O(N*M*M) complexity (simply OR all the tile visibility maps of the units of one player).

Improvements such as RLE compressing of the visibility maps can improve the speed and memory requirements by at least a factor of 10 (this depends on how irregular the terrain is).

quote:

Good question. It has occurred to me that in a game where the weapons are very deadly, playing the hide and seek game is more important - the best way to avoid getting your units killed is to not let your opponent see them. Conversely, once you''ve spotted your opponent''s forces, they''re as good as dead.

This is what happens a lot in the end-game of Total Annihilation games. Massive air attacks against enemy counter-nuclear defenses, followed by a nuclear attack. Knowledge of the location of super-structures (nuclear or fusion energy plants, nuclear and counter-nuclear missiles, long range cannons) is very important.

##### Share on other sites
quote:
Original post by Diodor
To calculate the visibility of enemy units, you have O(N*N) complexity (for each enemy unit check whether it''s tile is visible in the tile visibility map of each of your units). To calculate the entire map visibility, you have O(N*M*M) complexity (simply OR all the tile visibility maps of the units of one player).

32mb seems rather large for a map file, and that is excluding the actual map geometry and textures.

In all other respects, I like this approach - if you do the map visibility first, you reduce the unit visibility to O(N), and you also get a free texture map to do the actual shading of the hidden terrain.

I''ll have to see if I can think of any neat ways of reducing the data requirements.

##### Share on other sites
As I said, I imagine using Run Length Encoding can reduce that figure by a lot. Close to zero if the terrain is made of large features and the visibilty zone of a single tile is more or less regulated.

##### Share on other sites
I think what's most important about a visibility system is how the information gets passed from the observing units to the actual player. In other words, the unit has to be able to see what's out there, but just as importantly, the unit must relay that information back to the player.

I think therefore there are two elements, sensory and communication. The sensory aspect I think should have two main parts...a sensory rating score for the observing unit, and a "silhouette" rating for units in terms of different spectrums of "observability" (for example, a physical silhouette is measured against the human eye, but a thermal silhouette is measured against IR sensors...etc.).

Let's say I send a scout company in advance of my main column in a n extended skirmish formation. Let's say this armored Cav Scout company is composed of both light recon vehicles and dismounted infantry units with some specialized sensor gear. What they will be able to see is dependant on on what is out there, the range to the target, and the sensor characteristics of the observing units. Actually, vehicles have a harder time spotting units unless they aren't buttoned up, in which case their height has a certain advantage. However, vehicles have a severe field of vision restriction which is partially mitigated by the turret (the driver can see where he's going, but he's at the same eye level as an infantryman) unless they are unbuttoned again. Now, let's say that about 200meters off in some light woods, there are some main battle tanks and some supporting infantry. The tanks should be spotted before the infantry are. Also, the scout infantry should be able to detect both units before the Scout Vehicles can.

So in a nutshell:
1) Field of awareness is important (this is where infantry and air units shine)
2) Observing units should have some sort of sensory score that affect how far they can sense, and how well they they do it
3) Target units should have some sort of signature score that affect how easy it is for a unit to spot it (the range threshold)

**Field of awareness should be something that is affected by unit formation and the orders of the unit. A unit in skirmish formation is essentially scouting the area, and also a unit that is order to move cautiously or do a "bounding overwatch" (where units advance one after the other by leapfrogging each other and maintaining their field of vision on one particular area per unit) will greatly affect their field of awareness

Now, how do you cover the terrain? I believe that if it's truly unknown territory, then the map should be blacked out. However, that's rarely the case, and in most WWII era or beyond games, there should at least be some aerial recon photos taken before hand, so I think terrain should be revealed.

[edited by - dauntless on January 23, 2003 5:18:58 AM]

##### Share on other sites
As it is, scouting is pretty much useless. Sure, you need to find the enemy base, and explore the map, but after that?

It doesn''t exactly change your plans if your scouts report a large force heading towards you. All of your forces are generally stationed in the base anyway, unless they''re attacking the enemy, (In which case he probably won''t have time to attack you). Either that, or you rely on your static defenses to take out the enemy. So you don''t really need to know in advance if you''re being attacked.

If you attack, you basically just need to know where the enemy base is, and *maybe* send a quick scout to just check out approx. how strong the defenses are. You don''t need to know the actual position of units, or the precise type, because it simply doesn''t matter... Your army is on its way there, and if you see something, you shoot it.

In current games there''s really no reason for scouting, as no advanced tactics are possible. You can''t sneak around ambushing people, terrain doesnt really matter, units speed is just a matter of convenience, but doesnt affect the outcome of a fight.

##### Share on other sites
Spoonster-
Scouting is useless only because games today don''t really accomodate it. You''re right that scouting is nice to find the base, though I think it is good to try to and know your enemy''s forces composition. The problem is that while you are manipulating your scouts to their best advantage, you are neglecting a lot of other things, and the enemy just comes along and pounds you into dust.

Command, Control, and Communication are the cornerstones of every military commanders thinking (mention C3 or C-cubed to a military officer, and I''ll almost guarantee you he''ll know what you mean.....and if he thinks it''s the older version of plastique, ummmm, make sure he''s really an officer ). And yet where do any of these three really fit in today''s RTS games? Command? I just have a bunch of hodge podge units with no need to organize large groups of units. Control? Why whould I have a semblance of combined arms warfare or integration of tactics? I click on something and give it the "special function" or tell it to do something blindingly obvious to do. Communication? What do you mean communicate....I should automatically know everything my units know, and when I tell them to do something, they do it. Besides, I just need to know one thing...."where they are" (apologies to Aliens fans )

See how totally unrealistic that is? And yet, that''s what games are. Some say, "realism is overrated as long as it is fun". While this is true to a degree....why are all RTS games couched in war terms? The simple fact is, war is fun as long as we don''t see its real horrors (Robert E. Lee said, "It is a good thing war is so terrible, otherwise we should grow too fond of it"). Players like the idea that they are controlling huge amounts of troops and they like the mental challenge of factoring all the elements of warfare to achieve victory. I think there are so many elements missing from strategy games that I no longer enjoy playing RTS games. In fact, I prefer playing old miniatures games to computer games, because to me there is much more cerebral thought to these old-school turn based games than RTS games have now.

##### Share on other sites
That''s what I meant. There''s basically no room for scouting in current RTS games... I know your C3 is pretty important in real warfare, but it really isn''t implemented in current games. And just changing the visibility systems aren''t going to fix this by itself... You need some pretty dramatic changes.

##### Share on other sites
people, people...
there was a game which was not perfect but for me it had the battle as it should be - The Close Combat Series: you have no limits to see anything, you can shoot everything whereever you see it, scounting is absolutely vital

of course this game could have been better but I liked the realistic combat which I think is the best combat model from all. well the game itself was repetaive too predictable etc. but it shows that one could feel as he is at war

##### Share on other sites
quote:
Original post by Spoonster
That''s what I meant. There''s basically no room for scouting in current RTS games... I know your C3 is pretty important in real warfare, but it really isn''t implemented in current games. And just changing the visibility systems aren''t going to fix this by itself... You need some pretty dramatic changes.

I like WarCraft 3 in this respect - it did the paper-rock-scissors thing well enough that scouting is ESSENTIAL! It''s possible to play many different strategies (once you are good enough anyways - n00b strats are fairly limited, but you dont have to be a lifer to play enough to get options), and (almost) every strategy has a complete counter. In addition, its possible to change your strategy if you find out what the enemy is doing (tho it gets hard the later you find out). It''s not perfect yet because balance is still lacking somewhat, but with the expansion that should change and it will hopefully become even better.

500 x 6