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
fix(turkiye): kargu drones skip the doorless side shed
Olcay Seygan53db324ba1b4
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cb97dac63..d138f3be8 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -146,7 +146,7 @@ found and fixed — EA's own, not port damage.**- The Korkut is air defense and nothing else. Its cannons reach 350 into the air and no longer fire at the ground, where they used to outrange the Altay; three Korkut that cut down eight Rangers without a scratch now lose to them, and still shoot down three Comanches untouched. The Kizilelma's missiles hit the ground as well as the air, and it costs 1800 instead of 2200. It carried 380 health on a Raptor's frame and shot a Raptor down in 29 seconds while the Raptor needed 86 for it; at the Raptor's 160 the duel is even and the dearer jet loses on price. The Akinci drops its own bomb, one a sortie; it had been dropping the Aurora's. With 420 health no ground air defense paid for itself against it. At 200 a Gattling Tank or a Missile Defender beats it for the money and a Quad Cannon breaks even.- Every Turkish unit has its own command bar with only buttons that work: no drone buttons on the Altay and the Cobra, no TOW on the Cobra, no rocket pods on the Bayraktar, no flash-bang switch on the Mehmetcik. The Barracks sells Capture Building, so the Mehmetcik's capture button works.- Turkiye's first rank buys its own power, a Minefield a cargo plane sows wherever you point, beside the Spy Drone and Fuel Resupply, which keeps the drones over the target longer. Rank 3 offers a loitering munition that dives on whatever it is pointed at, Electronic Blinding, which shuts every enemy radar in the area off for 30 seconds, and Rapid Deployment, six Mehmetcik and two Sungur gunners by parachute. The top rank buys the Swarm Strike: ten munitions over a wide circle, each on a different target and the most expensive first, so a column of tanks loses its tanks and the riflemen walking beside them are left standing. Beside it sit the Fire Mission, 36 heavy shells from off the map, and the Commando Raid, a Maroon Beret and two spotter teams dropped behind the enemy's lines. The American Paradrop, Leaflet Drop, Spectre gunship and CIA intelligence are gone from the Headquarters and the power bar.-- Turkiye has a superweapon: the Kargu Drone Base. It costs 5000, draws 10 power, opens once you have a Factory and a Radar Tower, counts against the lobby's superweapon limit like the Particle Cannon, the nuke and the Scud Storm, and every player watches its five-minute countdown. The base is an airfield with two runways and four hangars, and you tell it from Turkiye's own airfield at a glance because it wears China's. Fire it and the four hangar doors open, and a second later sixteen kamikaze drones roll out of them in a stream, each turning straight onto a runway, one down each runway in turn every quarter of a second, and lift off and climb; all sixteen are in the air seven seconds after you fire. Then they fly straight across the map at 150, high enough that everyone sees them coming. Each goes for one of the sixteen most expensive things inside the target circle, noses over 60 short of it into a steep dive from straight above, steers onto it all the way down so a tank driving away still takes the hit, and hits for 700, 11,200 for the whole swarm. Every target in the circle gets one drone before any gets a second, and the spares go round again dearest first. A drone whose target died on the way takes the dearest enemy in the circle that no other drone is already after, and doubles up only when every one has a drone coming. They are aircraft, so anti-air shoots them down on the way in. The last one hits twenty seconds after you fire. Fired across Twilight Flame into an undefended American base, the swarm killed six of eight Crusaders and three of six Humvees, took 69% off the War Factory, 43% off the two power plants and 29% off the Command Center, 8500 worth of the base where the shallower dive took 3900. Into eight Crusaders and six Humvees driving across the circle it killed eleven of the fourteen; the shallow dive killed two. The Turkish computer builds and fires it on every difficulty: Hard as soon as it can pay, about fifteen minutes in on that map, Medium after seventeen minutes and Easy after thirty, the same clock America's plans keep for their Particle Cannon. China's airfield and the Hellfire drone are on loan, and the announcer calls it a Scud Storm until Turkiye has art and voices of its own.+- Turkiye has a superweapon: the Kargu Drone Base. It costs 5000, draws 10 power, opens once you have a Factory and a Radar Tower, counts against the lobby's superweapon limit like the Particle Cannon, the nuke and the Scud Storm, and every player watches its five-minute countdown. The base is an airfield with two runways and four hangars, and you tell it from Turkiye's own airfield at a glance because it wears China's. Fire it and the hangar doors roll up, and a second later sixteen kamikaze drones roll out of the three doored hangars that face the runways, never out of the open side shed, one down each runway in turn every quarter of a second, and lift off and climb; all sixteen are in the air seven seconds after you fire. Then they fly straight across the map at 150, high enough that everyone sees them coming. Each goes for one of the sixteen most expensive things inside the target circle, noses over 60 short of it into a steep dive from straight above, steers onto it all the way down so a tank driving away still takes the hit, and hits for 700, 11,200 for the whole swarm. Every target in the circle gets one drone before any gets a second, and the spares go round again dearest first. A drone whose target died on the way takes the dearest enemy in the circle that no other drone is already after, and doubles up only when every one has a drone coming. They are aircraft, so anti-air shoots them down on the way in. The last one hits twenty seconds after you fire. Fired across Twilight Flame into an undefended American base, the swarm killed six of eight Crusaders and three of six Humvees, took 69% off the War Factory, 43% off the two power plants and 40% off the Command Center, 8500 worth of the base where the shallower dive took 3900. Into eight Crusaders and six Humvees driving across the circle it killed twelve of the fourteen; the shallow dive killed two. The Turkish computer builds and fires it on every difficulty: Hard as soon as it can pay, about fifteen minutes in on that map, Medium after seventeen minutes and Easy after thirty, the same clock America's plans keep for their Particle Cannon. China's airfield and the Hellfire drone are on loan, and the announcer calls it a Scud Storm until Turkiye has art and voices of its own.- Two engineers on one building put it up in half the time, three in a third.- The Koral electronic warfare vehicle jams everything within 400 of it. Enemy drones and spotters inside the field go nearly blind, and guided missiles fired into it lose their lock and fly wide.- The Maroon Beret is a hero against every side. He is camouflaged, sees 350 for the artillery from inside the camouflage, and carries Burton's knife and timed and remote charges. He no longer hijacks supply trucks, which used him up for good and found nothing to take from America.diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cppindex 4cc437895..3a9e4013f 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/ParkingPlaceBehavior.cpp@@ -714,6 +714,10 @@ void ParkingPlaceBehavior::onCapture( Player *oldOwner, Player *newOwner )const UnsignedInt SCRAMBLE_INTERVAL_FRAMES = LOGICFRAMES_PER_SECOND / 4;// the model's hangars: the first rows of spaces, one hangar to a runway in each rowconst Int HANGAR_ROWS = 2;+// a hangar turned more than 60 degrees off its runway is a side shed with no door (the second+// hangar of the Chinese field's runway 2): a jet would appear in its open bay and pivot onto the+// runway, so that runway's jets all come out of its other hangar+const Real HANGAR_FACING_MIN_COS = 0.5f;// the hangar doors take two seconds to open; the first jet rolls when they are half wayconst UnsignedInt HANGAR_DOOR_LEAD_FRAMES = LOGICFRAMES_PER_SECOND;@@ -750,7 +754,8 @@ void ParkingPlaceBehavior::scramble( const ThingTemplate *jet, ObjectID target,* whose doors the swarm holds open, and starts its takeoff roll at once (JetAIUpdate::* friend_takeOffNow), straight out of the door onto the runway, with no taxi or queue for the* runway, so a swarm is in the air within seconds rather than four at a time out of the hangars.- * The runways take turns by the count left, and a runway's hangars by the count after that; a jet+ * The runways take turns by the count left, and a runway's hangars by the count after that, a side+ * shed that does not face down its runway left out; a jet* holds one of the spaces, the runway's, until it is airborne; the field has a space for every jet* of a swarm. *///-------------------------------------------------------------------------------------------------@@ -777,7 +782,13 @@ void ParkingPlaceBehavior::launchScramble()Object *jet = TheThingFactory->newObject( next.m_jet, getObject()->getControllingPlayer()->getDefaultTeam() );jet->setProducer( getObject() );space->m_objectInSpace = jet->getID();- const Int hangarRow = ( (Int)m_scrambles.size() / (Int)m_runways.size() ) % HANGAR_ROWS;+ Int hangarRow = ( (Int)m_scrambles.size() / (Int)m_runways.size() ) % HANGAR_ROWS;+ const RunwayInfo& strip = m_runways[ runway ];+ Coord3D along;+ along.set( strip.m_end.x - strip.m_start.x, strip.m_end.y - strip.m_start.y, 0.0f );+ const Real hangarOrient = m_spaces[ hangarRow * (Int)m_runways.size() + runway ].m_hangarStartOrient;+ if( Cos( hangarOrient ) * along.x + Sin( hangarOrient ) * along.y < HANGAR_FACING_MIN_COS * along.length() )+ hangarRow = ( hangarRow + 1 ) % HANGAR_ROWS;const ParkingPlaceInfo& hangar = m_spaces[ hangarRow * (Int)m_runways.size() + runway ];jet->setPosition( &hangar.m_hangarStart );jet->setOrientation( hangar.m_hangarStartOrient );