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.

feat(gameclient): aura rings under every seen leader, friend or foe

Olcay Seygan63db59254bc9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 751b52b64..a444762db 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,7 +13,7 @@ found and fixed, EA's own, not port damage.**
- America, China and GLA units now get what their rank ladder on the website promises. Rank has always raised a unit's stats; now certain grades also add a perk of their own, and the officers and leaders further up the ladder carry an aura that helps friendly units around them.
- Perks work on the unit itself: a GLA Fighter starts mending itself at 0.5% of its health a second, a Hardened Raider carries 8% more health, an American Private First Class the same. Aura kinds are rate of fire, damage taken, mending, sight, speed, experience, detection, resistance to EMP and paralysis, capture time and a share of kill value. They never touch the leader, and auras of one kind do not add up: a unit near three leaders takes the strongest of each kind.
- An American Second Lieutenant (grade 18) gives every friendly unit within 140 of it +12% rate of fire; a Captain two grades later heals them 1% of their health a second. A GLA Field Commander (grade 13) heals 1% a second at a radius of 140, and a Warlord (grade 15) speeds up every unit near it by 12%.
-- Select or hover a ranked leader and each aura it gives draws its own ring on the ground, out at that aura's radius, so you can see which units each one covers. The rings borrow Turkiye's five patterns and tell the kinds apart by tint where two share a pattern. Detection draws none. Only you and your allies see them.
+- Every aura a ranked leader gives draws its own ring on the ground, out at that aura's radius, so you can see which units each one covers. The rings are always there, nothing to select, under your leaders and the enemy's alike, and an enemy leader hidden in the fog, or stealthed and not detected, shows no ring. The rings borrow Turkiye's five patterns and tell the kinds apart by tint where two share a pattern. Detection draws none.
- The full tables, grade by grade, are on the Rank ladder page of the website.
## French
diff --git a/GeneralsMD/Code/Data/INI/BalanceReforged.ini b/GeneralsMD/Code/Data/INI/BalanceReforged.ini
index ab6a84a28..fd994d23c 100644
--- a/GeneralsMD/Code/Data/INI/BalanceReforged.ini
+++ b/GeneralsMD/Code/Data/INI/BalanceReforged.ini
@@ -1932,8 +1932,8 @@ End
; kind; kinds multiply. A leader's aura never reaches the leader, and buildings take none unless the
; line says STRUCTURES. Turkiye's AuraRadius is 150, the reach of a tank gun: a Maresal's 300 covers
; a company. The other three sides give each aura line its own radius, the wiki's. Each kind with an
-; AuraRing_<kind> draws a ring on the ground under a selected or hovered leader for its owner and
-; allies (client only).
+; AuraRing_<kind> draws a ring on the ground under every leader the player can see, selected or
+; not, friend or enemy (client only).
Veterancy
; America China GLA Turkiye
diff --git a/GeneralsMD/Code/Data/Scenarios/rankringsall.txt b/GeneralsMD/Code/Data/Scenarios/rankringsall.txt
index b856a3a36..584dae4e7 100644
--- a/GeneralsMD/Code/Data/Scenarios/rankringsall.txt
+++ b/GeneralsMD/Code/Data/Scenarios/rankringsall.txt
@@ -6,8 +6,8 @@
# fire, mend, capture and pace; a Supreme Liberator Scorpion (grade 20) pace, spoils, mend, capture,
# rate of fire and steady. Detect has no ring. Each leader brings three infantry walking west and a
# vehicle driving through the ring. Select each leader with a -control click at the screen centre
-# once Cinema/rankringsall.txt has cut to it (logic frames 380, 1220, 2060); the rings draw only for
-# the owner and allies, so no -observer.
+# once Cinema/rankringsall.txt has cut to it (logic frames 380, 1220, 2060). Since 2026-10-26 the
+# rings draw for every leader the local player can see, so the click is no longer needed.
#
# generals.exe -win -borderless -xres 1920 -yres 1080 -msaa 0 -quickstart -noshellmap
# -multiInstance -fps 120 -noFPSLimit -particlecap 2500 -map "Maps\Twilight Flame\Twilight Flame.map"
diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
index df4d64616..0ab076c5f 100644
--- a/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
+++ b/GeneralsMD/Code/GameEngine/Include/Common/GlobalData.h
@@ -723,7 +723,7 @@ public:
Real m_rankDrillRate; ///< what a drill aura adds a second, a share of the unit's E
AsciiString m_rankSalvageCrate; ///< the crate a SALVAGE_CRATE perk leaves
UnsignedInt m_rankRallyTime; ///< frames a death rally lasts
- RadiusDecalTemplate m_rankAuraRing[RANK_AURA_COUNT]; ///< the ground ring under a selected leader, one per aura kind (client)
+ RadiusDecalTemplate m_rankAuraRing[RANK_AURA_COUNT]; ///< the ground ring under every visible leader, one per aura kind (client)
static VeterancySide veterancySideOf( const ThingTemplate *thing );
const RankLadder *getRankLadder( const ThingTemplate *thing ) const; ///< NULL: the thing's side keeps EA's levels
diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
index cbf7e70e6..b98b824bf 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/InGameUI.h
@@ -1265,7 +1265,7 @@ protected:
void destroyPlacementIcons( void ); ///< Destroy placement icons
void handleBuildPlacements( void ); ///< handle updating of placement icons based on mouse pos
void handleRadiusCursor(); ///< handle updating of "radius cursors" that follow the mouse pos
- void updateAuraRings(); ///< the ground ring of each aura a selected or hovered leader gives
+ void updateAuraRings(); ///< the ground ring of each aura every visible leader gives
void incrementSelectCount( void ) { ++m_selectCount; } ///< Increase by one the running total of "selected" drawables
void decrementSelectCount( void ) { --m_selectCount; } ///< Decrease by one the running total of "selected" drawables
@@ -1554,7 +1554,7 @@ protected:
RadiusDecal m_curRadiusCursor;
RadiusCursorType m_curRcType;
- enum { AURA_RING_MAX = 32 };
+ enum { AURA_RING_MAX = 256 }; // ponytail: past this many rings on the map the rest go undrawn; the slot match is n squared
struct AuraRing
{
ObjectID id; ///< INVALID_ID: a free slot
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 6ac9e2c6b..911a80cc6 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -1504,10 +1504,12 @@ void InGameUI::setRadiusCursor(RadiusCursorType cursorType, const SpecialPowerTe
}
//-------------------------------------------------------------------------------------------------
-/** A leader's auras on the ground: one ring for each kind it gives, under a selected or hovered
- * leader of the player at this machine or an ally, while that player can see it. Every ring is the
- * full aura radius; each kind's texture keeps to its own band of that disc (Tools/aura_rings.py),
- * so any set of them reads as one dial. Reads the logic's grades and draws; nothing goes back. */
+/** A leader's auras on the ground: one ring for each kind it gives, under every leader on the map,
+ * selected or not, friend or enemy, while the player at this machine can see it: out of the fog and
+ * shroud, and not a stealthed unit it has not detected (the test the drawable's own shadow obeys).
+ * Every ring is the full aura radius; each kind's texture keeps to its own band of that disc
+ * (Tools/aura_rings.py), so any set of them reads as one dial. Reads the logic's grades and draws;
+ * nothing goes back. */
//-------------------------------------------------------------------------------------------------
void InGameUI::updateAuraRings()
{
@@ -1516,34 +1518,26 @@ void InGameUI::updateAuraRings()
Int wantedCount = 0;
Player *local = ThePlayerList->getLocalPlayer();
- auto consider = [&]( const Drawable *draw )
+ for( Drawable *draw = TheGameClient->firstDrawable(); draw != NULL && local != NULL; draw = draw->getNextDrawable() )
{
- const Object *obj = draw ? draw->getObject() : NULL;
+ const Object *obj = draw->getObject();
const RankLadder *ladder = obj ? TheGlobalData->getRankLadder( obj->getTemplate() ) : NULL;
- if( ladder == NULL || local == NULL || obj->isEffectivelyDead() || obj->getContainedBy()
- || ( obj->getControllingPlayer() != local && local->getRelationship( obj->getTeam() ) != ALLIES )
+ if( ladder == NULL || obj->isEffectivelyDead() || obj->getContainedBy()
+ || draw->isDrawableEffectivelyHidden() || draw->getFullyObscuredByShroud()
|| obj->getShroudedStatus( local->getPlayerIndex() ) != OBJECTSHROUD_CLEAR )
- return;
+ continue;
const Int grade = obj->getRankGrade();
for( Int kind = 0; kind < RANK_AURA_COUNT && wantedCount < AURA_RING_MAX; ++kind )
{
if( ladder->aura( grade, (RankAura)kind ) <= 0.0f || !TheGlobalData->m_rankAuraRing[ kind ].valid() )
continue;
- Bool twice = FALSE; // the hovered leader may be selected too
- for( Int i = 0; i < wantedCount; ++i )
- twice = twice || ( wanted[ i ].id == obj->getID() && wanted[ i ].kind == kind );
- if( twice )
- continue;
wanted[ wantedCount ].id = obj->getID();
wanted[ wantedCount ].kind = kind;
wanted[ wantedCount ].radius = ladder->auraRadius( grade, (RankAura)kind );
wanted[ wantedCount ].pos = *draw->getPosition();
++wantedCount;
}
- };
- consider( TheGameClient->findDrawableByID( getMousedOverDrawableID() ) );
- for( DrawableList::const_iterator it = m_selectedDrawables.begin(); it != m_selectedDrawables.end(); ++it )
- consider( *it );
+ }
// a ring nobody wants goes; one whose radius changed goes too and comes back at the new size
for( Int slot = 0; slot < AURA_RING_MAX; ++slot )