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
docs(changelog): the night's fixes
Olcay Seyganb0f09f5d3e5b
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cca65de94..432645ba5 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -340,6 +340,7 @@ found and fixed, EA's own, not port damage.**- Takeoff has a runway in it. The jet rolls at full throttle, rotates its nose up, lifts its wheels off the tarmac and climbs out at a steady angle, where it used to hop off the end of the runway.- Landing has a circuit in it. The jet turns down in a descending curve onto a straight final, glides in, flares and touches down on the centreline, then rolls out and slows. It used to corkscrew down and stop dead.- On the ground a jet taxis on its wheels. It rounds the taxiway corners, rolls straight out of the landing into the taxi and turns into its parking spot in one smooth sweep.+- A jet puts its whole clip out on a pass again. It used to turn away with a round still loaded: the Stealth Fighter fired one missile of its two and went home.- Helicopters are untouched and fly as they did.## A plane that is shot down hits the ground hard@@ -427,6 +428,10 @@ found and fixed, EA's own, not port damage.**- `./build-linux.sh` stopped on Linux Mint and Arch after the centred Classic interface went in: the new code compared layout names with a Windows-only spelling that GCC on Linux has never heard of. It uses the name every platform knows now, and so do the two debug-build spots with the same habit. From 3.0.0 on, `./build-macos.sh` and `./build-linux.sh` stopped again, on another Windows-only spelling and, on Linux, a file name written in the wrong case, which Windows does not mind. The log blamed the audio library because it was the last file the build had started; the real error sat higher up. Both are fixed, after Andreas Berger found them. On 3.2.0 `./build-macos.sh` got nearly to the end and stopped on four of the build's own tests of how the game reads its files, which were missing two pieces the game's job scheduler picked up in that version. They have them now, after Martin K. reported it. Since 3.4.0 `./build-macos.sh` stopped once more, this time on the save and load code: it handed the save file's name to a log line as a whole text object where the line wanted plain characters, which the Mac's compiler refuses and Windows lets through, so on Windows that line printed garbage in place of the file name. It hands over the name itself now, and the Windows build warns about the same mistake anywhere else. Martin K. reported this one too.- Windows on Arm laptops, the Snapdragon ones, get a build made for them. Microsoft never shipped those machines the library the game loads its textures and shaders through, so the game brings its own, the texture code the Mac and Linux versions already run. Switched on in place of Microsoft's library on an ordinary Windows PC, it draws the same battlefields, with no tree, house or patch of ground going missing. Nobody has played it on a Snapdragon laptop yet.- The Linux game has Generals' icon. The window carries it in the taskbar and in the window switcher, and `add-to-menu.sh` in the folder `./build-linux.sh` makes puts the game in the desktop's app menu with it, which is where GNOME takes a running game's icon from. It had none.+- Hotkeys you set in Options are saved on Linux and still there the next time you start.+- Building from source no longer stops at a test your compiler cannot build: a test that gcc 16 refused is fixed, after Narfmeister found it, and Apple Clang 15 builds the game again.+- Modern water runs on Linux with the same reflections as Windows: Legacy, SSR and Hybrid. Options gets a Water tab, hidden on Windows, with scene reflections, reflection detail, wave detail and refraction, all following the quality slider. The water's static mesh and the shoreline are worked out once and reused, which makes it faster. Classic water stays the default. Thanks to Shin-Aska, whose pull requests these are.+- With Cloud Style on Volumetric, more than eight toxin or radiation fields at once keep their cloud look on Linux and Mac. The ninth turned flat. Thanks to Shin-Aska for the fix.- Thanks to ilyasakin, whose port this is.## No more mods@@ -528,6 +533,7 @@ found and fixed, EA's own, not port damage.**- The Paladin's laser also burns any soldier who comes within 65 of the tank, and a soldier it kills burns up again instead of being thrown by a blast. It has a second laser of its own for that, with its own two shots, so firing at a soldier never leaves the tank empty when a missile arrives.- Lasers glow now. The Paladin's and the Avenger's point defense, the Laser General's Crusader, Paladin, Avenger and turrets, and the point defense drone each draw a white-hot core down the middle of the beam and a soft halo in the beam's own colour along its whole length, so a pink Laser Avenger beam sits in a pink haze from the tank to its target. On the default renderer the core spills into the screen's bloom; on the Direct3D 9 one the halo carries the glow by itself. The Avenger's marking laser, the one that paints a target for the rest of your army, is not a weapon and keeps EA's thin blue line without a halo. The Glow setting decides how wide the halo burns, and Off gives you EA's plain beam back. The halo now rounds off past both ends of the beam instead of stopping in a straight cut across it. EA's own beams, the marking laser included, stop blinking: their texture scrolled half its height every frame, so at a steady 30 frames a second they were drawn on one frame and dark the next, in the 2003 game too. Now they hold the lit middle of the texture and show on every frame. Only the picture changed: damage, range and timing are what they were, and replays play back the same.- The same lasers now look like beams of energy. EA's beam texture lights only the middle three percent of each layer, so every weapon laser in the game was a thin line, and the halo laid over it was one flat red band the width of a tank. Now each beam is a thin, intensely bright core, nearly white with the beam's colour in it, inside a narrow glow that falls away fast, with only a faint haze beyond. The muzzle shows a small hot point, the spot it hits a small burn point, and the whole beam shimmers slightly while it fires. A shot no longer appears at full length at once: it streaks out from the barrel behind a small bright edge in 12 to 30 thousandths of a second, depending on the range, and the burn point catches as it lands. Recorded footage moves the streak on every picture rather than in steps. A beam held on one target, like the Avenger's on an aircraft, runs out on the first shot and stays whole after that. Each shot dies away over its last third instead of vanishing in one frame. Off in the Glow setting still gives you EA's plain beam. Picture only: damage, range and timing are untouched.+- Laser Defense and Laser General beams no longer rebuild their glow on every shot. With Glow off, on Low, or under Classic Graphics a beam does only EA's work, about a tenth of what a shot cost before.- A replay recorded before this change plays back differently.## Helicopters fly like helicopters@@ -549,6 +555,8 @@ found and fixed, EA's own, not port damage.**- On a machine with two graphics chips, the game used to draw on the first one it found, which was the slow one. It now uses the dedicated card, and a match holds about 260 frames a second with the trees, the shadows and the filtering left on.- Display options has a vertical sync box. Off, the picture still runs free. On, it waits for the monitor so the frame does not tear. The box takes effect when you Accept.- With vertical sync off, the picture really is free again. Ever since the game started drawing through Direct3D 11, fullscreen and windowed games were still held to the monitor's refresh: 164 frames a second on a 164 Hz screen, and a 60 Hz screen sat at 60 and sank into the fifties in a fight, where the old renderer had given players over 450. The same match now takes 2.3ms a frame, over 400 a second, where it was pinned at 6.1ms. Every picture is the same one it was. Vertical sync on still waits for the monitor.+- Menus and lobbies stop at 60 frames a second instead of running the graphics card flat out.+- Options, Display has a Frame Rate Limit box for the match: Off, 240, 144, 120 or 60. It is Off until you pick one, so a match runs as free as it did.- A slow moment costs you a dropped frame, not a slow game.- A long match no longer drags every flash it ever lit behind it. The lights a muzzle flash or a blast puts on the ground were kept after they went out, ready for the next one, and the game looked at every one of them, lit or dark, five times a frame. By minute 24 of a four-way Hard match that was close to a quarter of the game's main loop. Spent lights now wait aside until they are needed again, and the game looks only at the ones that are burning. Only drawing a picture ever put a spent light aside, so a replay's fast forward, which draws one picture a game second, and a network match left minimised, which draws none, still piled them up, and a jump forward in a replay landed on a battlefield lit by the muzzle flashes it had skipped. Every step puts them aside now, drawn or not. The hour-long eight-player match we time the game with, played with no picture, finished in 1,723 seconds instead of 2,072, and its steps slower than 16.7ms went from one in ten to about one in two hundred, on the same checksum.- Explosions no longer catch the picture. The first time each kind of fire, smoke or blast reached the screen, the game stopped for 25 to 60ms to prepare it, and the opening volley of a fight cost 300ms at once. That work is kept on disk and ships with the game, so it happens while the map loads, in about 3ms, and the worst frame of the same battle went from 141ms to 38ms.@@ -621,6 +629,7 @@ found and fixed, EA's own, not port damage.**- The computer picked its superweapon target by adding up what your things cost inside the blast, so a supply stash outranked the tank column parked next to it. Anything that can shoot back is now worth several times its price, and base defences and massed armour are what the shot goes looking for.- It could only aim inside the rectangle your buildings sit in. An attack wave sitting on its doorstep was never a target at all; now your army counts wherever it is standing.+- Under No Superweapons the computer no longer builds the Nuclear Missile silo. A player still can, because China's upgrades are sold there, and its missile never fires.- Two silos ready on the same second fired at the same spot, because nothing that was already in the air was on the map yet. A spot that has just been aimed at is worth nothing to the next shot and climbs back over ten minutes, so the salvo spreads across your base instead of digging one crater.- Measured over a half-hour match: a Particle Cannon that fired at the identical spot three times running now spreads six shots over five parts of the map, and comes back to the first one at the end, when what you rebuilt there is worth twice what it killed.- The spy satellite goes through the same targeting, and it was scanning one cell of one base seventeen times a match. It sweeps now.@@ -1085,6 +1094,7 @@ found and fixed, EA's own, not port damage.**## Weapons and units that were quietly wrong- The Aurora's bomb goes off like the strike it is. It hits for 400 where a Scud Launcher's missile hits for 300, and buildings take one and a half to three times that, yet it blew up with one carpet bomb's puff, smaller than the missile's. The blast is now two to two and a half times the Scud's across: arms of fire flung twice as far, four big napalm fireballs, a shock ring 210 wide where the carpet bomb's stops near 90, a rolling dust ring, fourteen clods of dirt and a column of smoke, with a hard shake, a wide scorch and a bend in the picture on Direct3D 11. It is over in about two seconds. Its damage is unchanged. This is the Aurora of every American general; the Alpha Aurora keeps its fuel-air blast.+- The Alpha Aurora's bomb no longer leaves a green haze hanging over the ground for the rest of the match. Classic Graphics had brought it back.- The Toxin and Stealth Generals get their Technicals again. Since v3.3.0 the Arms Dealer took the 500, ran the build timer and let nothing out, and the queue moved on to the next unit. EA has both generals roll the plain GLA Technical, and the code that hands Turkiye its own copies of American units mistook the general's Technical button for a copy of that truck, so it built the button instead of the truck. In a test queue of six, none came out before and all six do now. The plain GLA and the Demolition General were never hit. Replays recorded with a Toxin or Stealth Technical before this change play out differently.- A Turkiye player's captured buildings and builders make their own side's things again, as in the original game. A captured China dozer told to put up an Airfield built the Kargu drone base, Turkiye's superweapon, for the Airfield's 1000 instead of 5000, and a captured GLA Command Center trained Turkiye Engineers when you paid for Workers. Now the dozer builds a China Airfield and the Command Center a GLA Worker, each at its own price. Turkiye's own buildings and units are unchanged.