Skip to content

Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.

fix(gameclient): play no fx on enemy stealth the viewer has not found

Olcay Seyganaaeffa62bc45
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e8468ca7..fc55f6ba6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1590,7 +1590,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same
- A base out of power looks out of power. A building that switches off when your power runs short, or one a hacker shut down, drains to a cold grey and sags darker, and its windows and lamps go out. Every few seconds it blinks dark for an instant or its lights catch again for a moment, and blue sparks jump on its walls where something shorts. A tank or building hit by an EMP crawls with thin blue arcs for as long as it stays dead, where it used to just turn dark grey.
- Your own stealthed units look like glass, not like ice. In 3.0 a camouflaged Rebel, a Pathfinder or Colonel Burton came out under a blue skin with bands running up it, which players rightly called ugly. The blue is gone: the ground behind him shows through his body in its own colours and bends, a slow lens that ripples along him and pulls harder at his outline, with a muted share of his own paint left in it. The bend is what you find him by: each face of him tips the ground behind it its own way, so his shape shows even on plain sand, and the bend never drops below a few pixels, and a cool haze that thickens at his outline makes a cloaked squad or a camouflaged base read at a glance at the zoom you play at, still as glass and without turning white. Up close a building's flat wall bends across its face. It moves slowly and never fizzes. He breathes solid at the top of the 2003 pulse and back to glass at the bottom. Going invisible, the paint eases into that lens, then the pulse takes over. Coming out, the bend eases off until the paint is whole. An enemy a detector finds fades into heat the same way. His shadow fades with him, to between a quarter and a half of its strength as he breathes, where it used to lie on the ground at full strength and give him away before his body did; on Classic and the old renderer the shadow stays whole. When an enemy detector has found him, his whole body beats amber along with his edge, so a spotted building reads as spotted and does not just turn tan. On every renderer, a stealthed unit of yours no longer comes out solid whenever no building is on the screen: the game drew it a second time without its see-through. An enemy stealth unit your detector finds used to turn into a flat orange shape with no paint; now it shows as heat, its own shading run from dark red through orange to a warm yellow that stops short of white, so you can still tell a tank from a soldier and bright GLA paint keeps its detail, with a burning outline and a slow glow climbing it that flares on every sweep of the detector. The fine scan lines of 3.0 are gone, since zoomed out they broke into stripes. This is the default renderer; Classic and the old renderer keep the 2003 look for all of these.
- The first outage, EMP, cloak or detection of a match no longer catches the picture. Each of those looks is a small drawing program of its own on every model it dresses, and until now the game built each one the first time it came on screen, 25 to 60ms of a single frame, so a whole base browning out at once could stack several into one. They come with the game now: a match, both look scenes and the main menu that compiled 61 programs while playing compile none.
-- A hidden base no longer burns in plain view. The fire and smoke on a stealthed building or unit, damage flames and chimney smoke alike, kept drawing for the enemy while the building itself was invisible, so a burning Stealth General base under Camo Netting stood out as a column of black smoke on an empty patch of ground. The enemy now sees none of it until a detector finds the building, and then all of it. On your own side the flames and smoke go faint with the building and breathe with it, the fire a little stronger than the smoke, so they no longer sit at full strength beside the glass. This holds on every renderer, and the smoke's shadow and the light its fire throws on nearby smoke go with it.
+- A hidden base no longer burns in plain view. The fire and smoke on a stealthed building or unit, damage flames and chimney smoke alike, kept drawing for the enemy while the building itself was invisible, so a burning Stealth General base under Camo Netting stood out as a column of black smoke on an empty patch of ground. The enemy now sees none of it until a detector finds the building, and then all of it. On your own side the flames and smoke go faint with the building and breathe with it, the fire a little stronger than the smoke, so they no longer sit at full strength beside the glass. This holds on every renderer, and the smoke's shadow and the light its fire throws on nearby smoke go with it. A hit on a hidden unit gives it away no more either: a laser landing on a parked Listening Outpost you had not found threw sparks, a lens flare and a flash of yellow light on the ground round what looked like an empty spot. Now nothing shows until you find it.
- Effects fade out instead of blinking off. The rings a nuke sends across the ground, and any spark, flash or puff whose own colours never reached nothing, used to vanish at full strength on their last frame. Each one now dims away over its last quarter of a second, or over a quarter of its life when it lives shorter than that. One that was already fading looks the way it always did.
- Toxin, anthrax and radiation pools lie on the ground. A pool is a carpet of puddle pictures spread up to 140 paces from where the shell or the spray came down, and every one of them was drawn dead flat at the height of that one spot: on a hillside the uphill half of the pool disappeared into the slope and the downhill half hung in the air above it. Each puddle now bends over the ground underneath it, on both renderers, and a pool on a bridge stays on the deck. The pool also holds still. It used to throb twice a second, because every half second the pool's poison fired a fresh batch of puddles that swelled out of black to full green and back to black in two seconds, each batch somewhere new. Now it comes up in half a second, stays one pool at full colour for as long as it does damage, and fades over its last three seconds, or over three seconds from the moment the fog of war closes over it. It is not frozen, though: each puddle fades down and back up on its own beat, so the surface shimmers like something liquid while the pool as a whole never pulses. Four Scud warheads landing on one spot used to stack into a white-hot blotch in the middle; overlapping pools now share their light and the middle stays toxin green. The ground under it takes on its colour, green for toxin and the anthrax colours for anthrax, so it looks spilled rather than shone onto the grass. China's radiation keeps its orange but glows instead of browning the grass, which made it look like a scorch mark, and small bubbles swell out of it and pop. A nuke's radiation lies on the hillside as a pool from three seconds after the blast, where its first ten seconds used to be flat squares cutting into the slope.
- A Scud Storm or a carpet bomb shakes the screen as hard as it should. The game cut a pile of heavy shakes back to a mild one, so a run of missiles or bombs landing together shook less than one of them alone. Each now shakes a step lighter and the run builds up. Demo traps and Aurora bombs shake now, and a falling building shakes harder the bigger it was.
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp
index 8ace68083..0e60f8401 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/FXList.cpp
@@ -969,8 +969,16 @@ void FXList::doFXObjNow(const FXObjectView* primary, const FXObjectView* seconda
for (size_t i = 0; i < ARRAY_SIZE(footprint) && hidden; ++i)
hidden = ThePartitionManager->getShroudStatusForPlayer(shroudPlayer, &footprint[i]) != CELLSHROUD_CLEAR;
}
+ // An enemy's stealth this screen has not found plays nothing either, or the sparks, flare and
+ // light pulse of a hit mark the empty spot. Its drawable's look is the screen's answer, the
+ // one its attached fire and smoke follow. A dying one plays, as StealthUpdate shows it.
+ if (!hidden && primaryObject && !primaryObject->isEffectivelyDead())
+ {
+ const Drawable *draw = primaryObject->getDrawable();
+ hidden = draw && draw->getStealthLook() == STEALTHLOOK_INVISIBLE;
+ }
if (hidden)
- return; //the primary object is fogged or shrouded so don't bother with the effect.
+ return; //the primary object is fogged, shrouded or unseen stealth so don't bother with the effect.
}
for (FXNuggetList::const_iterator it = m_nuggets.begin(); it != m_nuggets.end(); ++it)