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.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
feat(data): aura rings as one quiet dial, a band and pattern per kind
Olcay Seyganb7156ba1d5d5
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 5540c4fcd..bc47333a1 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -145,7 +145,7 @@ found and fixed — EA's own, not port damage.**- Turkish units move at their own speeds. The engineer, the spotter team and the Kirpi are slow, and the Korkut keeps up with the tanks.- A Turkish computer player fires its powers, the Minefield included, as soon as they are ready, and pulls its spotter teams back out of the enemy's reach while keeping the enemy in sight.- Turkish units climb the Turkish Land Forces' own ladder: 21 promotions from Er through Onbaşı, Çavuş, Uzman Çavuş and six astsubay grades to Teğmen, Yüzbaşı, Albay, the four generals and Mareşal at the top. The names read in Turkish in every language, and each grade wears its own insignia: chevrons for the enlisted men, gold bars for the astsubays, stars for the officers, the oak wreath under a field officer's stars and the crescent and star over a general's. The climb costs what it costs everyone else, a unit turns Veteran at Uzman Çavuş, Elite at Teğmen and Heroic at Albay. Its bonuses lean on health: at Mareşal a unit has 42% more of it, fires 25% faster, hits 19% harder and reaches 12% further. The Maroon Beret starts as an Albay, as Burton starts as a Colonel. Before this a Turkish unit wore EA's three chevrons.-- Turkish ranks carry more than numbers. A Çavuş sees 10% further, an Uzman Çavuş takes 10% less damage standing still, and from the sixth grade a unit patches itself up out of a fight at 1% a second. Sight grows to 20% and 30% further at the astsubay and general ranks. A Teğmen spots for the Firtina and the Sakarya the way the spotter team does, a Binbaşı's own guns spread 15% less, and a Tümgeneral finds stealthed enemies within 100 of it. Officers lead: the Astsubay Kıdemli Başçavuş makes every friendly unit within 150 fire 5% faster and the Albay 10%, the Yüzbaşı lets them see 10% further, the Korgeneral cuts the damage they take by 10% and the Orgeneral puts 5% on the artillery's range. A Tuğgeneral who falls leaves the men around him taking 15% less damage for ten seconds, and a Mareşal's leadership reaches 300. Two officers of the same kind never add up: a tank between an Albay and a Başçavuş fires 10% faster, the Albay's figure alone. Select or hover a leader and each thing it gives the men around it shows as its own slowly turning ring on the ground, orange for fire, blue for sight, green for armour, purple for the guns' reach and white for the last stand; the portrait's tooltip lists what the rank carries. Only you and your allies see the rings. Making those colours work fixed a mistake in how the game tints glowing ground marks, which had drawn every one of them in pure blue. The grid a spy satellite or a radar scan lays over what it reveals is now the dim grey-blue EA's data asks for, and about half as bright as before.+- Turkish ranks carry more than numbers. A Çavuş sees 10% further, an Uzman Çavuş takes 10% less damage standing still, and from the sixth grade a unit patches itself up out of a fight at 1% a second. Sight grows to 20% and 30% further at the astsubay and general ranks. A Teğmen spots for the Firtina and the Sakarya the way the spotter team does, a Binbaşı's own guns spread 15% less, and a Tümgeneral finds stealthed enemies within 100 of it. Officers lead: the Astsubay Kıdemli Başçavuş makes every friendly unit within 150 fire 5% faster and the Albay 10%, the Yüzbaşı lets them see 10% further, the Korgeneral cuts the damage they take by 10% and the Orgeneral puts 5% on the artillery's range. A Tuğgeneral who falls leaves the men around him taking 15% less damage for ten seconds, and a Mareşal's leadership reaches 300. Two officers of the same kind never add up: a tank between an Albay and a Başçavuş fires 10% faster, the Albay's figure alone. Select or hover a leader and what it gives the men around it shows on the ground as one quiet dial at the edge of its reach, each gift in its own band and its own pattern: short ticks round the rim for fire, a dotted line for sight, a notched line for armour, a graduated scale for the guns' reach and a faint wash inside for the last stand, so an Albay draws two bands and a Mareşal the whole dial; the portrait's tooltip lists what the rank carries. Only you and your allies see the rings. Making those colours work fixed a mistake in how the game tints glowing ground marks, which had drawn every one of them in pure blue. The grid a spy satellite or a radar scan lays over what it reveals is now the dim grey-blue EA's data asks for, and about half as bright as before.- The units still borrow American and other sides' models, voices and cameos.- The computer plays Turkiye too. A Turkish AI puts up a full base with radar towers and air defense sites, sends supply trucks, fields the new army, artillery included, and attacks.diff --git a/GeneralsMD/Code/BuildFingerprint.manifest b/GeneralsMD/Code/BuildFingerprint.manifestindex f3e5d3ad0..0e76151bb 100644--- a/GeneralsMD/Code/BuildFingerprint.manifest+++ b/GeneralsMD/Code/BuildFingerprint.manifest@@ -1,5 +1,9 @@CMakeLists.txt-Data/Art/Textures/ReforgedAuraRing.tga+Data/Art/Textures/ReforgedAuraGuard.tga+Data/Art/Textures/ReforgedAuraRally.tga+Data/Art/Textures/ReforgedAuraRange.tga+Data/Art/Textures/ReforgedAuraRateOfFire.tga+Data/Art/Textures/ReforgedAuraSight.tgaData/Art/Textures/ReforgedBarAmericaCenter.tgaData/Art/Textures/ReforgedBarAmericaLeft.tgaData/Art/Textures/ReforgedBarAmericaRight.tga@@ -3904,6 +3908,7 @@ Tools/WorldBuilder/src/wbview3d.cppTools/asan-check.shTools/assetcull/assetcull.cppTools/assetcull/assetcull.dsp+Tools/aura_rings.pyTools/bigfile.pyTools/build-posix.shTools/buildVersionUpdate/buildVersionUpdate.cppdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraGuard.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraGuard.tganew file mode 100644index 000000000..3b06b81baBinary files /dev/null and b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraGuard.tga differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRally.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRally.tganew file mode 100644index 000000000..b39fa0047Binary files /dev/null and b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRally.tga differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRange.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRange.tganew file mode 100644index 000000000..9b52199e9Binary files /dev/null and b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRange.tga differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRateOfFire.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRateOfFire.tganew file mode 100644index 000000000..ff3b74b0dBinary files /dev/null and b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRateOfFire.tga differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRing.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRing.tgadeleted file mode 100644index 5f57e76fb..000000000Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraRing.tga and /dev/null differdiff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraSight.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraSight.tganew file mode 100644index 000000000..afa9a993dBinary files /dev/null and b/GeneralsMD/Code/Data/Art/Textures/ReforgedAuraSight.tga differdiff --git a/GeneralsMD/Code/Data/INI/BalanceReforged.ini b/GeneralsMD/Code/Data/INI/BalanceReforged.iniindex 3f2da5c23..b647ec47e 100644--- a/GeneralsMD/Code/Data/INI/BalanceReforged.ini+++ b/GeneralsMD/Code/Data/INI/BalanceReforged.ini@@ -1896,50 +1896,45 @@ VeterancyAuraRateOfFireCap = 18%RallyTime = 10000+ ; One dial: every ring is the full AuraRadius and each texture keeps to its own band of it+ ; (Tools/aura_rings.py), rate of fire outermost, so any set of auras reads as one instrument. One+ ; pale family with a slight tint each, no throb, the ticks and the scale turning very slowly.AuraRing_RateOfFire- Texture = ReforgedAuraRing+ Texture = ReforgedAuraRateOfFireStyle = SHADOW_ADDITIVE_DECAL- Color = R:255 G:140 B:20- OpacityMin = 45%- OpacityMax = 90%- OpacityThrobTime = 1600- SpinTime = 9000+ Color = R:230 G:205 B:165+ OpacityMin = 35%+ OpacityMax = 35%+ SpinTime = 90000EndAuraRing_Sight- Texture = ReforgedAuraRing+ Texture = ReforgedAuraSightStyle = SHADOW_ADDITIVE_DECAL- Color = R:40 G:140 B:255- OpacityMin = 45%- OpacityMax = 90%- OpacityThrobTime = 1600- SpinTime = -11000+ Color = R:175 G:200 B:230+ OpacityMin = 35%+ OpacityMax = 35%EndAuraRing_Guard- Texture = ReforgedAuraRing+ Texture = ReforgedAuraGuardStyle = SHADOW_ADDITIVE_DECAL- Color = R:40 G:230 B:80- OpacityMin = 45%- OpacityMax = 90%- OpacityThrobTime = 1600- SpinTime = 13000+ Color = R:180 G:215 B:180+ OpacityMin = 35%+ OpacityMax = 35%EndAuraRing_Range- Texture = ReforgedAuraRing+ Texture = ReforgedAuraRangeStyle = SHADOW_ADDITIVE_DECAL- Color = R:180 G:60 B:255- OpacityMin = 45%- OpacityMax = 90%- OpacityThrobTime = 1600- SpinTime = -15000+ Color = R:205 G:185 B:225+ OpacityMin = 35%+ OpacityMax = 35%+ SpinTime = -120000EndAuraRing_Rally- Texture = ReforgedAuraRing+ Texture = ReforgedAuraRallyStyle = SHADOW_ADDITIVE_DECAL- Color = R:230 G:230 B:230+ Color = R:215 G:215 B:210OpacityMin = 30%- OpacityMax = 70%- OpacityThrobTime = 2400- SpinTime = 20000+ OpacityMax = 30%EndEnddiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex 2d9159b36..555ef97eb 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -1505,9 +1505,9 @@ 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. Each further ring- * of one leader is drawn a little inside the one before, so four of them do not lie on one line.- * Reads the logic's grades and draws; nothing goes back. */+ * 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. *///-------------------------------------------------------------------------------------------------void InGameUI::updateAuraRings(){@@ -1525,7 +1525,6 @@ void InGameUI::updateAuraRings()|| obj->getShroudedStatus( local->getPlayerIndex() ) != OBJECTSHROUD_CLEAR )return;const Int grade = obj->getRankGrade();- Int shown = 0;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() )@@ -1535,10 +1534,9 @@ void InGameUI::updateAuraRings()twice = twice || ( wanted[ i ].id == obj->getID() && wanted[ i ].kind == kind );if( twice )continue;- // ponytail: the inset makes an inner ring a little short of the real reach; one radius for all kinds todaywanted[ wantedCount ].id = obj->getID();wanted[ wantedCount ].kind = kind;- wanted[ wantedCount ].radius = ladder->auraRadius( grade ) * ( 1.0f - 0.05f * shown++ );+ wanted[ wantedCount ].radius = ladder->auraRadius( grade );wanted[ wantedCount ].pos = *draw->getPosition();++wantedCount;}diff --git a/GeneralsMD/Code/Tools/aura_rings.py b/GeneralsMD/Code/Tools/aura_rings.pynew file mode 100644index 000000000..7e4454d14--- /dev/null+++ b/GeneralsMD/Code/Tools/aura_rings.py@@ -0,0 +1,98 @@+"""The ground rings under a Turkiye leader, one texture per aura kind (BalanceReforged.ini,+AuraRing_<kind> in the Veterancy block).++Every ring is drawn at the full aura radius, and each kind owns a fixed band of that one disc, so+any set of them lies as one dial: never on top of each other, the same line weight and spacing+whichever grades are there. The kinds are told apart by pattern, the colour only tints them:++ rate of fire 0.935-0.970 sixty short even ticks; every leader with an aura has it, so the+ outermost band is the reach itself+ sight 0.875 a fine dotted line+ guard 0.805 a thin line broken by eight small notches+ range 0.695-0.765 a graduated scale: a line with a long mark every sixth tick+ rally inside 0.66 a faint wash rising toward its edge, the middle left clear++They are drawn white on black for SHADOW_ADDITIVE_DECAL; the INI's Color and Opacity set how much+light each adds. The texture edge stays black, or clamping smears it across the ground.++ python Tools/aura_rings.py # writes Data/Art/Textures/ReforgedAura<Kind>.tga++Drawn four times too big and brought down, which is the antialiasing."""+import math+import os+import sys++import numpy as np+from PIL import Image++SHIPPED = 512+DRAWN = SHIPPED * 4+LINE = 0.011 # every line's width, as a share of the radius+OUT_FOLDER = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "Data", "Art", "Textures")+++def polar():+ c = (DRAWN - 1) / 2.0+ y, x = np.mgrid[0:DRAWN, 0:DRAWN].astype(np.float64)+ x = (x - c) / (DRAWN / 2.0)+ y = (y - c) / (DRAWN / 2.0)+ return np.hypot(x, y), np.arctan2(y, x)+++def arc_to_nearest(r, a, count):+ """Distance along the circle from each pixel to the nearest of count evenly spaced spokes."""+ step = 2 * math.pi / count+ return np.abs(a - np.round(a / step) * step) * r+++def ring(r, at):+ return np.abs(r - at) < LINE / 2+++def ramp(e0, e1, x):+ t = np.clip((x - e0) / (e1 - e0), 0.0, 1.0)+ return t * t * (3.0 - 2.0 * t)+++def rate_of_fire(r, a):+ return (r > 0.935) & (r < 0.970) & (arc_to_nearest(r, a, 60) < LINE / 2)+++def sight(r, a):+ at, count = 0.875, 96+ step = 2 * math.pi / count+ nearest = np.round(a / step) * step+ return np.hypot(r * np.cos(a) - at * np.cos(nearest), r * np.sin(a) - at * np.sin(nearest)) < LINE * 0.7+++def guard(r, a):+ return ring(r, 0.805) & (arc_to_nearest(r, a + math.pi / 8, 8) > 0.02)+++def range_scale(r, a):+ tick = np.round(a / (2 * math.pi / 72)).astype(np.int64) % 72+ inner = np.where(tick % 6 == 0, 0.695, 0.735)+ marks = (r > inner) & (r < 0.765) & (arc_to_nearest(r, a, 72) < LINE / 2)+ return marks | ring(r, 0.765)+++def rally(r, a):+ return 0.25 * ramp(0.30, 0.62, r) * (1.0 - ramp(0.62, 0.66, r))+++KINDS = (("RateOfFire", rate_of_fire), ("Sight", sight), ("Guard", guard), ("Range", range_scale), ("Rally", rally))+++def main():+ out_folder = sys.argv[1] if len(sys.argv) > 1 else OUT_FOLDER+ r, a = polar()+ for name, draw in KINDS:+ big = Image.fromarray(np.round(draw(r, a).astype(np.float64) * 255).astype(np.uint8), "L")+ grey = big.resize((SHIPPED, SHIPPED), Image.BOX)+ path = os.path.join(out_folder, "ReforgedAura%s.tga" % name)+ Image.merge("RGBA", (grey, grey, grey, grey)).save(path, compression="tga_rle")+ print(path)+++if __name__ == "__main__":+ main()