Skip to content

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.

fix(data): china mines read from the player's camera

Olcay Seyganccde31fb432b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fb9e6f8c3..7d309f5ce 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1374,7 +1374,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same
- A bright cloud no longer shows what is behind it as a line drawing. Inside a nuke's white cloud, or a falling War Factory's fireball, every tree and wreck under it used to come out as a thin grey outline, and the picture's sharpening ringed each dark piece in white. Both stop where the frame is bright.
- Smoke and fire no longer end on a straight line where they meet the ground or a building. A puff that sinks into a hillside or drifts against a wall thins out over its last few metres, softly enough that a nuke's haze and a Scud's grey smoke no longer come out as stacked, stair-stepped terraces, and a toxin cloud lying low over the ground keeps its body instead of breaking into hard-edged green islands. A China mine field blinks where you can see it again: its lights hang just off the ground, and the fade had eaten all but a thirtieth of their bright middle. No effect fades over more than its own size now, so a small spark close to the ground keeps its light. This is the default renderer; Classic and the old renderer keep the hard edge they had in 2003.
- Gunfire shows at the zoom you play at. A rifle's tracer was a third of a unit wide, about one pixel from the default camera, and a bullet hit nothing you could see. Tracers from rifles, Gattlings, Humvees, Technicals and Quad Cannons are now twice as wide and half again as long, the muzzle flash is half as big again, and every hit kicks up sparks and a puff of dirt where it lands. A tank shell burns a short hot streak behind it all the way to the target, where it used to be a grey sliver you could not pick out between the flash and the blast. A Crusader's, Battlemaster's, Scorpion's, Paladin's or Overlord's shot used to be a soft white glow drifting out in front of the gun, wider than the tank; it is now a short orange blast at the barrel tip, with a bigger flame and smoke puff behind it. A shell landing throws dirt and sparks around its blast. The colours are the ones the game always used, and no weapon does anything different.
-- A China mine field has mines in it. EA's field had no model at all, only a white glint blinking on each of its eight spots, so your own minefield looked like a patch of fireflies. Each spot is now a round steel mine pressed into a ring of dug earth, at a random turn, with an arming LED over its fuse that flicks on for a fifth of a second every second and a half, red on standard and cluster mines and a cold blue on EMP mines. You and your allies see them a little see-through, the way you see your own stealthed units. The enemy still sees nothing until he detects the field, and then he sees the same mines. 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 adds a blue ring across the ground and a crackle of blue sparks. What a mine does is unchanged.
+- A China mine field has mines in it. EA's field had no model at all, only a white glint blinking on each of its eight spots, so your own minefield looked like a patch of fireflies. Each spot is now a round steel mine pressed into a ring of dug earth, at a random turn, with an arming LED over its fuse that flicks on for a quarter of a second every second and a half, red on standard and cluster mines and a cold blue on EMP mines. You and your allies see them a little see-through, the way you see your own stealthed units. The enemy still sees nothing until he detects the field, and then he sees the same mines. 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 adds a blue ring across the ground and a crackle of blue sparks. What a mine does is unchanged.
- A base out of power looks out of power. A building short of power, 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 cloaked instead of faded. What stands behind a Pathfinder, Colonel Burton or a stealthed GLA unit bends through its body in a slow ripple, under a cold edge you can still read the unit by. When an enemy detector has found him, that edge pulses amber. An enemy stealth unit your detector finds used to turn into a flat orange shape with no paint; now it keeps its own paint, drained of colour, under a burning red-orange outline with scan lines running up it, and all of it flares on every sweep of the detector. This is the default renderer; Classic and the old renderer keep the 2003 look for all of these.
- 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.
diff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedMine.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedMine.tga
index 5946b88ed..6731f568d 100644
Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedMine.tga and b/GeneralsMD/Code/Data/Art/Textures/ReforgedMine.tga differ
diff --git a/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini b/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini
index c13b1ca64..d7af861d7 100644
--- a/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini
+++ b/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini
@@ -3404,9 +3404,10 @@ End
; in a ring of dug earth five across, laid flat on the bone at a random turn, with an arming LED
; above its middle, red on the standard and cluster mines and cold blue-violet on the EMP mines.
; The LED is ReforgedMineLedRed.tga or ReforgedMineLedBlue.tga, a hard pale core inside a small glow,
-; three across (the slave's Size scales the plate's). It comes on at full strength, holds for five
-; frames and is out two frames later, then stays dark until the next plate a second and a half on:
-; the lens flare it replaced was a soft blob that swelled and faded over 24 frames.
+; nine across with the core under two (the slave's Size scales the plate's). It comes on at full
+; strength, holds for eight frames and is out two frames later, then stays dark until the next plate
+; a second and a half on: the lens flare it replaced was a soft blob that swelled and faded over 24
+; frames. Three across was three or four pixels from the player's own camera and lost.
;
; The systems hang off the field's model, so they keep its stealth: the owner and his allies see
; them, an enemy only while the field is detected. A plate lives two seconds and the next is laid
@@ -3425,9 +3426,9 @@ ParticleSystem MineFXLight
AngularDamping = 1.00 1.00
VelocityDamping = 1.00 1.00
Gravity = 0.00
- Lifetime = 8.00 8.00
+ Lifetime = 11.00 11.00
SystemLifetime = 0
- Size = 0.60 0.60
+ Size = 1.80 1.80
StartSizeRate = 0.00 0.00
SizeRate = 0.00 0.00
SizeRateDamping = 1.00 1.00
@@ -3440,8 +3441,8 @@ ParticleSystem MineFXLight
Alpha7 = 0.00 0.00 0
Alpha8 = 0.00 0.00 0
Color1 = R:255 G:255 B:255 0
- Color2 = R:255 G:255 B:255 5
- Color3 = R:0 G:0 B:0 7
+ Color2 = R:255 G:255 B:255 8
+ Color3 = R:0 G:0 B:0 10
Color4 = R:0 G:0 B:0 0
Color5 = R:0 G:0 B:0 0
Color6 = R:0 G:0 B:0 0
@@ -3480,9 +3481,9 @@ ParticleSystem MineFXLightPurple
AngularDamping = 1.00 1.00
VelocityDamping = 1.00 1.00
Gravity = 0.00
- Lifetime = 8.00 8.00
+ Lifetime = 11.00 11.00
SystemLifetime = 0
- Size = 0.60 0.60
+ Size = 1.80 1.80
StartSizeRate = 0.00 0.00
SizeRate = 0.00 0.00
SizeRateDamping = 1.00 1.00
@@ -3495,8 +3496,8 @@ ParticleSystem MineFXLightPurple
Alpha7 = 0.00 0.00 0
Alpha8 = 0.00 0.00 0
Color1 = R:255 G:255 B:255 0
- Color2 = R:255 G:255 B:255 5
- Color3 = R:0 G:0 B:0 7
+ Color2 = R:255 G:255 B:255 8
+ Color3 = R:0 G:0 B:0 10
Color4 = R:0 G:0 B:0 0
Color5 = R:0 G:0 B:0 0
Color6 = R:0 G:0 B:0 0
@@ -3658,7 +3659,7 @@ ParticleSystem MineBlastColumn
Gravity = -0.12
Lifetime = 40.00 55.00
SystemLifetime = 1
- Size = 4.00 7.00
+ Size = 6.00 10.00
StartSizeRate = 0.00 0.00
SizeRate = 0.25 0.25
SizeRateDamping = 0.97 0.97
@@ -3832,7 +3833,7 @@ ParticleSystem MineEMPRing
Gravity = 0.00
Lifetime = 18.00 18.00
SystemLifetime = 3
- Size = 2.00 2.00
+ Size = 3.50 3.50
StartSizeRate = 0.00 0.00
SizeRate = 1.60 1.60
SizeRateDamping = 1.00 1.00
diff --git a/GeneralsMD/Code/Tools/mine_marks.py b/GeneralsMD/Code/Tools/mine_marks.py
index cf6429c95..dbb3ea430 100644
--- a/GeneralsMD/Code/Tools/mine_marks.py
+++ b/GeneralsMD/Code/Tools/mine_marks.py
@@ -22,8 +22,9 @@ SHIPPED = 128
CENTRE = (DRAWN - 1) / 2.0
LIGHT = (-0.45, -0.55, 0.70) # towards the light: up and to the left in the picture, mostly overhead
STEEL = (64, 68, 54) # olive drab, darker than grey ballast so the plate stands off it
-SOIL = (40, 32, 22)
-SOIL_ALPHA = 0.7
+SOIL = (26, 20, 14)
+SOIL_ALPHA = 0.85 # the dark ring is what tells a mine from a stone on grass at the player's camera
+OUTLINE = 0.035 # a near-black edge round the steel, as a share of the half width
PLATE = 0.70 # radius of the steel, as a share of the half width
SOIL_OUT = 0.98
BOLTS = 0.55
@@ -74,7 +75,9 @@ def main():
n = (-dx, -dy, 1.0)
nl = math.sqrt(n[0] * n[0] + n[1] * n[1] + 1.0)
lit = max(0.0, (n[0] * light[0] + n[1] * light[1] + n[2] * light[2]) / nl)
- shade = 0.35 + 0.85 * lit + 0.05 * noise
+ shade = 0.25 + 1.1 * lit + 0.05 * noise
+ if r > PLATE - OUTLINE:
+ shade *= 0.35
colour = tuple(min(255, max(0, int(c * shade))) for c in STEEL)
pixels[px, py] = colour + (255,)
elif r < SOIL_OUT: