Shroud, fog and the radar map
Keeps one shroud layer and one fog layer for the local player, and draws the radar map through the shroud.
Two covers hide terrain: the shroud, which every scenario starts with everywhere, and the fog of war, which only a skirmish or multiplayer lobby switches on. Both are held on the cells themselves, and both exist once.
Cell state
Section titled “Cell state”Each cell carries two independent pairs of states, one pair for the shroud and one for the fog. A cell is mapped when some part of it is out from under its cover, and clear when no piece of that cover is left over it at all. The partial piece drawn over a mapped cell is chosen from which of the eight neighbors are still unmapped, and a combination with no legal artwork is not allowed to occur: revealing one cell reveals any neighbor that would need such a piece, so one reveal can open several cells.
Every cell is built shrouded and fogged, and reading a scenario’s [Map] Size rebuilds them all in that state. That assignment declares the playfield: every cell the map has, with nothing outside it. Every map therefore begins fully dark. No setting opens a scenario revealed; a scenario that starts with the map uncovered does it with a trigger.
Which cell a coordinate is tested against
Section titled “Which cell a coordinate is tested against”Height is folded into every shroud and fog query. The coordinate’s height in levels is halved and subtracted from both cell axes, so the answer comes from the cell the coordinate is drawn over rather than the one it stands on, and at an odd height the cell to the south-east is consulted as well. The same walk — every second height level from one upward, stepping one cell diagonally each time — is how a reveal finds the objects standing on high ground drawn at one spot, and how a fogged cell finds the structures to photograph.
Revealing terrain
Section titled “Revealing terrain”Sight range
Section titled “Sight range”Sight= is a plain count of cells, not a lepton distance like a weapon’s Range=. A type that leaves it at zero takes no ordinary look at all; only the aircraft path below does anything with a zero sight range.
Two multipliers are applied in order. Height comes first: an object gains 10 per cent for each whole LeptonsPerSightIncrease leptons of elevation it carries. One height level is 104 leptons and the engine default is 50, so a whole level buys two increments — a unit one level up sees a fifth further, and one four levels up eighty per cent further. A rise in that bonus makes that same look a full scan rather than an incremental one. The SIGHT veteran ability then multiplies the widened figure through VeteranSight.
The scan
Section titled “The scan”The scan center is the cell the looker is drawn over, not the cell it occupies. A looker whose drawn cell lies outside the playfield reveals nothing at all. Candidates are then taken ring by ring out to the capped radius, and each one is kept only while it too lies inside the playfield and its straight-line distance from the center is within that radius, so the revealed area is a disc measured in cells. Both tests are against the playfield rather than the smaller playable area, so a look reaches cells in the map’s border.
With RevealByHeight=yes each surviving candidate is tested once more. The engine probes a single cell — the candidate’s ground cell, displaced two cells on both axes and then stepped once toward the center — and compares its ground height against the looker’s own: the reveal goes through only while the probed ground stands no more than three height levels above the looker. That comparison against a single probed cell is the whole of the rule: the ground between the looker and the candidate is never examined, and the three levels are fixed in the engine.
Who looks, and when
Section titled “Who looks, and when”An object looks only once it has been locked to the playable area — the smaller region LocalSize declares inside the playfield, which the engine clips and insets further. One that has never stood inside it reveals nothing, and the lock is re-evaluated for every object whenever that area changes. A house flagged as passive, such as the civilians, reveals only in a campaign.
- A vehicle or infantryman looks each time it reaches the center of a cell, incrementally unless its locomotor asked for a full look.
- An aircraft looks every fifteen frames while its house is allied to the local player, and ignores all of the above. It takes no lock test, no height bonus and no veteran multiplier; a landed aircraft sees exactly one cell whatever its type says. Only when its type sets
Sight=0and fog of war is running does it fall through toAircraftFogReveal, which lifts fog without touching the shroud and applies the height test only while the aircraft is below half the[General]FlightLevel, the rules-wide figure rather than the type’s own key of that name. - An object takes a fresh look when it is unlimboed, when a transport sets it down, when it finishes a teleport, surfaces from a tunnel or lands from a jumpjet flight, when it arrives by drop pod, when a structure is captured by a player-controlled house, and — for an object of the local player’s own house — when the player discovers it.
- Terrain objects and animations never look; only vehicles, infantry, aircraft and structures do.
Several further paths reveal ground outside that cadence.
An object that fires reveals a hard-coded two cells around itself, granted to the target’s owner rather than to its own house, while all of these hold:
- the target belongs to a player-controlled house;
- Any of:
- All of: the firing object is not the local player’s, and the player has not discovered it;
- All of: it stands on shrouded or fogged ground, and it is not an aircraft of the local player’s.
The first branch turns on the firer being an undiscovered stranger. The second turns on where it stands instead, and asks about ownership only to spare the local player’s aircraft, so it reaches the player’s own vehicles, infantry and structures as readily as anybody else’s.
An aircraft of the local player’s house that fires from or at shrouded ground reveals AttackingAircraftSightRange cells around itself. Forming an alliance with the local player makes every object of the new ally look at its own Sight=, while AllyReveal=yes holds. And a spy inside an enemy Radar=yes structure makes every object of the spied house look at once, then leaves that house marked as spied, so its objects’ own looks go on revealing ground for the local player for as long as that house keeps a spied radar structure. Destroying or capturing that structure recomputes the mark from scratch.
Reveals granted outright
Section titled “Reveals granted outright”- Reveal around waypoint… reveals
RevealTriggerRadiuscells around a waypoint, with the height test on. - Reveal zone of waypoint… walks the playable area and reveals two cells around every cell sharing the waypoint’s crusher movement zone.
- Reveal all map reveals every cell of the playfield and marks the player as seeing everything, after which the two actions above do nothing.
- Reveal map and the local player’s own defeat lift the shroud alone, leaving the fog where it is. Both are refused once the player already sees everything.
- The reveal and darkness crate results are owned by crates.
The fog of war
Section titled “The fog of war”Fog is a lobby option outside a campaign and a map setting inside one. A campaign clears the flag before the scenario file is read, after which the map’s FogOfWar=yes is the only thing that can set it again; a skirmish or network game takes it from the game options and ignores the map. Either way, when it is on the fog is raised over every cell at the end of scenario loading. While it is running the shroud is drawn with the fog artwork rather than its own, so both covers match.
A cell passing under the fog photographs what stands on it. A structure whose every footprint cell is fogged leaves a stand-in attached to each of those cells and keeps being drawn from it; a vehicle, infantryman or aircraft leaves nothing at all and is merely deselected, so mobile objects simply vanish. Lifting the fog throws the stand-ins away, unhooking a multi-cell one from every cell it was attached to first.
The two covers are not symmetric. A shroud reveal always lifts the fog from the same cell, but an unfog pass only touches cells that are already out of the shroud, so nothing that lifts fog can ever lift shroud.
A defeated player in a skirmish or network game is told that nothing is fogged, and the fog pass is not drawn for them at all.
Losing ground again
Section titled “Losing ground again”Shroud regrowth
Section titled “Shroud regrowth”While ShroudGrow=yes and ShroudRate is not zero, a pass runs every ShroudRate game minutes. It marks only the fringe — cells that are mapped but still carry a partial shroud piece — shrouds each mark, and then has everything still watching the map look again. A cell well inside a revealed area is clear rather than merely mapped, so it never qualifies; the only cells that do are the one-cell ring where the partial pieces are drawn. That is why the shroud creeps inward exactly one cell per pass and never reappears in the middle of a revealed area. The timer starts at zero, so the first eligible frame runs a pass immediately and the interval spaces only the passes after it. Creep shadow back in runs the same pass on demand, whatever the two settings say.
Fog regrowth
Section titled “Fog regrowth”While fog of war is running and FogRate is not zero, the matching pass runs every FogRate game minutes with the same first-frame behavior. It marks the fog fringe, then has every object look in a mode that clears the mark without revealing anything, and fogs whatever mark survives. That is how the pass asks which cells are still being watched.
Re-shrouding everything
Section titled “Re-shrouding everything”Reshroud map and its team mission clear both covers’ states on every cell, have everything still watching look again, and clear the mark that says the player sees everything — which is what lets the reveal actions work once more.
The radar map
Section titled “The radar map”What it draws
Section titled “What it draws”The background picture is built by asking every cell for its own terrain colors, taken in a fixed order: a terrain object’s radar color, then the bridge color for a cell lying under one, then a non-Tiberium overlay’s own radar color, then the color of Tiberium growing there, and otherwise the tile’s stored low and high colors scaled by theater and lifted toward a brighter shade by the cell’s height. Two entries are stored per cell, side by side, and the whole array is then scaled down into the pane.
Objects are drawn over that picture from a tracking table keyed on radar pixel. Each blip takes the owning house’s color, disguised infantry take the local player’s colors instead, and where several objects claim one pixel the first one found wins. An object in limbo is removed from that table and cannot be put back until it leaves limbo. A building whose pixel would fall outside the surface is not tracked at all; a mobile object in the same position is pulled back to the nearest edge pixel. Any damage that registers a result starts a flash timer of RadarCombatFlashTime frames on the damaged object, but only an object of the local player’s own house is repainted from it — every FlashFrameTime frames, and drawn inverted on alternate beats. Which other objects reach the table is decided by the radar-visibility test owned by cloaking and detection.
A white rectangle marks the part of the map the tactical view is showing, and a white frame surrounds the pane. Radar events are drawn over everything else; radar event covers the kinds and their timings.
What it refuses to draw
Section titled “What it refuses to draw”Fog is never asked about for terrain. Fogged ground keeps its true color on the radar even while the tactical view shows nothing there; only objects drop out under fog.
Three further conditions govern the pane rather than the terrain. Nothing at all is drawn in the map editor. While the pane is opening or closing only the frame animation is drawn, forty frames at four system ticks each, with RadarOn and RadarOff played as the change starts. And clicks on the pane are refused unless it is currently showing the tactical map. Whether the pane is raised at all is decided elsewhere: power output and drain covers the availability test, and ion storms the suppression that overrides it.
What the other houses know
Section titled “What the other houses know”Discovery is per object, not per cell. One flag records that the local player has seen the object; a single second flag records that some house other than the player’s has, shared by all of them and never cleared. Discovering an object of another house springs the Discovered by player event on its tag; discovering one of the player’s own makes it take a fresh look. The player’s flag is given up again in two places: an object of a computer house loses it whenever it goes into limbo, boarding a transport for instance, and any object unlimboed outside the playable area starts undiscovered. An object of a human house never gives it up that first way.
Campaign rules are stricter than the rest. Outside a campaign every object is revealed the moment it is placed on a cell and every structure the moment it is unlimboed. In a campaign a placed object waits for its cell to be free of both covers and a structure waits for its cell to be completely clear of shroud, every object is marked discovered as soon as its own coordinate is out from under the shroud, and a player-controlled house’s threat evaluation skips an object of another house it has not discovered — an aircraft excepted.
The shroud also gates orders. An order onto a shrouded cell is refused unless the type is MoveToShroud=yes and the cell lies inside the playable area, and when it is allowed the order is reduced to a plain move, a patrol waypoint order excepted. Clicking a subterranean unit onto a shrouded object does nothing at all unless AllowShroudedSubteranneanMoves=yes; an aircraft is refused that way regardless.
Parsed settings without effect
Section titled “Parsed settings without effect”BlendedFog selects between two fog rendering paths inside the routine that draws terrain tiles, but both calls into that routine pass the fog parameter guarding them as false, so neither path is reachable. CameraRange is stored and read by nothing.
Related settings
19 of 19
| Key | Description | Value | When omitted |
|---|---|---|---|
AircraftFogRevealglobal rules | Radius in cells that an airborne aircraft with no sight of its own clears of fog. | integer | 6 |
AllowShroudedSubteranneanMovesglobal rules | Whether a subterranean unit accepts a click on an object standing under the shroud. | boolean | no |
AllyRevealglobal rules | Whether an ally's objects reveal terrain for the local player. | boolean | yes |
AttackingAircraftSightRangeglobal rules | Radius in cells revealed when a player-controlled aircraft fires from or at shrouded ground. | integer | 5 |
FlashFrameTimeglobal rules | Frames between repaints of a flashing radar blip. | integer | 7 |
FogRateglobal rules | Game minutes between fog of war regrowth passes. | floating point | .05 |
LeptonsPerSightIncreaseglobal rules | Leptons of height that earn an object ten per cent more sight range. | integer | 50 |
LocalSizescenarios | The part of the playfield that is visible and playable, in cells. | rectangle (x,y,w,h) | the value of [Map] Size after clipping |
MoveToShroudAircraftType, BuildingType, InfantryType, UnitType | Whether the type accepts an order onto ground that is still under the shroud. | boolean | yes |
RadarCombatFlashTimeglobal rules | Frames a damaged object's radar blip keeps flashing for. | integer | 21 |
RadarOffglobal rules | Sound played as the radar pane begins closing. | sound | <none> |
RadarOnglobal rules | Sound played as the radar pane begins opening. | sound | <none> |
RevealByHeightglobal rules | Whether high ground between a looker and a cell blocks that cell from being revealed. | boolean | yes |
RevealTriggerRadiusglobal rules | Radius in cells that the reveal-around-waypoint trigger action uncovers. | integer | 5 |
ShroudGrowglobal rules | Whether the shroud creeps back over terrain that nothing is watching. | boolean | no |
ShroudRateglobal rules | Game minutes between shroud regrowth passes. | floating point | 4 |
SightAircraftType, BuildingType, InfantryType, UnitType | Radius in cells that the type reveals around itself for the local player. | integer | 0 |
Sizescenarios | Width and height of the whole playfield, in cells. | rectangle (x,y,w,h) | 1,1,50,50 |
VeteranSightglobal rules | Sight range of an object holding the sight ability is multiplied by this value plus one. | floating point | 1 |
No keys match the current filters.
History
- Changed0.1.0In development