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
build(data): re-record dx11shaders.shipped with the per-object looks
Olcay Seygan66f586d6b931
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 04b339791..21842a7dc 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1588,6 +1588,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same- A China mine field tells you what kind it is. EA's field had no model at all, only a soft white glint swelling and fading on each of its eight spots, so your own minefield looked like a patch of fireflies. Each mine is now marked by a small arming light that snaps on for a quarter of a second every second and a half, red on standard and cluster mines and blue on EMP mines, with a white-hot point and a dark rim that keep it readable on grass, sand or snow. No mine body is drawn on the ground, only the light. The enemy still sees nothing until he detects the field. A mine going off under a tank now throws a column of dark earth twice the tank's height, scatters clods round it and leaves a low black smoke and a scorch, with a short jolt of the screen; it used to puff a pale spray of specks that looked like dust kicked up. An EMP mine throws no earth, so you can tell which kind went off: it lights a blue ring across the ground, a crackle of blue sparks and a short blue flash at the spot; EA's flash grew until it washed the whole screen white for a fifth of a second. What a mine does is unchanged.- A base out of power looks out of power. A building that switches off when your power runs short, or one a hacker shut down, drains to a cold grey and sags darker, and its windows and lamps go out. Every few seconds it blinks dark for an instant or its lights catch again for a moment, and blue sparks jump on its walls where something shorts. A tank or building hit by an EMP crawls with thin blue arcs for as long as it stays dead, where it used to just turn dark grey.- Your own stealthed units look like glass, not like ice. In 3.0 a camouflaged Rebel, a Pathfinder or Colonel Burton came out under a blue skin with bands running up it, which players rightly called ugly. The blue is gone: the ground behind him shows through his body in its own colours and bends, a slow lens that ripples along him and pulls harder at his outline, with a muted share of his own paint left in it. The bend is what you find him by: each face of him tips the ground behind it its own way, so his shape shows even on plain sand, and the bend never drops below a few pixels, and a cool haze that thickens at his outline makes a cloaked squad or a camouflaged base read at a glance at the zoom you play at, still as glass and without turning white. Up close a building's flat wall bends across its face. It moves slowly and never fizzes. He breathes solid at the top of the 2003 pulse and back to glass at the bottom. Going invisible, the paint eases into that lens, then the pulse takes over. Coming out, the bend eases off until the paint is whole. An enemy a detector finds fades into heat the same way. His shadow fades with him, to between a quarter and a half of its strength as he breathes, where it used to lie on the ground at full strength and give him away before his body did; on Classic and the old renderer the shadow stays whole. When an enemy detector has found him, his whole body beats amber along with his edge, so a spotted building reads as spotted and does not just turn tan. On every renderer, a stealthed unit of yours no longer comes out solid whenever no building is on the screen: the game drew it a second time without its see-through. An enemy stealth unit your detector finds used to turn into a flat orange shape with no paint; now it shows as heat, its own shading run from dark red through orange to a warm yellow that stops short of white, so you can still tell a tank from a soldier and bright GLA paint keeps its detail, with a burning outline and a slow glow climbing it that flares on every sweep of the detector. The fine scan lines of 3.0 are gone, since zoomed out they broke into stripes. This is the default renderer; Classic and the old renderer keep the 2003 look for all of these.+- The first outage, EMP, cloak or detection of a match no longer catches the picture. Each of those looks is a small drawing program of its own on every model it dresses, and until now the game built each one the first time it came on screen, 25 to 60ms of a single frame, so a whole base browning out at once could stack several into one. They come with the game now: a match, both look scenes and the main menu that compiled 61 programs while playing compile none.- A hidden base no longer burns in plain view. The fire and smoke on a stealthed building or unit, damage flames and chimney smoke alike, kept drawing for the enemy while the building itself was invisible, so a burning Stealth General base under Camo Netting stood out as a column of black smoke on an empty patch of ground. The enemy now sees none of it until a detector finds the building, and then all of it. On your own side the flames and smoke go faint with the building and breathe with it, the fire a little stronger than the smoke, so they no longer sit at full strength beside the glass. This holds on every renderer, and the smoke's shadow and the light its fire throws on nearby smoke go with it.- Effects fade out instead of blinking off. The rings a nuke sends across the ground, and any spark, flash or puff whose own colours never reached nothing, used to vanish at full strength on their last frame. Each one now dims away over its last quarter of a second, or over a quarter of its life when it lives shorter than that. One that was already fading looks the way it always did.- Toxin, anthrax and radiation pools lie on the ground. A pool is a carpet of puddle pictures spread up to 140 paces from where the shell or the spray came down, and every one of them was drawn dead flat at the height of that one spot: on a hillside the uphill half of the pool disappeared into the slope and the downhill half hung in the air above it. Each puddle now bends over the ground underneath it, on both renderers, and a pool on a bridge stays on the deck. The pool also holds still. It used to throb twice a second, because every half second the pool's poison fired a fresh batch of puddles that swelled out of black to full green and back to black in two seconds, each batch somewhere new. Now it comes up in half a second, stays one pool at full colour for as long as it does damage, and fades over its last three seconds, or over three seconds from the moment the fog of war closes over it. It is not frozen, though: each puddle fades down and back up on its own beat, so the surface shimmers like something liquid while the pool as a whole never pulses. Four Scud warheads landing on one spot used to stack into a white-hot blotch in the middle; overlapping pools now share their light and the middle stays toxin green. The ground under it takes on its colour, green for toxin and the anthrax colours for anthrax, so it looks spilled rather than shone onto the grass. China's radiation keeps its orange but glows instead of browning the grass, which made it look like a scorch mark, and small bubbles swell out of it and pop. A nuke's radiation lies on the hillside as a pool from three seconds after the blast, where its first ten seconds used to be flat squares cutting into the slope.diff --git a/GeneralsMD/Code/Data/dx11shaders.shipped b/GeneralsMD/Code/Data/dx11shaders.shippedindex bd9697208..afcc4a3eb 100644Binary files a/GeneralsMD/Code/Data/dx11shaders.shipped and b/GeneralsMD/Code/Data/dx11shaders.shipped differdiff --git a/GeneralsMD/Code/Tools/record-dx11-shaders.ps1 b/GeneralsMD/Code/Tools/record-dx11-shaders.ps1index ea463845d..b16c50c8a 100644--- a/GeneralsMD/Code/Tools/record-dx11-shaders.ps1+++ b/GeneralsMD/Code/Tools/record-dx11-shaders.ps1@@ -26,7 +26,7 @@This plays AI-against-AI skirmishes with the picture drawn by Direct3D 11, on a Windows machine whosed3dcompiler_47 is Microsoft's. It does so at the default post chain and with it off, on a few seeds,- plus the shell map. It starts each run from an empty cache: the player's cache is moved aside and put+ plus the two scenarios that stage the per-object looks, plus the shell map. It starts each run from an empty cache: the player's cache is moved aside and putback afterwards, and the farm's shipped file is unlinked. What the runs compiled is then the shippedfile. The bytecode is exactly what run-time D3DCompile gives on this machine, because it is that output.A program the recording never met is compiled on the player's machine, as before.@@ -97,6 +97,18 @@ foreach ($map in $Maps) {$runs += , @{ Name = "map-$tag"; Args = $named; Minutes = $TimeoutMinutes }$runs += , @{ Name = "map-$tag-nopost"; Args = $named + @("-dx11post", "off"); Minutes = $TimeoutMinutes }}+# The per-object looks (power outage, EMP, cloak and its shadow, revealed), each a program of its own on every+# mesh it dresses, which an observer's match never draws: an observer sees every stealthed unit as a friend's+# and none revealed. Scenarios\drawlooks.txt and looks4.txt stage them for a seat 0 that plays, and the+# cinema of the same name keeps the camera on them and ends the match.+foreach ($look in @(+ @{ Name = "drawlooks"; Sides = @("-side", 0, "FactionChina", "-side", 1, "FactionAmerica") },+ @{ Name = "looks4"; Sides = @("-side", 0, "FactionAmericaSuperWeaponGeneral", "-side", 1, "FactionGLA") })) {+ $staged = @("-quickstart", "-noshellmap", "-multiInstance", "-noFPSLimit", "-map", "`"Maps\Twilight Flame\Twilight Flame.map`"",+ "-autoskirmish", 2, "-takeover") + $look.Sides + @("-seed", 7, "-scenario", $look.Name, "-cinema", $look.Name)+ $runs += , @{ Name = $look.Name; Args = $staged; Minutes = $TimeoutMinutes }+ $runs += , @{ Name = "$($look.Name)-nopost"; Args = $staged + @("-dx11post", "off"); Minutes = $TimeoutMinutes }+}# The main menu's shell map, the first thing a player sees: the intro movies, then the menu, which runs until# it is killed. The cache is written while the game runs, so the kill loses nothing.$runs += , @{ Name = "shellmap"; Args = @("-multiInstance", "-noFPSLimit"); Minutes = 5 }@@ -108,7 +120,9 @@ try {New-Farm $zh $farm$shipped = Join-Path $farm "dx11shaders.shipped"if (-not $KeepShipped -and (Test-Path -LiteralPath $shipped)) { Remove-Item -LiteralPath $shipped -Force } # the link, never its target- $arguments = $run.Args + $ExtraArgs + @("-maxframes", $Frames, "-hiddenwindow", "-noaudio", "-logPrefix", "rec_$($run.Name)")+ # -win as well: Windows has no hidden window, and a full screen game minimizes when someone clicks+ # away from it and then waits, never reaching -maxframes+ $arguments = $run.Args + $ExtraArgs + @("-maxframes", $Frames, "-win", "-hiddenwindow", "-noaudio", "-logPrefix", "rec_$($run.Name)")Write-Host ("{0}: " -f $run.Name) -NoNewline$sw = [Diagnostics.Stopwatch]::StartNew()$proc = Start-Process -FilePath (Join-Path $farm "generals.exe") -ArgumentList $arguments -WorkingDirectory $farm -PassThru