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
feat(gameengine): grey smoke trail behind streak-exhaust rockets
Olcay Seygan73d6d0a52ce0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 51a8a378a..bbd441e17 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -1275,6 +1275,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same- A big smoke cloud darkens the ground under it and fades as it does.- Smoke and dust stand in the sunlight. A column off a burning building throws a soft shadow as thick as the smoke is: a puff of dust barely tints the sand, a black plume darkens the ground, the tanks and the houses under it and the smoke behind it. The column itself is bright on the side facing the sun and goes dark on the far side, and a cloud drifting through a building's shadow greys over with everything else in there. A cloud used to cast a round patch straight down whichever way the sun stood, and took no shade from anything. Fire casts nothing, it is light. A machine that cannot run the newer picture keeps the round patch.- Fire lights its own smoke. The bottom of a column over a burning tank glows orange from the flames under it and flickers with them, then goes grey as it climbs out of their reach; an explosion's flash warms the smoke drifting past it. Smoke used to keep the same flat grey right down into the fire. Both renderers draw it. On the newer picture the glow stays lit where the column's own shadow falls, so a fire burning on the far side of a plume still shows orange through it instead of going dark with the smoke around it.+- Rockets leave smoke. A Tank Hunter's or a Missile Defender's rocket, a Comanche's pods, a Raptor's missiles and a Patriot's used to fly on a thin bright line of fire and nothing else. Now a grey trail hangs behind each one for under two seconds and thins away before it gets wider than a tank, and on the newer picture it shades the ground under it like any other smoke. The fire line and the flash at the nose are still there. Scuds, Tomahawks and TOW missiles had their smoke already and keep it.- The soft blob shadow for trees and scenery had never been drawn at all.- Every one of the 128 tree types casts now, plus the bushes and palms.- A tree's shadow is the tree. Trunk, crown, and the gaps between the leaves, lying along thediff --git a/GeneralsMD/Code/BuildFingerprint.manifest b/GeneralsMD/Code/BuildFingerprint.manifestindex f5cc25f1f..ba9c85dfc 100644--- a/GeneralsMD/Code/BuildFingerprint.manifest+++ b/GeneralsMD/Code/BuildFingerprint.manifest@@ -14,6 +14,7 @@ Data/Art/Textures/ReforgedSignalAttack.tgaData/Art/Textures/ReforgedSignalDefend.tgaData/Art/Textures/ReforgedSignalLook.tgaData/Cinema/demo.txt+Data/Cinema/headlights.txtData/Cinema/inf_jam.txtData/Cinema/inf_walk.txtData/Cinema/missileapex_film.txt@@ -84,12 +85,14 @@ Data/Scenarios/alphaaurora.txtData/Scenarios/bridgecross.txtData/Scenarios/bridgelong.txtData/Scenarios/chokeprobe.txt+Data/Scenarios/comanchepods.txtData/Scenarios/comturret.txtData/Scenarios/crowdbattle.txtData/Scenarios/defencereach.txtData/Scenarios/driveby.txtData/Scenarios/empfriendly.txtData/Scenarios/guardradius.txt+Data/Scenarios/headlights.txtData/Scenarios/helislide.txtData/Scenarios/helitypes.txtData/Scenarios/helixturret.txt@@ -100,6 +103,7 @@ Data/Scenarios/inferno30.txtData/Scenarios/infheadon.txtData/Scenarios/infroad.txtData/Scenarios/jetpass.txt+Data/Scenarios/laserglow.txtData/Scenarios/leadinfantry.txtData/Scenarios/leadvehicle.txtData/Scenarios/mappers.txt@@ -109,6 +113,7 @@ Data/Scenarios/massmove.txtData/Scenarios/missileapex.txtData/Scenarios/missileapex_film.txtData/Scenarios/missiledefence.txt+Data/Scenarios/missilesmoke.txtData/Scenarios/mob100.txtData/Scenarios/mob250.txtData/Scenarios/mob400.txt@@ -198,6 +203,7 @@ Data/Window/Html/Tooltip.htmlData/Window/Menus/GameSpyGameOptionsMenu.wndData/Window/Menus/LanGameOptionsMenu.wndData/Window/Menus/OptionsMenu.wnd+Data/Window/Menus/OptionsMenuClassic.wndData/Window/Menus/SkirmishGameOptionsMenu.wndData/dx11shaders.shippedGameEngine/GameEngine.dspdiff --git a/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini b/GeneralsMD/Code/Data/INI/ParticleSystemReforged.iniindex d0db06adf..815262718 100644--- a/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini+++ b/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini@@ -344,3 +344,302 @@ ParticleSystem APSBlastPuffWindPingPongEndAngleMin = 5.497787WindPingPongEndAngleMax = 6.283185End++; Grey smoke behind the rockets that EA drew as a thin additive streak and nothing else: the Tank+; Hunter's and the Missile Defender's, the Comanche's and Raptor's pods, the Patriot. The streak+; already spends its one slave on the lens flare, so the smoke hangs off the flare (ParticleSys.cpp+; feeds a slave's slave from the master's particle). It is alpha-blended and billboarded, so the+; sun's smoke map takes it and it shades the ground under Direct3D 11. Under two seconds on screen,+; and it fades before it widens past a tank. BurstCount is the puffs laid along the path between two+; bursts of the streak, which the Comanche's pods fire every second frame. The name holds no "smoke", so -smoke+; leaves it alone. Scud, Tomahawk, TOW and Neutron missiles had smoke already and keep EA's.++ParticleSystem MissileExhaustTrail+ Priority = WEAPON_TRAIL+ IsOneShot = No+ Shader = ALPHA+ Type = PARTICLE+ ParticleName = EXCloud01.tga+ AngleZ = 0.00 1.00+ AngularRateZ = -0.01 0.01+ AngularDamping = 1.00 1.00+ VelocityDamping = 0.95 0.95+ Gravity = 0.00+ Lifetime = 40.00 55.00+ SystemLifetime = 0+ Size = 6.00 9.00+ StartSizeRate = 0.00 0.00+ SizeRate = 0.80 1.20+ SizeRateDamping = 0.94 0.95+ Alpha1 = 0.45 0.50 0+ Alpha2 = 0.25 0.30 15+ Alpha3 = 0.00 0.00 55+ Alpha4 = 0.00 0.00 0+ Alpha5 = 0.00 0.00 0+ Alpha6 = 0.00 0.00 0+ Alpha7 = 0.00 0.00 0+ Alpha8 = 0.00 0.00 0+ Color1 = R:175 G:172 B:168 0+ Color2 = R:130 G:130 B:130 25+ Color3 = R:0 G:0 B:0 0+ Color4 = R:0 G:0 B:0 0+ Color5 = R:0 G:0 B:0 0+ Color6 = R:0 G:0 B:0 0+ Color7 = R:0 G:0 B:0 0+ Color8 = R:0 G:0 B:0 0+ ColorScale = 0.00 0.00+ BurstDelay = 0.00 0.00+ BurstCount = 2.00 2.00+ InitialDelay = 0.00 0.00+ DriftVelocity = X:0.08 Y:0.16 Z:0.15+ VelocityType = ORTHO+ VelOrthoX = -0.10 0.10+ VelOrthoY = -0.10 0.10+ VelOrthoZ = -0.05 0.10+ VolumeType = POINT+ IsHollow = No+ IsGroundAligned = No+ IsEmitAboveGroundOnly = No+ IsParticleUpTowardsEmitter = No+ WindMotion = Unused+ WindAngleChangeMin = 0.149924+ WindAngleChangeMax = 0.449946+ WindPingPongStartAngleMin = 0.000000+ WindPingPongStartAngleMax = 0.785398+ WindPingPongEndAngleMin = 5.497787+ WindPingPongEndAngleMax = 6.283185+End++; EA's four lens flares, unchanged but for the SlaveSystem line. Each is the slave of streak+; exhausts only (MissileExhaust, HeroicMissileExhaust, both Chem_ stingers, the infantry stingers,+; the Missile Defender's, the Comanche's and Raptor's, both Patriot trails) and of nothing else.++ParticleSystem MissileLenzflare+ Priority = WEAPON_TRAIL+ IsOneShot = No+ Shader = ADDITIVE+ Type = PARTICLE+ ParticleName = EXLnzFlar2.tga+ AngleZ = 0.00 0.00+ AngularRateZ = 0.00 0.00+ AngularDamping = 1.00 1.00+ VelocityDamping = 1.00 1.00+ Gravity = 0.00+ SlaveSystem = MissileExhaustTrail+ SlavePosOffset = X:0.00 Y:0.00 Z:0.00+ Lifetime = 3.00 3.00+ SystemLifetime = 0+ Size = 180.00 240.00+ StartSizeRate = 0.00 0.00+ SizeRate = 0.20 0.20+ SizeRateDamping = 1.00 1.00+ Alpha1 = 1.00 1.00 0+ Alpha2 = 0.00 0.00 2+ Alpha3 = 0.00 0.00 0+ Alpha4 = 0.00 0.00 0+ Alpha5 = 0.00 0.00 0+ Alpha6 = 0.00 0.00 0+ Alpha7 = 0.00 0.00 0+ Alpha8 = 0.00 0.00 0+ Color1 = R:0 G:0 B:0 0+ Color2 = R:255 G:255 B:255 1+ Color3 = R:0 G:0 B:0 3+ Color4 = R:0 G:0 B:0 0+ Color5 = R:0 G:0 B:0 0+ Color6 = R:0 G:0 B:0 0+ Color7 = R:0 G:0 B:0 0+ Color8 = R:0 G:0 B:0 0+ ColorScale = 0.00 0.00+ BurstDelay = 0.00 0.00+ BurstCount = 1.00 1.00+ InitialDelay = 0.00 0.00+ DriftVelocity = X:0.00 Y:0.00 Z:0.25+ VelocityType = OUTWARD+ VelOutward = 0.00 0.00+ VelOutwardOther = 0.00 0.00+ VolumeType = POINT+ IsHollow = Yes+ IsGroundAligned = No+ IsEmitAboveGroundOnly = No+ IsParticleUpTowardsEmitter = No+ WindMotion = Unused+ WindAngleChangeMin = 0.149924+ WindAngleChangeMax = 0.449946+ WindPingPongStartAngleMin = 0.000000+ WindPingPongStartAngleMax = 0.785398+ WindPingPongEndAngleMin = 5.497787+ WindPingPongEndAngleMax = 6.283185+End++ParticleSystem HeroicComancheMissileLenzflare+ Priority = WEAPON_TRAIL+ IsOneShot = No+ Shader = ADDITIVE+ Type = PARTICLE+ ParticleName = EXLnzFlar4.tga+ AngleZ = 0.00 0.00+ AngularRateZ = 0.00 0.00+ AngularDamping = 1.00 1.00+ VelocityDamping = 1.00 1.00+ Gravity = 0.00+ SlaveSystem = MissileExhaustTrail+ SlavePosOffset = X:0.00 Y:0.00 Z:0.00+ Lifetime = 3.00 3.00+ SystemLifetime = 0+ Size = 120.00 160.00+ StartSizeRate = 0.00 0.00+ SizeRate = 0.20 0.20+ SizeRateDamping = 1.00 1.00+ Alpha1 = 1.00 1.00 0+ Alpha2 = 0.00 0.00 2+ Alpha3 = 0.00 0.00 0+ Alpha4 = 0.00 0.00 0+ Alpha5 = 0.00 0.00 0+ Alpha6 = 0.00 0.00 0+ Alpha7 = 0.00 0.00 0+ Alpha8 = 0.00 0.00 0+ Color1 = R:0 G:0 B:0 0+ Color2 = R:255 G:255 B:255 1+ Color3 = R:0 G:0 B:0 3+ Color4 = R:0 G:0 B:0 0+ Color5 = R:0 G:0 B:0 0+ Color6 = R:0 G:0 B:0 0+ Color7 = R:0 G:0 B:0 0+ Color8 = R:0 G:0 B:0 0+ ColorScale = 0.00 0.00+ BurstDelay = 0.00 0.00+ BurstCount = 1.00 1.00+ InitialDelay = 0.00 0.00+ DriftVelocity = X:0.00 Y:0.00 Z:0.25+ VelocityType = OUTWARD+ VelOutward = 0.00 0.00+ VelOutwardOther = 0.00 0.00+ VolumeType = POINT+ IsHollow = Yes+ IsGroundAligned = No+ IsEmitAboveGroundOnly = No+ IsParticleUpTowardsEmitter = No+ WindMotion = Unused+ WindAngleChangeMin = 0.149924+ WindAngleChangeMax = 0.449946+ WindPingPongStartAngleMin = 0.000000+ WindPingPongStartAngleMax = 0.785398+ WindPingPongEndAngleMin = 5.497787+ WindPingPongEndAngleMax = 6.283185+End++ParticleSystem InfantryStingerMissileLenzflare+ Priority = WEAPON_TRAIL+ IsOneShot = No+ Shader = ADDITIVE+ Type = PARTICLE+ ParticleName = EXLnzFlar2.tga+ AngleZ = 0.00 0.00+ AngularRateZ = 0.00 0.00+ AngularDamping = 1.00 1.00+ VelocityDamping = 1.00 1.00+ Gravity = 0.00+ SlaveSystem = MissileExhaustTrail+ SlavePosOffset = X:0.00 Y:0.00 Z:0.00+ Lifetime = 3.00 3.00+ SystemLifetime = 0+ Size = 60.00 80.00+ StartSizeRate = 0.00 0.00+ SizeRate = 0.20 0.20+ SizeRateDamping = 1.00 1.00+ Alpha1 = 1.00 1.00 0+ Alpha2 = 0.00 0.00 2+ Alpha3 = 0.00 0.00 0+ Alpha4 = 0.00 0.00 0+ Alpha5 = 0.00 0.00 0+ Alpha6 = 0.00 0.00 0+ Alpha7 = 0.00 0.00 0+ Alpha8 = 0.00 0.00 0+ Color1 = R:0 G:0 B:0 0+ Color2 = R:255 G:255 B:255 1+ Color3 = R:0 G:0 B:0 3+ Color4 = R:0 G:0 B:0 0+ Color5 = R:0 G:0 B:0 0+ Color6 = R:0 G:0 B:0 0+ Color7 = R:0 G:0 B:0 0+ Color8 = R:0 G:0 B:0 0+ ColorScale = 0.00 0.00+ BurstDelay = 0.00 0.00+ BurstCount = 1.00 1.00+ InitialDelay = 0.00 0.00+ DriftVelocity = X:0.00 Y:0.00 Z:0.25+ VelocityType = OUTWARD+ VelOutward = 0.00 0.00+ VelOutwardOther = 0.00 0.00+ VolumeType = POINT+ IsHollow = Yes+ IsGroundAligned = No+ IsEmitAboveGroundOnly = No+ IsParticleUpTowardsEmitter = No+ WindMotion = Unused+ WindAngleChangeMin = 0.149924+ WindAngleChangeMax = 0.449946+ WindPingPongStartAngleMin = 0.000000+ WindPingPongStartAngleMax = 0.785398+ WindPingPongEndAngleMin = 5.497787+ WindPingPongEndAngleMax = 6.283185+End++ParticleSystem PatriotMissileLenzflare+ Priority = WEAPON_TRAIL+ IsOneShot = No+ Shader = ADDITIVE+ Type = PARTICLE+ ParticleName = EXLnzFlar2.tga+ AngleZ = 0.00 0.00+ AngularRateZ = 0.00 0.00+ AngularDamping = 1.00 1.00+ VelocityDamping = 1.00 1.00+ Gravity = 0.00+ SlaveSystem = MissileExhaustTrail+ SlavePosOffset = X:0.00 Y:0.00 Z:0.00+ Lifetime = 3.00 3.00+ SystemLifetime = 0+ Size = 20.00 20.00+ StartSizeRate = 0.00 0.00+ SizeRate = 0.20 0.20+ SizeRateDamping = 1.00 1.00+ Alpha1 = 1.00 1.00 0+ Alpha2 = 0.00 0.00 2+ Alpha3 = 0.00 0.00 0+ Alpha4 = 0.00 0.00 0+ Alpha5 = 0.00 0.00 0+ Alpha6 = 0.00 0.00 0+ Alpha7 = 0.00 0.00 0+ Alpha8 = 0.00 0.00 0+ Color1 = R:0 G:0 B:0 0+ Color2 = R:255 G:255 B:255 1+ Color3 = R:0 G:0 B:0 3+ Color4 = R:0 G:0 B:0 0+ Color5 = R:0 G:0 B:0 0+ Color6 = R:0 G:0 B:0 0+ Color7 = R:0 G:0 B:0 0+ Color8 = R:0 G:0 B:0 0+ ColorScale = 0.00 0.00+ BurstDelay = 0.00 0.00+ BurstCount = 3.00 3.00+ InitialDelay = 0.00 0.00+ DriftVelocity = X:0.00 Y:0.00 Z:0.25+ VelocityType = OUTWARD+ VelOutward = 0.00 0.00+ VelOutwardOther = 0.00 0.00+ VolumeType = LINE+ VolLineStart = X:10.00 Y:0.00 Z:0.00+ VolLineEnd = X:0.00 Y:0.00 Z:0.00+ IsHollow = Yes+ IsGroundAligned = No+ IsEmitAboveGroundOnly = No+ IsParticleUpTowardsEmitter = No+ WindMotion = Unused+ WindAngleChangeMin = 0.149924+ WindAngleChangeMax = 0.449946+ WindPingPongStartAngleMin = 0.000000+ WindPingPongStartAngleMax = 0.785398+ WindPingPongEndAngleMin = 5.497787+ WindPingPongEndAngleMax = 6.283185+Enddiff --git a/GeneralsMD/Code/Data/Scenarios/missilesmoke.txt b/GeneralsMD/Code/Data/Scenarios/missilesmoke.txtnew file mode 100644index 000000000..9547960f0--- /dev/null+++ b/GeneralsMD/Code/Data/Scenarios/missilesmoke.txt@@ -0,0 +1,23 @@+# Streak-exhaust rockets in the air at once, for a picture of the grey smoke behind them and its+# shade on the ground: four Comanches fire their pods east (comanchepods.txt, the pods land about+# frame 1590), Tank Hunters shoot up at the Comanches and Missile Defenders at two Battlemasters.+# Drawn, Direct3D 11, the camera over the pods' path:+#+# generals.exe -win -xres 1920 -yres 1080 -msaa 0 -turbo -quickstart -noshellmap -observer+# -multiInstance -noFPSLimit -map "Maps\Twilight Flame\Twilight Flame.map" -autoskirmish 2+# -takeover -side 0 FactionChina -side 1 FactionAmerica -seed 7 -maxframes 1700+# -camera 1550 3650 -screenshot 1600 -scenario missilesmoke -logPrefix missilesmoke_+#+# -novolumetricsmoke on the same line is the half without the smoke's shade.++30 spawn 1 AmericaAirfield 1 1200 3300+30 spawn 1 AmericaPowerPlant 2 1500 3300 60+30 spawn 1 AmericaVehicleComanche 4 1200 3700 40+40 shiftupgrade 1 AmericaAirfield Upgrade_ComancheRocketPods+60 move 1 AmericaVehicleComanche 1250 3700+1380 spawn 0 ChinaInfantryTankHunter 6 1500 3800 20+1380 spawn 0 ChinaTankBattleMaster 2 1750 3550 40+1380 spawn 1 AmericaInfantryMissileDefender 6 1500 3500 20+1400 weaponat 1 AmericaVehicleComanche 2050 3700+1500 attack 0 ChinaInfantryTankHunter 1 AmericaVehicleComanche+1500 attack 1 AmericaInfantryMissileDefender 0 ChinaTankBattleMasterdiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cppindex bf462e918..6a995b9ae 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/System/ParticleSys.cpp@@ -2303,10 +2303,39 @@ Bool ParticleSystem::updateEmission( Int localPlayerIndex, Bool *keepSystem )// create a slave particle, if necessaryif (m_slaveSystem){+ // the merge below draws a fresh master particle, so the place has to be read first+ const Coord3D rootPos = info->m_pos;+ParticleInfo mergeInfo = ParticleSystem::mergeRelatedParticleSystems(this, m_slaveSystem, false);// create slaved particlem_slaveSystem->createParticle( &mergeInfo, priority );++ // A slave never emits and has no transform of its own, so EA's data never hung a+ // slave off a slave. The fork's missile smoke hangs off the lens flare: every+ // system further down the chain is fed from here, in its own look and size rather+ // than scaled by the master's. Its BurstCount is spread evenly over the path from+ // the last feed to this particle, so a rocket that covers 40 between two of its+ // master's bursts leaves a line rather than beads. Nothing moves a slave's own+ // m_pos, so it holds the last feed point.+ for (ParticleSystem *chained = m_slaveSystem->m_slaveSystem; chained; chained = chained->m_slaveSystem)+ {+ const Coord3D from = chained->m_isFirstPos ? rootPos : chained->m_pos;+ chained->m_isFirstPos = false;+ chained->m_pos = rootPos;++ const Int chainedCount = floatToIntAsMsvc( REAL_TO_INT( chained->m_burstCount.getValue() ) * chained->m_countCoeff );+ const Coord3D *offset = chained->getSlavePositionOffset();+ for (Int k = 1; k <= chainedCount; ++k)+ {+ const Real along = INT_TO_REAL( k ) / chainedCount;+ ParticleInfo chainedInfo = *chained->generateParticleInfo( 1, 1 );+ chainedInfo.m_pos.x = from.x + (rootPos.x - from.x) * along + offset->x;+ chainedInfo.m_pos.y = from.y + (rootPos.y - from.y) * along + offset->y;+ chainedInfo.m_pos.z = from.z + (rootPos.z - from.z) * along + offset->z;+ chained->createParticle( &chainedInfo, priority );+ }+ }}}}