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(gameengine): radar guidance for turkiye rocket weapons

Olcay Seyganc806e68d6a15
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cd5b9e3db..2cd191828 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -356,7 +356,8 @@ found and fixed, EA's own, not port damage.**
## Turkiye joins the fight, as an experiment
- Turkiye is a fourth side in the skirmish and multiplayer lobbies, listed as Turkiye (Experimental), Türkiye (Deneysel) in Turkish. The label is there because the side is not finished: its powers and abilities are still being worked on and will change. It has an army of its own: Mehmetcik riflemen, Sungur missile teams and Maroon Berets from the Barracks; the Altay tank, the Kirpi carrier, Korkut air defense, Firtina howitzers and Sakarya rocket launchers from the Factory; Bayraktar and Akinci drones, the Gokbey helicopter and the Kizilelma fighter from the Airfield. Every name and tooltip reads in English and in Turkish.
-- Turkiye kills from range and cannot see for itself. The Firtina throws a shell 600 and sees 100, so it waits until a spotter team, a Bayraktar or a Radar Tower finds the target, then fires on its own. Force it to shell ground nobody can see and the shots go wide, about half of them off a barracks-sized target. Extended Range and Precision Guidance at the Factory push the guns further and tighten the blind spread.
+- Turkiye kills from range and cannot see for itself. The Firtina throws a shell 600 and sees 100, so it waits until a spotter team, a Bayraktar or a Radar Tower finds the target, then fires on its own. Extended Range at the Factory pushes the guns further.
+- Turkiye's rockets fly on radar. Every rocket and missile the side fires, from the Firtina, the Sakarya, the Bayraktar, the Sungur team, the Kizilelma and the Patriot Battery, hits as aimed when the target stands inside the radar circle of a Command Center (300), a Radar Tower (600), a Koral (350) or an Akinci (400), yours or an ally's. Past every circle only one shot in five keeps its lock; the other four come down on the ground beside the target and miss, and against aircraft that means they miss altogether. A radar under construction, out of power or knocked out by an EMP covers nothing. Inertial Guidance at the Factory, which replaces Precision Guidance, makes it two shots in five. The old blind spread is gone, and so is the Sakarya's fixed spread of 25. Replays recorded before this change play out differently.
- Once something sees for it, the artillery is what kills. A Firtina shell does 200 where it lands and 60 out to 35, every 7 seconds, where it did 150 inside 10, less than an Altay. A Sakarya salvo is six rockets of 70 each with a 30 blast, every 14 seconds. The Sakarya never hit anything before: its rockets left the launcher level and went nowhere, and it now aims them up the way the Firtina does. Four Battlemasters or sixteen Rangers marching straight at two Firtinas and their spotter, the same 3500 in money, die before they get there. Crusaders and Scorpions get through with one to three tanks left. Come at the guns from the side with that money in tanks and the tanks win seven fights in eight, so a raid on the flank or a dead spotter is how a gun line falls.
- Sight is what Turkiye pays for. The Bayraktar is the artillery's real eye, 550 from the air, and costs 900 instead of 500. The Cobra sees 250 instead of 400 and is a fast car with five seats, no longer the cheapest spotter. The Radar Tower costs 800 instead of 400 and draws 3 power. The spotter team sees 500, has 200 health and moves faster. It no longer hides: the Pathfinder's camouflage made it an eye nobody could find for guns that hit from 600, and left the enemy nothing to shoot back at but the guns. The free Spy Satellite Scan is gone, and the Sungur gunner sees 200 instead of 300.
- Combat Engineers build the base in place of a dozer. They are infantry, so they can be shot and run over. The Barracks' Mine Kit lets them bury mines, and the Factory's Reinforced Hull, which used to be called the Armor Pack, gives the Kirpi and the Altay 20% more health.
@@ -671,6 +672,11 @@ found and fixed, EA's own, not port damage.**
- A guarded supply pile no longer stops its expansion. One enemy tank parked beside the nearest pile held a Hard computer's expansion for ten minutes while a free pile sat one valley over; it takes the nearest safe pile now, and the unsafe one only when nothing else is left.
- It captures the derricks behind its own base first. Each capture used to send the engineer on to the derrick nearest where he stood, so the round walked out into the middle of the map and the ones at home waited for minutes.
- A building it cannot finish no longer holds its money and its spot all match. The computer could put a supply center down at a far pile in enemy ground, lose every dozer it sent there on the way, and leave the empty scaffold standing: the money stayed spent, and no later expansion or gun went to that pile because the scaffold was already there. Now it cancels the building and takes its money back, as you would, once two dozers have died on the way with nothing built (three on Easy), or once a site away from its base has gone three minutes without any progress (four on Medium, five on Easy). It leaves that spot and its pile alone for three minutes on Hard, four on Medium and five on Easy before it tries there again.
+- It puts down a second base. Past seven minutes on Hard, twelve on Medium and twenty on Easy, the computer sends a dozer to the nearest start position nobody started on and builds a war factory there, then a power plant behind it, a gun in front of it, a supply centre at its pile and a second gun. Easy claims one empty start, Medium two, and Hard every one it can reach, nearest first. On a full map it builds no second base. Losing the main base no longer ends it in one stroke.
+- It reaches further for supplies. A pile beside one of those bases counts as home ground, and the furthest pile it will take on its own grew from 2,000 to 2,500 on Medium and 4,000 on Hard, still only where no enemy stands.
+- It stops building money buildings once it has enough. A Hard GLA put up another black market every ten seconds its bank was past its cushion; it now keeps one of each money building on Easy, two on Medium and three on Hard, and expands only until it has three working supply centres on Easy, four on Medium and six on Hard, counting only those beside a pile that still has boxes.
+- China trains hackers on every difficulty, not only on Hard, and ahead of the next army unit. It keeps two working outside an Internet Center on Easy, four on Medium and six on Hard, one for every three fighting units past that, and trains them from a barracks with two units in its queue, where one used to be enough to skip it.
+- America builds its Supply Drop Zone. The drop zone waits on the Strategy Center, which the computer only put up for its superweapon or late in its script, so Easy and Medium seldom had one. Now any side with no drop zone or black market puts up the building it waits on, at three minutes on Hard, six on Medium and ten on Easy, and then the money building itself, and puts either back when it is lost.
- Idle dozers walk ahead. When the computer knows the next building it wants and is only waiting for the money, a dozer with nothing to do walks over to the spot, so the building starts when the money comes instead of after the walk. It never takes one off a job, off repairs or off a supply run. Medium and Hard do this; Easy waits as before.
- Replays recorded before these two changes play out differently.
@@ -684,11 +690,6 @@ found and fixed, EA's own, not port damage.**
- The computer researches upgrades on its own, and spends its bank. Upgrades used to come only from a fixed list in its plan, written before anyone knew what it would build. It now looks at the army it actually has and buys the upgrade that army gets the most out of for the price, and an army that beats what it has seen of yours counts for more. Buildings count for little there, so a GLA no longer opens with Fortified Structure. It also keeps a bank of so many seconds of its income and spends anything past that: an upgrade it would otherwise have waited on, extra units from idle factories, and on Hard another war factory or barracks whenever half a minute goes by without the bank coming down. Hard holds half a minute of income, spends what is over it on extra units at up to three times the rate it earns, builds up to eight factories, one every half minute whenever its bank passes twice what it means to keep, and starts upgrading at three minutes. Medium holds a minute, tops its army up at a tenth of Hard's rate, keeps to the factories its plan lays out and starts upgrading at seven. Easy holds two minutes, tops up at a twentieth of Hard's rate, keeps to its plan's factories too and waits twelve minutes and for a much bigger army before it buys an upgrade. Saving up for the most important purchase, which only Hard did, now runs on every difficulty, each below its own bank. Over six matches of Hard against Medium, on a build one small fix short of this one (Medium and Easy now count the factories their plan has yet to build), Hard ended on 1,600 in the bank on average where it had ended on about 12,000, and won all three that finished. Replays recorded before this change play out differently.
- Hard picks its road into your base. Of the three approaches it takes the one with the fewest guns it has seen along it, and keeps to the one its plan named until it has scouted something. Aiming at your money instead was tried first and walked it straight past your army.
- Hard sends its attack groups out together. A group too small to be a wave on its own waits on the near side of its base until about seven tanks' worth has gathered, or a minute and a half has passed, and then everything waiting leaves on one road at the pace of its slowest unit. A lone artillery piece or a single bomb truck used to drive across the map by itself, and nearly a third of Hard's units died with barely anyone of their own nearby.
-- It puts down a second base. Past seven minutes on Hard, twelve on Medium and twenty on Easy, the computer sends a dozer to the nearest start position nobody started on and builds a war factory there, then a power plant behind it, a gun in front of it, a supply centre at its pile and a second gun. Easy claims one empty start, Medium two, and Hard every one it can reach, nearest first. On a full map it builds no second base. Losing the main base no longer ends it in one stroke.
-- It reaches further for supplies. A pile beside one of those bases counts as home ground, and the furthest pile it will take on its own grew from 2,000 to 2,500 on Medium and 4,000 on Hard, still only where no enemy stands.
-- It stops building money buildings once it has enough. A Hard GLA put up another black market every ten seconds its bank was past its cushion; it now keeps one of each money building on Easy, two on Medium and three on Hard, and expands only until it has three working supply centres on Easy, four on Medium and six on Hard, counting only those beside a pile that still has boxes.
-- China trains hackers on every difficulty, not only on Hard, and ahead of the next army unit. It keeps two working outside an Internet Center on Easy, four on Medium and six on Hard, one for every three fighting units past that, and trains them from a barracks with two units in its queue, where one used to be enough to skip it.
-- America builds its Supply Drop Zone. The drop zone waits on the Strategy Center, which the computer only put up for its superweapon or late in its script, so Easy and Medium seldom had one. Now any side with no drop zone or black market puts up the building it waits on, at three minutes on Hard, six on Medium and ten on Easy, and then the money building itself, and puts either back when it is lost.
- It reads the odds before it attacks. Every attack was sized the same way whoever it was aimed at, so a computer with an army at home went on waiting for a full wave while the enemy across the map had nothing left to fight with. It now weighs its own army against what it has seen of yours, and an army it cannot see it assumes is growing back towards the size of its own. It has to be looking at your buildings before it believes it is ahead. Ahead by about two to one with your base in view, Hard stops waiting and sends each group as it forms. Ahead by about six to one, the computer on any difficulty sends the guards it used to keep at home for the whole match hunting as well, half a minute apart. Outnumbered two to one, Hard and Medium keep their groups at home until twice the usual wave has gathered, and a handful is never sent into an army that size. Two leaks went with it. Units that reached the end of their road into your base used to stop there and wait for something to shoot at them; they now go looking. A group that got reinforcements at home was ordered out again as a whole, which marched the half already fighting in your base back to the middle of the map to start the walk over. Only the ones at home leave now. Over sixteen Hard against Hard matches on Twilight Flame stopped at seventeen minutes, the five that finished took 12 minutes 26 seconds on average where they had taken 13 minutes 55. The other eleven still ran to the stop: the side that is ahead kills units faster than buildings, and a defender with 120,000 in the bank replaces them at its own door. Replays recorded before this change play out differently.
- Hard stops piling its army up at home. Its plan only sends an attack group while the signal for the next wave is up, and only a group standing in the base at that moment. A group finished a minute later guarded the base until the signal came round again, and one that fell back from a lost fight guarded it for good: one GLA stood 38 of its Angry Mob by its own buildings with 70,000 in the bank. China's Dragon Tank group never left at all, because the attack order its plan names for it is missing from EA's file. Now any attack group standing idle at home joins the next wave. Rich computers also stopped building extra copies of the groups that only ever guard, four sets of tunnel guards where the plan asked for one. Over eight Hard matches on Twilight Flame, the units standing idle at home late in the match went from 43 to 17, the waves sent went from 134 to 319, and kills went up by a tenth. Replays recorded before this change play out differently.
- Medium and Easy stop piling their army up at home too. A player watched them gather at the edge of their plateau on Twilight Flame and stay there all match, and the fix above had only been made for Hard: one Medium China stood 57 units there with 109,000 in the bank and never attacked once. Now every difficulty calls up the attack groups standing idle at home, Medium every twenty seconds and Easy every minute, and the loose units standing beside them go along. Over two eight-player matches on each, Medium's idle units per player fell from 3.5 to 0.6 and its biggest pile from 57 to 7, while its attacks went from 17 to 80; Easy's attacks went from 2 to 38. Hard came out where it was, 75 attacks against 78. Replays recorded before this change play out differently.
diff --git a/GeneralsMD/Code/BuildFingerprint.manifest b/GeneralsMD/Code/BuildFingerprint.manifest
index ddb319909..a735290ef 100644
--- a/GeneralsMD/Code/BuildFingerprint.manifest
+++ b/GeneralsMD/Code/BuildFingerprint.manifest
@@ -1016,6 +1016,7 @@ GameEngine/Include/GameLogic/Module/ProneUpdate.h
GameEngine/Include/GameLogic/Module/PropagandaCenterBehavior.h
GameEngine/Include/GameLogic/Module/PropagandaTowerBehavior.h
GameEngine/Include/GameLogic/Module/QueueProductionExitUpdate.h
+GameEngine/Include/GameLogic/Module/RadarCoverageBehavior.h
GameEngine/Include/GameLogic/Module/RadarJamSpecialPower.h
GameEngine/Include/GameLogic/Module/RadarUpdate.h
GameEngine/Include/GameLogic/Module/RadarUpgrade.h
@@ -1539,6 +1540,7 @@ GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp
GameEngine/Source/GameLogic/Object/Behavior/PrisonBehavior.cpp
GameEngine/Source/GameLogic/Object/Behavior/PropagandaCenterBehavior.cpp
GameEngine/Source/GameLogic/Object/Behavior/PropagandaTowerBehavior.cpp
+GameEngine/Source/GameLogic/Object/Behavior/RadarCoverageBehavior.cpp
GameEngine/Source/GameLogic/Object/Behavior/RebuildHoleBehavior.cpp
GameEngine/Source/GameLogic/Object/Behavior/SlowDeathBehavior.cpp
GameEngine/Source/GameLogic/Object/Behavior/SpawnBehavior.cpp
diff --git a/GeneralsMD/Code/Data/French/Generals.str b/GeneralsMD/Code/Data/French/Generals.str
index 1452873bb..b858320e2 100644
--- a/GeneralsMD/Code/Data/French/Generals.str
+++ b/GeneralsMD/Code/Data/French/Generals.str
@@ -18122,15 +18122,15 @@ CONTROLBAR:ToolTipUpgradeTurkiyeExtendedRange
END
UPGRADE:TurkiyePrecisionGuidance
-"Guidage de précision"
+"Guidage inertiel"
END
CONTROLBAR:UpgradeTurkiyePrecisionGuidance
-"Guidage de &précision"
+"Guidage &inertiel"
END
CONTROLBAR:ToolTipUpgradeTurkiyePrecisionGuidance
-"Les tirs sur un sol que personne ne voit se dispersent quatre fois moins."
+"Les roquettes tirées hors de la couverture radar touchent deux fois sur cinq au lieu d'une."
END
UPGRADE:TurkiyeArmorPack
diff --git a/GeneralsMD/Code/Data/INI/TurkiyeReforged.ini b/GeneralsMD/Code/Data/INI/TurkiyeReforged.ini
index fdc38e52f..0320bf83a 100644
--- a/GeneralsMD/Code/Data/INI/TurkiyeReforged.ini
+++ b/GeneralsMD/Code/Data/INI/TurkiyeReforged.ini
@@ -31,6 +31,12 @@ Object TurkiyeCommandCenter
Side = Turkiye
DisplayName = OBJECT:TurkiyeCommandCenter
CommandSet = TurkiyeCommandCenterCommandSet
+ ; the radar circle the faction's rockets keep their lock in (TurkiyeWeaponReforged.ini)
+ AddModule
+ Behavior = RadarCoverageBehavior ModuleTag_TurkiyeRadarCoverage
+ Radius = 300
+ End
+ End
; the Rank 1 minefield (ScienceReforged.ini, SpecialPowerReforged.ini)
AddModule
Behavior = OCLSpecialPower ModuleTag_TurkiyeMinefield
@@ -684,6 +690,27 @@ End
Object TurkiyePatriotBattery
Side = Turkiye
DisplayName = OBJECT:TurkiyePatriotBattery
+ ; EA's three missiles, radar-guided (TurkiyeWeaponReforged.ini)
+ WeaponSet
+ Conditions = None
+ Weapon = PRIMARY TurkiyePatriotMissileWeapon
+ Weapon = SECONDARY TurkiyePatriotMissileAssistWeapon
+ Weapon = TERTIARY TurkiyePatriotMissileWeaponAir
+ AutoChooseSources = PRIMARY FROM_PLAYER FROM_AI FROM_SCRIPT
+ AutoChooseSources = SECONDARY NONE
+ AutoChooseSources = TERTIARY FROM_PLAYER FROM_AI FROM_SCRIPT
+ PreferredAgainst = PRIMARY VEHICLE INFANTRY
+ PreferredAgainst = SECONDARY BALLISTIC_MISSILE AIRCRAFT
+ PreferredAgainst = TERTIARY BALLISTIC_MISSILE AIRCRAFT
+ ShareWeaponReloadTime = Yes
+ End
+ ; Inertial Guidance's mark: the upgrade is this battery's, for the computer player (Weapon.cpp
+ ; reads the upgrade itself)
+ AddModule
+ Behavior = StatusBitsUpgrade ModuleTag_TurkiyeGuidance
+ TriggeredBy = Upgrade_TurkiyePrecisionGuidance
+ End
+ End
End
; The Siper: a trench bunker five infantry fire out of, China's Bunker under a Turkish name. The
@@ -730,6 +757,12 @@ Object TurkiyeRadarTower
Prerequisites
Object = TurkiyePowerPlant
End
+ ; the widest radar circle, while it has power
+ AddModule
+ Behavior = RadarCoverageBehavior ModuleTag_TurkiyeRadarCoverage
+ Radius = 600
+ End
+ End
ReplaceModule ModuleTag_05
Body = StructureBody ModuleTag_05_Turkiye
MaxHealth = 500.0
@@ -1310,6 +1343,12 @@ Object TurkiyeInfantrySungur
InitialHealth = 160.0
End
End
+ ; Inertial Guidance's mark, as on the Firtina
+ AddModule
+ Behavior = StatusBitsUpgrade ModuleTag_TurkiyeGuidance
+ TriggeredBy = Upgrade_TurkiyePrecisionGuidance
+ End
+ End
End
; The Gozcu timi: 500 vision and a carbine that is for show. It is the eye on the ground that the
@@ -1777,14 +1816,6 @@ Object TurkiyeVehicleFirtina
Conditions = PLAYER_UPGRADE
Weapon = PRIMARY TurkiyeFirtinaShellLong
End
- WeaponSet
- Conditions = CRATEUPGRADE_ONE
- Weapon = PRIMARY TurkiyeFirtinaShellGuided
- End
- WeaponSet
- Conditions = PLAYER_UPGRADE CRATEUPGRADE_ONE
- Weapon = PRIMARY TurkiyeFirtinaShellLongGuided
- End
ReplaceModule ModuleTag_02
Body = ActiveBody ModuleTag_02_Turkiye
MaxHealth = 340.0
@@ -1812,10 +1843,11 @@ Object TurkiyeVehicleFirtina
TriggeredBy = Upgrade_TurkiyeExtendedRange
End
End
+ ; Inertial Guidance's mark: the upgrade is this unit's, for the computer player (Weapon.cpp reads
+ ; the upgrade itself)
AddModule
- Behavior = WeaponSetUpgrade ModuleTag_TurkiyeGuidance
- TriggeredBy = Upgrade_TurkiyePrecisionGuidance
- WeaponSetFlag = CRATEUPGRADE_ONE
+ Behavior = StatusBitsUpgrade ModuleTag_TurkiyeGuidance
+ TriggeredBy = Upgrade_TurkiyePrecisionGuidance
End
End
End
@@ -1847,14 +1879,6 @@ Object TurkiyeVehicleSakarya
Conditions = PLAYER_UPGRADE
Weapon = PRIMARY TurkiyeSakaryaSalvoLong
End
- WeaponSet
- Conditions = CRATEUPGRADE_ONE
- Weapon = PRIMARY TurkiyeSakaryaSalvoGuided
- End
- WeaponSet
- Conditions = PLAYER_UPGRADE CRATEUPGRADE_ONE
- Weapon = PRIMARY TurkiyeSakaryaSalvoLongGuided
- End
ReplaceModule ModuleTag_02
Body = ActiveBody ModuleTag_02_Turkiye
MaxHealth = 300.0
@@ -1885,10 +1909,10 @@ Object TurkiyeVehicleSakarya
TriggeredBy = Upgrade_TurkiyeExtendedRange
End
End
+ ; Inertial Guidance's mark, as on the Firtina
AddModule
- Behavior = WeaponSetUpgrade ModuleTag_TurkiyeGuidance
- TriggeredBy = Upgrade_TurkiyePrecisionGuidance
- WeaponSetFlag = CRATEUPGRADE_ONE
+ Behavior = StatusBitsUpgrade ModuleTag_TurkiyeGuidance
+ TriggeredBy = Upgrade_TurkiyePrecisionGuidance
End
End
End
@@ -1932,6 +1956,12 @@ Object TurkiyeTankKoral
ScanRate = 166
End
End
+ ; and a radar that drives with the army
+ AddModule
+ Behavior = RadarCoverageBehavior ModuleTag_TurkiyeRadarCoverage
+ Radius = 350
+ End
+ End
End
; ==== Airfield ====================================================================================
@@ -2037,6 +2067,12 @@ Object TurkiyeVehicleBayraktar
WeaponSetFlag = PLAYER_UPGRADE
End
End
+ ; Inertial Guidance's mark, as on the Firtina
+ AddModule
+ Behavior = StatusBitsUpgrade ModuleTag_TurkiyeGuidance
+ TriggeredBy = Upgrade_TurkiyePrecisionGuidance
+ End
+ End
End
ObjectReskin TurkiyeVehicleGokbey AmericaVehicleChinook
@@ -2098,6 +2134,12 @@ Object TurkiyeJetAkinci
InitialHealth = 200.0
End
End
+ ; a radar in the air over the fight
+ AddModule
+ Behavior = RadarCoverageBehavior ModuleTag_TurkiyeRadarCoverage
+ Radius = 400
+ End
+ End
End
ObjectReskin TurkiyeJetKizilelma AmericaJetRaptor
@@ -2225,6 +2267,12 @@ Object TurkiyeJetKizilelma
OCLFinalBlowUp = OCL_TurkiyeKizilelmaDeathFinalBlowUp
End
End
+ ; Inertial Guidance's mark, as on the Firtina
+ AddModule
+ Behavior = StatusBitsUpgrade ModuleTag_TurkiyeGuidance
+ TriggeredBy = Upgrade_TurkiyePrecisionGuidance
+ End
+ End
End
; The Kizilelma's burnt-out hulk. No Side, as EA's hulks have none, so ThingFactory::newObject never
diff --git a/GeneralsMD/Code/Data/INI/TurkiyeWeaponReforged.ini b/GeneralsMD/Code/Data/INI/TurkiyeWeaponReforged.ini
index 19697ed91..41942bab9 100644
--- a/GeneralsMD/Code/Data/INI/TurkiyeWeaponReforged.ini
+++ b/GeneralsMD/Code/Data/INI/TurkiyeWeaponReforged.ini
@@ -1,8 +1,10 @@
; Zero Hour Reforged: weapons for the Turkiye faction, loaded after Weapon.ini (INI_LOAD_OVERWRITE)
; so that new names are allowed. Each is EA's weapon it is named after in the comment, with the
; fields the plan sets (docs/plans/TURKIYE-FRAKSIYON-KONSEPT.md section 5) written over it.
-; BlindScatterRadius is the fork's: the spread a shot gets when its player cannot see the
-; ground it lands on (Weapon.cpp).
+; The RadarBlindHit fields are the fork's and make a rocket radar-guided: aimed where no radar of
+; its player or an ally reaches (RadarCoverageBehavior in TurkiyeReforged.ini), a shot keeps its
+; target only RadarBlindHitChance of the time, or RadarBlindHitUpgradeChance once the player has
+; RadarBlindHitUpgrade, and the rest come down on the ground beside the target (Weapon.cpp).
;
; This file lands in the multiplayer INI checksum.
@@ -52,6 +54,9 @@ Weapon TurkiyeSungurMissile
AntiAirborneVehicle = Yes
AntiAirborneInfantry = Yes
ProjectileCollidesWith = STRUCTURES
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
; MissileDefenderLaserGuidedMissileWeapon: its laser-guided shot out to 250
@@ -76,6 +81,9 @@ Weapon TurkiyeSungurLaserMissile
AntiAirborneVehicle = Yes
AntiAirborneInfantry = Yes
ProjectileCollidesWith = STRUCTURES
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
; USAPathfinderSniperRifle: a carbine, 60 range and little damage
@@ -184,11 +192,11 @@ Weapon TurkiyeKorkutGunAir
AntiGround = No
End
-; TomahawkMissileWeapon: Tomahawk missile out to 600, wide when blind. The artillery is the faction's
+; TomahawkMissileWeapon: Tomahawk missile out to 600, radar-guided. The artillery is the faction's
; punch once something sees for it: 200 inside 15 and 60 out to 35 every 7 seconds, where the
; Tomahawk's 150 inside 10 did less than an Altay. 300 inside 20 and 100 out to 45 every 6 won 15 of
-; 16 equal-money staged raids on the gun line, flank included; this wins 4. The blind spread stays
-; the price of firing at ground nobody sees.
+; 16 equal-money staged raids on the gun line, flank included; this wins 4. Firing past the radars
+; is the price: four shots in five miss there.
Weapon TurkiyeFirtinaShell
PrimaryDamage = 200.0
PrimaryDamageRadius = 15.0
@@ -213,7 +221,9 @@ Weapon TurkiyeFirtinaShell
ClipReloadTime = 7000
CapableOfFollowingWaypoints = Yes
ProjectileCollidesWith = STRUCTURES
- BlindScatterRadius = 120
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
; TomahawkMissileWeapon: Extended Range: 690
@@ -241,63 +251,9 @@ Weapon TurkiyeFirtinaShellLong
ClipReloadTime = 7000
CapableOfFollowingWaypoints = Yes
ProjectileCollidesWith = STRUCTURES
- BlindScatterRadius = 120
-End
-
-; TomahawkMissileWeapon: Precision Guidance: blind spread 30
-Weapon TurkiyeFirtinaShellGuided
- PrimaryDamage = 200.0
- PrimaryDamageRadius = 15.0
- SecondaryDamage = 60.0
- SecondaryDamageRadius = 35.0
- ScatterRadiusVsInfantry = 20.0
- AttackRange = 600
- PreAttackDelay = 250
- PreAttackType = PER_SHOT
- MinimumAttackRange = 100.0
- DamageType = EXPLOSION
- DeathType = EXPLODED
- FireFX = FX_TomahawkIgnition
- ProjectileObject = TomahawkMissile
- ProjectileExhaust = TomahawkMissileExhaust
- VeterancyProjectileExhaust = HEROIC HeroicTomahawkMissileExhaust
- ProjectileDetonationFX = WeaponFX_BombTruckDefaultBombDetonation
- RadiusDamageAffects = SELF ALLIES ENEMIES NEUTRALS NOT_SIMILAR
- FireSound = TomahawkWeapon
- DelayBetweenShots = 1
- ClipSize = 1
- ClipReloadTime = 7000
- CapableOfFollowingWaypoints = Yes
- ProjectileCollidesWith = STRUCTURES
- BlindScatterRadius = 30
-End
-
-; TomahawkMissileWeapon: both
-Weapon TurkiyeFirtinaShellLongGuided
- PrimaryDamage = 200.0
- PrimaryDamageRadius = 15.0
- SecondaryDamage = 60.0
- SecondaryDamageRadius = 35.0
- ScatterRadiusVsInfantry = 20.0
- AttackRange = 690
- PreAttackDelay = 250
- PreAttackType = PER_SHOT
- MinimumAttackRange = 100.0
- DamageType = EXPLOSION
- DeathType = EXPLODED
- FireFX = FX_TomahawkIgnition
- ProjectileObject = TomahawkMissile
- ProjectileExhaust = TomahawkMissileExhaust
- VeterancyProjectileExhaust = HEROIC HeroicTomahawkMissileExhaust
- ProjectileDetonationFX = WeaponFX_BombTruckDefaultBombDetonation
- RadiusDamageAffects = SELF ALLIES ENEMIES NEUTRALS NOT_SIMILAR
- FireSound = TomahawkWeapon
- DelayBetweenShots = 1
- ClipSize = 1
- ClipReloadTime = 7000
- CapableOfFollowingWaypoints = Yes
- ProjectileCollidesWith = STRUCTURES
- BlindScatterRadius = 30
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
; TomahawkMissileWeapon: six Tomahawk-like rockets out to 500, 70 inside 12 and 25 out to 30 each,
@@ -326,8 +282,9 @@ Weapon TurkiyeSakaryaSalvo
ClipReloadTime = 14000
CapableOfFollowingWaypoints = Yes
ProjectileCollidesWith = STRUCTURES
- BlindScatterRadius = 120
- ScatterRadius = 25
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
; TomahawkMissileWeapon: Sakarya with Extended Range
@@ -355,66 +312,9 @@ Weapon TurkiyeSakaryaSalvoLong
ClipReloadTime = 14000
CapableOfFollowingWaypoints = Yes
ProjectileCollidesWith = STRUCTURES
- BlindScatterRadius = 120
- ScatterRadius = 25
-End
-
-; TomahawkMissileWeapon: Sakarya with Precision Guidance
-Weapon TurkiyeSakaryaSalvoGuided
- PrimaryDamage = 70
- PrimaryDamageRadius = 12.0
- SecondaryDamage = 25
- SecondaryDamageRadius = 30.0
- ScatterRadiusVsInfantry = 20.0
- AttackRange = 500
- PreAttackDelay = 0
- PreAttackType = PER_SHOT
- MinimumAttackRange = 100.0
- DamageType = EXPLOSION
- DeathType = EXPLODED
- FireFX = FX_TomahawkIgnition
- ProjectileObject = TomahawkMissile
- ProjectileExhaust = TomahawkMissileExhaust
- VeterancyProjectileExhaust = HEROIC HeroicTomahawkMissileExhaust
- ProjectileDetonationFX = WeaponFX_BombTruckDefaultBombDetonation
- RadiusDamageAffects = SELF ALLIES ENEMIES NEUTRALS NOT_SIMILAR
- FireSound = TomahawkWeapon
- DelayBetweenShots = 250
- ClipSize = 6
- ClipReloadTime = 14000
- CapableOfFollowingWaypoints = Yes
- ProjectileCollidesWith = STRUCTURES
- BlindScatterRadius = 30
- ScatterRadius = 25
-End
-
-; TomahawkMissileWeapon: Sakarya with both
-Weapon TurkiyeSakaryaSalvoLongGuided
- PrimaryDamage = 70
- PrimaryDamageRadius = 12.0
- SecondaryDamage = 25
- SecondaryDamageRadius = 30.0
- ScatterRadiusVsInfantry = 20.0
- AttackRange = 575
- PreAttackDelay = 0
- PreAttackType = PER_SHOT
- MinimumAttackRange = 100.0
- DamageType = EXPLOSION
- DeathType = EXPLODED
- FireFX = FX_TomahawkIgnition
- ProjectileObject = TomahawkMissile
- ProjectileExhaust = TomahawkMissileExhaust
- VeterancyProjectileExhaust = HEROIC HeroicTomahawkMissileExhaust
- ProjectileDetonationFX = WeaponFX_BombTruckDefaultBombDetonation
- RadiusDamageAffects = SELF ALLIES ENEMIES NEUTRALS NOT_SIMILAR
- FireSound = TomahawkWeapon
- DelayBetweenShots = 250
- ClipSize = 6
- ClipReloadTime = 14000
- CapableOfFollowingWaypoints = Yes
- ProjectileCollidesWith = STRUCTURES
- BlindScatterRadius = 30
- ScatterRadius = 25
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
; MicrowaveTankBuildingDisabler: Microwave disabler out to 400
@@ -504,6 +404,9 @@ Weapon TurkiyeBayraktarMunition
AntiAirborneVehicle = No
AntiAirborneInfantry = No
ShowsAmmoPips = Yes
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
; The Bayraktar's munition with the Airfield's Fuel Cell (twice the rack), Rank 1's Fuel Resupply
@@ -537,6 +440,9 @@ Weapon TurkiyeBayraktarMunitionFuel
AntiAirborneVehicle = No
AntiAirborneInfantry = No
ShowsAmmoPips = Yes
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
Weapon TurkiyeBayraktarMunitionResupply
@@ -566,6 +472,9 @@ Weapon TurkiyeBayraktarMunitionResupply
AntiAirborneVehicle = No
AntiAirborneInfantry = No
ShowsAmmoPips = Yes
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
Weapon TurkiyeBayraktarMunitionFuelResupply
@@ -595,6 +504,9 @@ Weapon TurkiyeBayraktarMunitionFuelResupply
AntiAirborneVehicle = No
AntiAirborneInfantry = No
ShowsAmmoPips = Yes
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
Weapon TurkiyeBayraktarSwarm
@@ -625,6 +537,9 @@ Weapon TurkiyeBayraktarSwarm
AntiAirborneInfantry = No
ShowsAmmoPips = Yes
SeeksMostValuable = Yes
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
Weapon TurkiyeBayraktarSwarmFuel
@@ -655,6 +570,9 @@ Weapon TurkiyeBayraktarSwarmFuel
AntiAirborneInfantry = No
ShowsAmmoPips = Yes
SeeksMostValuable = Yes
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
Weapon TurkiyeBayraktarSwarmResupply
@@ -685,6 +603,9 @@ Weapon TurkiyeBayraktarSwarmResupply
AntiAirborneInfantry = No
ShowsAmmoPips = Yes
SeeksMostValuable = Yes
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
Weapon TurkiyeBayraktarSwarmFuelResupply
@@ -715,6 +636,9 @@ Weapon TurkiyeBayraktarSwarmFuelResupply
AntiAirborneInfantry = No
ShowsAmmoPips = Yes
SeeksMostValuable = Yes
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
; AuroraBombWeapon, one bomb a sortie. The Fuel Cell and Fuel Resupply racks of two and four bombs
@@ -831,4 +755,94 @@ Weapon TurkiyeKizilelmaMissile
AntiAirborneInfantry = No
ShowsAmmoPips = Yes
WeaponBonus = PLAYER_UPGRADE DAMAGE 125%
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
+End
+
+; PatriotMissileWeapon, PatriotMissileAssistWeapon and PatriotMissileWeaponAir: the Patriot
+; Battery's three, as EA has them, radar-guided
+Weapon TurkiyePatriotMissileWeapon
+ PrimaryDamage = 30.0
+ PrimaryDamageRadius = 5.0
+ ScatterRadiusVsInfantry = 10.0
+ AttackRange = 225.0
+ DamageType = EXPLOSION
+ DeathType = EXPLODED
+ WeaponSpeed = 1
+ ProjectileObject = PatriotMissile
+ ProjectileExhaust = MissileExhaust
+ FireSound = PatriotBatteryWeapon
+ FireFX = FX_BuggyMissileIgnition
+ RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
+ DelayBetweenShots = 250
+ ClipSize = 4
+ ClipReloadTime = 2000
+ AutoReloadsClip = Yes
+ AntiAirborneVehicle = No
+ AntiAirborneInfantry = No
+ AntiGround = Yes
+ AntiBallisticMissile = No
+ ProjectileDetonationFX = WeaponFX_RocketBuggyMissileDetonation
+ RequestAssistRange = 200
+ ProjectileCollidesWith = STRUCTURES
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
+End
+
+Weapon TurkiyePatriotMissileAssistWeapon
+ PrimaryDamage = 25.0
+ PrimaryDamageRadius = 5.0
+ ScatterRadiusVsInfantry = 10.0
+ AttackRange = 450.0
+ DamageType = EXPLOSION
+ DeathType = EXPLODED
+ WeaponSpeed = 600
+ ProjectileObject = PatriotMissile
+ ProjectileExhaust = MissileExhaust
+ FireFX = FX_BuggyMissileIgnition
+ FireSound = PatriotBatteryWeapon
+ RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
+ DelayBetweenShots = 250
+ ClipSize = 4
+ ClipReloadTime = 1000
+ AutoReloadsClip = Yes
+ AntiAirborneVehicle = Yes
+ AntiAirborneInfantry = Yes
+ AntiGround = Yes
+ ProjectileDetonationFX = WeaponFX_RocketBuggyMissileDetonation
+ ProjectileCollidesWith = STRUCTURES
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
+End
+
+Weapon TurkiyePatriotMissileWeaponAir
+ PrimaryDamage = 25.0
+ PrimaryDamageRadius = 5.0
+ ScatterRadiusVsInfantry = 10.0
+ AttackRange = 350.0
+ DamageType = EXPLOSION
+ DeathType = EXPLODED
+ WeaponSpeed = 600
+ ProjectileObject = PatriotMissile
+ ProjectileExhaust = MissileExhaust
+ FireFX = FX_BuggyMissileIgnition
+ FireSound = PatriotBatteryWeapon
+ RadiusDamageAffects = ALLIES ENEMIES NEUTRALS
+ DelayBetweenShots = 250
+ ClipSize = 4
+ ClipReloadTime = 2000
+ AutoReloadsClip = Yes
+ AntiAirborneVehicle = Yes
+ AntiAirborneInfantry = Yes
+ AntiGround = No
+ AntiBallisticMissile = Yes
+ ProjectileDetonationFX = WeaponFX_RocketBuggyMissileDetonation
+ RequestAssistRange = 200
+ ProjectileCollidesWith = STRUCTURES
+ RadarBlindHitChance = 20%
+ RadarBlindHitUpgrade = Upgrade_TurkiyePrecisionGuidance
+ RadarBlindHitUpgradeChance = 40%
End
diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.str
index 1d55df293..9670171d7 100644
--- a/GeneralsMD/Code/Data/Patch.str
+++ b/GeneralsMD/Code/Data/Patch.str
@@ -2851,15 +2851,15 @@ CONTROLBAR:ToolTipUpgradeTurkiyeExtendedRange
END
UPGRADE:TurkiyePrecisionGuidance
-"Precision Guidance"
+"Inertial Guidance"
END
CONTROLBAR:UpgradeTurkiyePrecisionGuidance
-"&Precision Guidance"
+"&Inertial Guidance"
END
CONTROLBAR:ToolTipUpgradeTurkiyePrecisionGuidance
-"Shots at ground nobody sees spread four times less."
+"Rockets fired outside radar cover hit two shots in five, up from one."
END
UPGRADE:TurkiyeArmorPack
diff --git a/GeneralsMD/Code/Data/Russian/Generals.str b/GeneralsMD/Code/Data/Russian/Generals.str
index 32f8cdf4c..6bad3ebcd 100644
--- a/GeneralsMD/Code/Data/Russian/Generals.str
+++ b/GeneralsMD/Code/Data/Russian/Generals.str
@@ -18074,15 +18074,15 @@ CONTROLBAR:ToolTipUpgradeTurkiyeExtendedRange
END
UPGRADE:TurkiyePrecisionGuidance
-"Точное наведение"
+"Инерциальное наведение"
END
CONTROLBAR:UpgradeTurkiyePrecisionGuidance
-"&Точное наведение"
+"&Инерциальное наведение"
END
CONTROLBAR:ToolTipUpgradeTurkiyePrecisionGuidance
-"Выстрелы по земле, которую никто не видит, разбрасывает в четыре раза меньше."
+"Ракеты, выпущенные вне зоны радаров, попадают дважды из пяти, а не один раз."
END
UPGRADE:TurkiyeArmorPack
diff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.str
index 3539a86a7..393beb3d7 100644
--- a/GeneralsMD/Code/Data/Turkish/Generals.str
+++ b/GeneralsMD/Code/Data/Turkish/Generals.str
@@ -17229,15 +17229,15 @@ CONTROLBAR:ToolTipUpgradeTurkiyeExtendedRange
END
UPGRADE:TurkiyePrecisionGuidance
-"Hassas Güdüm"
+"Atalet Güdüm"
END
CONTROLBAR:UpgradeTurkiyePrecisionGuidance
-"&Hassas Güdüm"
+"Ata&let Güdüm"
END
CONTROLBAR:ToolTipUpgradeTurkiyePrecisionGuidance
-"Kimsenin görmediği yere atışın dağılımı dörtte birine iner."
+"Radar menzili dışına atılan roketlerin isabeti beşte birden beşte ikiye çıkar."
END
UPGRADE:TurkiyeArmorPack
diff --git a/GeneralsMD/Code/Data/Ukrainian/Generals.str b/GeneralsMD/Code/Data/Ukrainian/Generals.str
index 3293fde71..470064169 100644
--- a/GeneralsMD/Code/Data/Ukrainian/Generals.str
+++ b/GeneralsMD/Code/Data/Ukrainian/Generals.str
@@ -18074,15 +18074,15 @@ CONTROLBAR:ToolTipUpgradeTurkiyeExtendedRange
END
UPGRADE:TurkiyePrecisionGuidance
-"Точне наведення"
+"Інерціальне наведення"
END
CONTROLBAR:UpgradeTurkiyePrecisionGuidance
-"&Точне наведення"
+"&Інерціальне наведення"
END
CONTROLBAR:ToolTipUpgradeTurkiyePrecisionGuidance
-"Постріли по землі, якої ніхто не бачить, розкидаються вчетверо менше."
+"Ракети, випущені поза зоною радарів, влучають двічі з п'яти, а не один раз."
END
UPGRADE:TurkiyeArmorPack
diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RadarCoverageBehavior.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RadarCoverageBehavior.h
new file mode 100644
index 000000000..138d81d27
--- /dev/null
+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/RadarCoverageBehavior.h
@@ -0,0 +1,71 @@
+/*
+** Command & Conquer Generals Zero Hour(tm)
+** Copyright 2025 Electronic Arts Inc.
+**
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation, either version 3 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+// FILE: RadarCoverageBehavior.h /////////////////////////////////////////////////////////////////
+//
+// Turkiye's radar: a circle of Radius in which its own and its allies' radar-guided rockets keep
+// their lock (WeaponTemplate RadarBlindHitChance, Weapon.cpp).
+//
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+#pragma once
+
+#ifndef __RADAR_COVERAGE_BEHAVIOR_H_
+#define __RADAR_COVERAGE_BEHAVIOR_H_
+
+#include "GameLogic/Module/BehaviorModule.h"
+
+class Player;
+
+//-------------------------------------------------------------------------------------------------
+class RadarCoverageBehaviorModuleData : public BehaviorModuleData
+{
+public:
+
+ Real m_radius;
+
+ RadarCoverageBehaviorModuleData();
+
+ static void buildFieldParse( MultiIniFieldParse& p );
+};
+
+//-------------------------------------------------------------------------------------------------
+class RadarCoverageBehavior : public BehaviorModule
+{
+
+ MEMORY_POOL_GLUE_WITH_USERLOOKUP_CREATE( RadarCoverageBehavior, "RadarCoverageBehavior" )
+ MAKE_STANDARD_MODULE_MACRO_WITH_MODULE_DATA( RadarCoverageBehavior, RadarCoverageBehaviorModuleData );
+
+public:
+
+ RadarCoverageBehavior( Thing *thing, const ModuleData* moduleData );
+ // virtual destructor prototype provided by memory pool declaration
+
+ /// a working radar of this player or an ally covers this point
+ static Bool isCovered( const Player *player, const Coord3D *pos );
+
+private:
+
+ /* Every radar in the game, in no order that matters: isCovered only asks whether any of them
+ reaches. The constructor and destructor keep it, so a loaded game rebuilds it as its objects
+ are made and there is nothing to save. */
+ static RadarCoverageBehavior *s_first;
+ RadarCoverageBehavior *m_next;
+};
+
+#endif // __RADAR_COVERAGE_BEHAVIOR_H_
diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Weapon.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Weapon.h
index f9e185a6c..b97959d18 100644
--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Weapon.h
+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Weapon.h
@@ -516,7 +516,9 @@ private:
Real m_requestAssistRange; ///< My object will look this far around to get people to join in the attack.
Real m_aimDelta; ///< when aiming, consider yourself "aimed" if you are within +/- this much of an angle
Real m_scatterRadius; ///< Radius of area actual fire point will be in, default is zero for no deviation
- Real m_blindScatterRadius; ///< added to the scatter when the firer's player cannot see where the shot is going
+ Real m_radarBlindHitChance; ///< chance a shot keeps its target with no friendly radar over it (RadarCoverageBehavior); 1 for any other weapon
+ AsciiString m_radarBlindHitUpgrade; ///< the player upgrade that raises that chance
+ Real m_radarBlindHitUpgradeChance; ///< the chance with that upgrade
Bool m_seeksMostValuable; ///< fired at a unit, it goes for the most expensive enemy within its range instead
Real m_scatterTargetScalar; ///< Radius of area covered by the coordinates in the scatterTarget table
std::vector<Coord2D> m_scatterTargets; ///< instead of pure randomness, this is the list of places I will randomly choose from to attack
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/MemoryInit.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/MemoryInit.cpp
index 81b3cd618..32ce2dec6 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/System/MemoryInit.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/System/MemoryInit.cpp
@@ -401,6 +401,7 @@ static PoolSizeRec sizes[] =
{ "SpyVisionSpecialPower", 256, 32 },
{ "StealthDetectorUpdate", 256, 32 },
{ "JammerUpdate", 32, 32 },
+ { "RadarCoverageBehavior", 32, 32 },
{ "IdleHackerUpdate", 64, 32 },
{ "StealthUpdate", 512, 128 },
{ "StealthUpgrade", 256, 32 },
diff --git a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp
index 491c87c5d..5d8987aaf 100644
--- a/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/Common/Thing/ModuleFactory.cpp
@@ -85,6 +85,7 @@
#include "GameLogic/Module/FlightDeckBehavior.h"
#include "GameLogic/Module/PoisonedBehavior.h"
#include "GameLogic/Module/RebuildHoleBehavior.h"
+#include "GameLogic/Module/RadarCoverageBehavior.h"
#include "GameLogic/Module/SupplyWarehouseCripplingBehavior.h"
#include "GameLogic/Module/TechBuildingBehavior.h"
#include "GameLogic/Module/MinefieldBehavior.h"
@@ -372,6 +373,7 @@ void ModuleFactory::init( void )
addModule( FlightDeckBehavior );
addModule( PoisonedBehavior );
addModule( RebuildHoleBehavior );
+ addModule( RadarCoverageBehavior );
addModule( SupplyWarehouseCripplingBehavior );
addModule( TechBuildingBehavior );
addModule( MinefieldBehavior );
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/RadarCoverageBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/RadarCoverageBehavior.cpp
new file mode 100644
index 000000000..84063dca9
--- /dev/null
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/RadarCoverageBehavior.cpp
@@ -0,0 +1,117 @@
+/*
+** Command & Conquer Generals Zero Hour(tm)
+** Copyright 2025 Electronic Arts Inc.
+**
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation, either version 3 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+// FILE: RadarCoverageBehavior.cpp ///////////////////////////////////////////////////////////////
+//
+// A radar covers its circle while it stands finished, alive and switched on: a tower under
+// construction, out of power or hit by an EMP guides nothing, and neither does a dead one waiting
+// to be removed.
+//
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+#include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine
+
+#include "Common/Player.h"
+#include "Common/Xfer.h"
+#include "GameLogic/Object.h"
+#include "GameLogic/Module/RadarCoverageBehavior.h"
+
+RadarCoverageBehavior *RadarCoverageBehavior::s_first = NULL;
+
+//-------------------------------------------------------------------------------------------------
+RadarCoverageBehaviorModuleData::RadarCoverageBehaviorModuleData()
+{
+ m_radius = 0.0f;
+}
+
+//-------------------------------------------------------------------------------------------------
+/*static*/ void RadarCoverageBehaviorModuleData::buildFieldParse( MultiIniFieldParse& p )
+{
+ BehaviorModuleData::buildFieldParse( p );
+
+ static const FieldParse dataFieldParse[] =
+ {
+ { "Radius", INI::parseReal, NULL, offsetof( RadarCoverageBehaviorModuleData, m_radius ) },
+ { 0, 0, 0, 0 }
+ };
+ p.add( dataFieldParse );
+}
+
+//-------------------------------------------------------------------------------------------------
+RadarCoverageBehavior::RadarCoverageBehavior( Thing *thing, const ModuleData* moduleData ) : BehaviorModule( thing, moduleData )
+{
+ m_next = s_first;
+ s_first = this;
+}
+
+//-------------------------------------------------------------------------------------------------
+RadarCoverageBehavior::~RadarCoverageBehavior( void )
+{
+ RadarCoverageBehavior **link = &s_first;
+ while( *link != this )
+ link = &(*link)->m_next;
+ *link = m_next;
+}
+
+//-------------------------------------------------------------------------------------------------
+/*static*/ Bool RadarCoverageBehavior::isCovered( const Player *player, const Coord3D *pos )
+{
+ for( const RadarCoverageBehavior *radar = s_first; radar; radar = radar->m_next )
+ {
+ const Object *obj = radar->getObject();
+ if( obj->isEffectivelyDead() || obj->isDestroyed() || obj->isDisabled() || obj->testStatus( OBJECT_STATUS_UNDER_CONSTRUCTION ) )
+ continue;
+
+ const Player *owner = obj->getControllingPlayer();
+ if( owner != player && owner->getRelationship( player->getDefaultTeam() ) != ALLIES )
+ continue;
+
+ const Real radius = radar->getRadarCoverageBehaviorModuleData()->m_radius;
+ const Real dx = pos->x - obj->getPosition()->x;
+ const Real dy = pos->y - obj->getPosition()->y;
+ if( dx * dx + dy * dy <= radius * radius )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+//-------------------------------------------------------------------------------------------------
+void RadarCoverageBehavior::crc( Xfer *xfer )
+{
+ BehaviorModule::crc( xfer );
+}
+
+//-------------------------------------------------------------------------------------------------
+/** Xfer method
+ * Version Info:
+ * 1: Initial version */
+//-------------------------------------------------------------------------------------------------
+void RadarCoverageBehavior::xfer( Xfer *xfer )
+{
+ XferVersion currentVersion = 1;
+ XferVersion version = currentVersion;
+ xfer->xferVersion( &version, currentVersion );
+
+ BehaviorModule::xfer( xfer );
+}
+
+//-------------------------------------------------------------------------------------------------
+void RadarCoverageBehavior::loadPostProcess( void )
+{
+ BehaviorModule::loadPostProcess();
+}
diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp
index 0484021a1..8eec485ba 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp
@@ -49,6 +49,7 @@
#include "Common/Player.h"
#include "Common/ThingFactory.h"
#include "Common/ThingTemplate.h"
+#include "Common/Upgrade.h"
#include "Common/Xfer.h"
#include "GameClient/Drawable.h"
@@ -77,6 +78,7 @@
#include "GameLogic/Locomotor.h"
#include "GameLogic/Module/AssistedTargetingUpdate.h"
#include "GameLogic/Module/ProjectileStreamUpdate.h"
+#include "GameLogic/Module/RadarCoverageBehavior.h"
#include "GameLogic/Module/PhysicsUpdate.h"
#include "GameLogic/TerrainLogic.h"
@@ -238,7 +240,9 @@ const FieldParse WeaponTemplate::TheWeaponTemplateFieldParseTable[] =
{ "RequestAssistRange", INI::parseReal, NULL, offsetof(WeaponTemplate, m_requestAssistRange) },
{ "AcceptableAimDelta", INI::parseAngleReal, NULL, offsetof(WeaponTemplate, m_aimDelta) },
{ "ScatterRadius", INI::parseReal, NULL, offsetof(WeaponTemplate, m_scatterRadius) },
- { "BlindScatterRadius", INI::parseReal, NULL, offsetof(WeaponTemplate, m_blindScatterRadius) },
+ { "RadarBlindHitChance", INI::parsePercentToReal, NULL, offsetof(WeaponTemplate, m_radarBlindHitChance) },
+ { "RadarBlindHitUpgrade", INI::parseAsciiString, NULL, offsetof(WeaponTemplate, m_radarBlindHitUpgrade) },
+ { "RadarBlindHitUpgradeChance", INI::parsePercentToReal, NULL, offsetof(WeaponTemplate, m_radarBlindHitUpgradeChance) },
{ "SeeksMostValuable", INI::parseBool, NULL, offsetof(WeaponTemplate, m_seeksMostValuable) },
{ "ScatterTargetScalar", INI::parseReal, NULL, offsetof(WeaponTemplate, m_scatterTargetScalar) },
{ "ScatterRadiusVsInfantry", INI::parseReal, NULL, offsetof( WeaponTemplate, m_infantryInaccuracyDist ) },
@@ -329,7 +333,8 @@ WeaponTemplate::WeaponTemplate() : m_nextTemplate(NULL)
m_requestAssistRange = 0.0f;
m_aimDelta = 0.0f;
m_scatterRadius = 0.0f;
- m_blindScatterRadius = 0.0f;
+ m_radarBlindHitChance = 1.0f;
+ m_radarBlindHitUpgradeChance = 1.0f;
m_seeksMostValuable = FALSE;
m_scatterTargetScalar = 0.0f;
m_shockWaveAmount = 0.0f;
@@ -1075,18 +1080,35 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate
Coord3D projectileDestination = *victimPos; //Need to copy this, as we have a pointer to their actual position
Real scatterRadius = 0.0f;
- /* Turkiye's artillery fires past its own sight and leans on a spotter. A shot at ground its
- player does not see (a force fire into the fog, a target the spotter lost) spreads by
- BlindScatterRadius on top. The shroud is logic state, the same every machine reads. */
- Real blindScatter = 0.0f;
- if( m_blindScatterRadius > 0.0f && sourceObj && sourceObj->getControllingPlayer() &&
- ThePartitionManager->getShroudStatusForPlayer( sourceObj->getControllingPlayer()->getPlayerIndex(), victimPos ) != CELLSHROUD_CLEAR )
- blindScatter = m_blindScatterRadius;
- if( m_scatterRadius > 0.0f || blindScatter > 0.0f || m_infantryInaccuracyDist > 0.0f && victimObj && victimObj->isKindOf( KINDOF_INFANTRY ) )
+ /* Turkiye's rockets fly on radar. Aimed where no radar of the firer's player or an ally's reaches
+ (RadarCoverageBehavior), a shot keeps its target only RadarBlindHitChance of the time, or
+ RadarBlindHitUpgradeChance once the player has RadarBlindHitUpgrade. The rest come down on the
+ ground beside the target, past its edge and the blast, so they miss. The radars, the upgrade and
+ the roll are all logic state and the logic stream. */
+ Bool radarMiss = FALSE;
+ if( m_radarBlindHitChance < 1.0f && !isProjectileDetonation && sourceObj &&
+ !RadarCoverageBehavior::isCovered( sourceObj->getControllingPlayer(), victimPos ) )
+ {
+ Real hitChance = m_radarBlindHitChance;
+ if( m_radarBlindHitUpgrade.isNotEmpty() &&
+ sourceObj->getControllingPlayer()->hasUpgradeComplete( TheUpgradeCenter->findUpgrade( m_radarBlindHitUpgrade ) ) )
+ hitChance = m_radarBlindHitUpgradeChance;
+ radarMiss = GameLogicRandomValueReal( 0.0f, 1.0f ) >= hitChance;
+ }
+ if( radarMiss || m_scatterRadius > 0.0f || m_infantryInaccuracyDist > 0.0f && victimObj && victimObj->isKindOf( KINDOF_INFANTRY ) )
{
// This weapon scatters, so clear the victimObj, as we are no longer shooting it directly,
// and find a random point within the radius to shoot at as victimPos
- scatterRadius = m_scatterRadius + blindScatter;
+ scatterRadius = m_scatterRadius;
+ Real minScatterRadius = 0.0f;
+ if( radarMiss )
+ {
+ // clear of the target's edge and of the blast, and out to as far again
+ minScatterRadius = max( getPrimaryDamageRadius( bonus ), getSecondaryDamageRadius( bonus ) );
+ if( victimObj )
+ minScatterRadius += victimObj->getGeometryInfo().getBoundingCircleRadius();
+ scatterRadius = 2.0f * minScatterRadius;
+ }
// if it's an object, aim at the center, not the ground part (srj)
PathfindLayerEnum targetLayer = LAYER_GROUND;
@@ -1108,7 +1130,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate
//victimObj = NULL; // his position is already in victimPos, if he existed
//Randomize the scatter radius (sometimes it can be more accurate than others)
- scatterRadius = GameLogicRandomValueReal( 0, scatterRadius );
+ scatterRadius = GameLogicRandomValueReal( minScatterRadius, scatterRadius );
Real scatterAngleRadian = GameLogicRandomValueReal( 0, 2*PI );
Coord3D firingOffset;