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(gameengine): take a tank onto a bridge from a low bank at the ramp
Olcay Seygan2e2b04dac44d
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 04f450c9f..6d2970735 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -200,6 +200,7 @@ found and fixed — EA's own, not port damage.**- A group you send round a corner goes round it side by side. Every tank used to work out its own route, every one of those routes ran over the tip of the corner, and the whole group squeezed onto that one point with the outside tanks cutting across the inside ones to reach it. Now the group takes one route and each vehicle drives its own lane of it: the outside lane swings wide, the inside one stays clear of the wall, and where the street narrows the lanes close up over a few corners rather than zigzagging. A tank whose place is short of the click stops at it, instead of driving its lane to the far end and coming back. Twenty-four tanks sent through the streets of Alpine Assault came to a dead stop 7 times a crossing instead of 10 and spent a third less time pressed against each other, and the column in the Forgotten Forest trailer scene gets its last tank home 20 seconds sooner. Infantry, and any group whose route crosses a bridge, still find their own way. A replay recorded before this change plays back differently.- A group spreads out over a bridge instead of crossing it in single file. Every bridge used to count as one lane wide, so a group closed up into a queue on the bank and went over one tank at a time, even though the Kandahar bridge on Golden Oasis carries three Crusaders abreast. The deck now keeps its real width, and the lanes close up to that width just before the ramp, so the tanks on the flanks come onto the ramp instead of nosing into the end of the railing beside it. Twenty Crusaders over the Kandahar bridge get their last tank across four seconds sooner.- No tank is left under a bridge any more. A tank that came up beside a ramp instead of onto it could drive on underneath the deck and sit there at full throttle for the rest of the match, shaking against the side of the ramp while it tried to reach the deck over its head; it was never counted as stuck, because shaking looks like moving. One tank in ten sent over the long bridge on Golden Oasis never got across that way. A tank shaking on the spot next to a bridge on its route now asks for a new way round to the ramp, and twenty out of twenty get across.+- Overlords stop getting stuck on bridges. An Overlord is wide enough that its route often met a ramp at the corner, and the bank at the corners of the long bridge on Golden Oasis sits lower than the deck. The Overlord was taken up onto the bridge, then a moment later judged too low for it as the bank fell away, put back on the ground, and it drove on underneath the deck and rocked there for the rest of the match. One Overlord in eight sent over that bridge never crossed. The ramp mouth now accepts a tank coming up from a low bank: eight out of eight get across on every test, the last one 22 seconds sooner, and twenty Crusaders over the same bridge arrive about three seconds sooner on average. A replay recorded before this change plays back differently.- A jet shot down in the air flies on before it falls. Its wings stopped working on the frame it was hit, so it dropped almost vertically and hit the ground under the spot it was killed at, which is the one thing a plane doing three hundred knots cannot do. It keeps its lift now and gives it up over the next second or so, carrying forward and nosing over as it goes.- And the bombers come down at all. A B-52, a Spectre gunship, a cargo plane and an A-10 all left the falling speed out of their data, and nought means the lift exactly cancels gravity: shot down, they flew on at cruising height, burning, and blew up in the air still level. Every one of them now falls at half gravity or better, and the fireball waits for the ground instead of going off on a timer somewhere over the map. Measured on the way in: a B-52 falls for 2.8 seconds and lands, where it used to detonate at a hundred feet. On the way home it still did not: after the drop a bomber flies off the map on a precise course that is allowed three times its normal lift, which held a dead one up with lift to spare. A bomber shot down after its run now comes down like one shot down before it.diff --git a/GeneralsMD/Code/Data/Scenarios/overlordbridge.txt b/GeneralsMD/Code/Data/Scenarios/overlordbridge.txtnew file mode 100644index 000000000..e97f6862c--- /dev/null+++ b/GeneralsMD/Code/Data/Scenarios/overlordbridge.txt@@ -0,0 +1,16 @@+# Overlords over a bridge.+#+# Players reported Overlords sticking on bridges more than any other tank. Eight of them, one right+# click, over the Kandahar bridge on Golden Oasis that runs from 1826,1410 to 1688,1585, the same+# route as bridgecross.txt. An Overlord's box is 52 by 26 against a Crusader's 30 by 20, and it+# drives at 20 a second and turns at 60 degrees where a Crusader does 30 and 180. This bridge never+# held one up: 8 of 8 on seeds 1-6 before and after the ramp-mouth fix. overlordlong.txt did.+#+# generals.exe -headless -quickstart -noshellmap -observer -multiInstance -noFPSLimit+# -map "Maps\Golden Oasis\Golden Oasis.map" -autoskirmish 2 -takeover+# -side 0 FactionChina -side 1 FactionGLA -seed 1 -maxframes 5000+# -scenario overlordbridge -logPrefix overlord_++30 spawn 0 ChinaTankOverlord 8 2043 1136 70+60 playermove 0 ChinaTankOverlord 1471 1859+60 arrive 0 ChinaTankOverlord 1471 1859 200diff --git a/GeneralsMD/Code/Data/Scenarios/overlordlong.txt b/GeneralsMD/Code/Data/Scenarios/overlordlong.txtnew file mode 100644index 000000000..7918d381c--- /dev/null+++ b/GeneralsMD/Code/Data/Scenarios/overlordlong.txt@@ -0,0 +1,17 @@+# Overlords over the long bridge.+#+# overlordbridge.txt on the long bridge in the east of Golden Oasis, the route of bridgelong.txt:+# the deck runs from 2637,1165 to 2948,1550 and is about twelve cells wide.+#+# Before the ramp mouth took a tank from a low bank, 7 of 8 arrived on every seed 1-6 and the last+# after about 2750 frames: one Overlord came up at the ramp's east corner, was put back on the+# ground and sat under the deck. After, 8 of 8 on every seed, the last after about 2100.+#+# generals.exe -headless -quickstart -noshellmap -observer -multiInstance -noFPSLimit+# -map "Maps\Golden Oasis\Golden Oasis.map" -autoskirmish 2 -takeover+# -side 0 FactionChina -side 1 FactionGLA -seed 1 -maxframes 6000+# -scenario overlordlong -logPrefix overlordlong_++30 spawn 0 ChinaTankOverlord 8 2417 893 70+60 playermove 0 ChinaTankOverlord 3168 1822+60 arrive 0 ChinaTankOverlord 3168 1822 200diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cppindex e5cc6541e..997ba1596 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp@@ -1821,7 +1821,8 @@ Bool TerrainLogic::objectInteractsWithBridgeLayer(Object *obj, Int layer, Bool cwhile (pBridge ) {if (pBridge->getLayer() == layer) {Bool match = false;- if (pBridge->isPointOnBridge(obj->getPosition()) ) {+ const Bool overDeck = pBridge->isPointOnBridge(obj->getPosition());+ if (overDeck) {match = true;}@@ -1840,9 +1841,17 @@ Bool TerrainLogic::objectInteractsWithBridgeLayer(Object *obj, Int layer, Bool c}if (match) {+ /* The height test keeps a unit driving under the deck from being lifted onto it. At the+ ramp mouth, before the unit is over the deck, its height is the bank's, and at the corners+ of the long bridge on Golden Oasis the bank sits nine to ten below the deck: the unit was+ taken onto the bridge, dropped back to the ground a few frames later as the bank fell+ away, and drove on under the deck to rock against the bank there for good. An Overlord,+ routed wide of the ramp by its size, came in at that corner, and one of eight never+ crossed. So the mouth allows twice the gap the deck does. */+ const Real allowed = overDeck ? LAYER_Z_CLOSE_ENOUGH_F : LAYER_Z_CLOSE_ENOUGH_F * 2.0f;Real bridgeHeight = pBridge->getBridgeHeight(obj->getPosition(), NULL);Real delta = fabs(obj->getPosition()->z-bridgeHeight);- if (delta>LAYER_Z_CLOSE_ENOUGH_F) {+ if (delta>allowed) {return false;}