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): mine led as a flat lens and bezel clear of the soft fade

Olcay Seygand5a9516f7d89
diff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedMineLedBlue.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedMineLedBlue.tga
index 35398f2f3..fb8dfa2df 100644
Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedMineLedBlue.tga and b/GeneralsMD/Code/Data/Art/Textures/ReforgedMineLedBlue.tga differ
diff --git a/GeneralsMD/Code/Data/Art/Textures/ReforgedMineLedRed.tga b/GeneralsMD/Code/Data/Art/Textures/ReforgedMineLedRed.tga
index 343556033..5da8534ef 100644
Binary files a/GeneralsMD/Code/Data/Art/Textures/ReforgedMineLedRed.tga and b/GeneralsMD/Code/Data/Art/Textures/ReforgedMineLedRed.tga differ
diff --git a/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini b/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini
index f7845717a..09d6e7d79 100644
--- a/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini
+++ b/GeneralsMD/Code/Data/INI/ParticleSystemReforged.ini
@@ -3403,12 +3403,15 @@ End
; MineFXPurple are the mines themselves now: ReforgedMine.tga (Tools/mine_marks.py), a steel plate
; 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 sky blue on the EMP mines.
-; The LED is ReforgedMineLedRed.tga or ReforgedMineLedBlue.tga, a hard pale core inside a glow,
-; 15 across, the core about a quarter of that (the slave's Size scales
-; the plate's); nine across was still lost at the player's camera. 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 LED is ReforgedMineLedRed.tga or ReforgedMineLedBlue.tga, a coloured lens with a near-white hot
+; spot inside a dark bezel, alpha blended so it keeps its colour on grass, sand or snow; the additive
+; glow it replaced took the ground's colour. The slave's Size scales the plate's, so 1.1 makes it 11
+; across with a lens of five and a half. It lies flat five above the plate, because the soft particle
+; fade thins a sprite over its own half width wherever the ground is closer behind it than that, and
+; the old 30-across glow 0.6 above the plate came out at about a tenth of its colour. It comes on at
+; full strength, holds for eight frames and is gone 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.
;
; 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
@@ -3419,7 +3422,7 @@ End
ParticleSystem MineFXLight
Priority = ALWAYS_RENDER
IsOneShot = No
- Shader = ADDITIVE
+ Shader = ALPHA
Type = PARTICLE
ParticleName = ReforgedMineLedRed.tga
AngleZ = 0.00 0.00
@@ -3429,13 +3432,13 @@ ParticleSystem MineFXLight
Gravity = 0.00
Lifetime = 11.00 11.00
SystemLifetime = 0
- Size = 3.00 3.00
+ Size = 1.10 1.10
StartSizeRate = 0.00 0.00
SizeRate = 0.00 0.00
SizeRateDamping = 1.00 1.00
Alpha1 = 1.00 1.00 0
- Alpha2 = 0.00 0.00 0
- Alpha3 = 0.00 0.00 0
+ Alpha2 = 1.00 1.00 8
+ Alpha3 = 0.00 0.00 10
Alpha4 = 0.00 0.00 0
Alpha5 = 0.00 0.00 0
Alpha6 = 0.00 0.00 0
@@ -3459,7 +3462,7 @@ ParticleSystem MineFXLight
VelOutwardOther = 0.00 0.00
VolumeType = POINT
IsHollow = No
- IsGroundAligned = No
+ IsGroundAligned = Yes
IsEmitAboveGroundOnly = No
IsParticleUpTowardsEmitter = No
WindMotion = Unused
@@ -3474,7 +3477,7 @@ End
ParticleSystem MineFXLightPurple
Priority = ALWAYS_RENDER
IsOneShot = No
- Shader = ADDITIVE
+ Shader = ALPHA
Type = PARTICLE
ParticleName = ReforgedMineLedBlue.tga
AngleZ = 0.00 0.00
@@ -3484,13 +3487,13 @@ ParticleSystem MineFXLightPurple
Gravity = 0.00
Lifetime = 11.00 11.00
SystemLifetime = 0
- Size = 3.00 3.00
+ Size = 1.10 1.10
StartSizeRate = 0.00 0.00
SizeRate = 0.00 0.00
SizeRateDamping = 1.00 1.00
Alpha1 = 1.00 1.00 0
- Alpha2 = 0.00 0.00 0
- Alpha3 = 0.00 0.00 0
+ Alpha2 = 1.00 1.00 8
+ Alpha3 = 0.00 0.00 10
Alpha4 = 0.00 0.00 0
Alpha5 = 0.00 0.00 0
Alpha6 = 0.00 0.00 0
@@ -3514,7 +3517,7 @@ ParticleSystem MineFXLightPurple
VelOutwardOther = 0.00 0.00
VolumeType = POINT
IsHollow = No
- IsGroundAligned = No
+ IsGroundAligned = Yes
IsEmitAboveGroundOnly = No
IsParticleUpTowardsEmitter = No
WindMotion = Unused
@@ -3580,7 +3583,7 @@ ParticleSystem MineFX
WindPingPongEndAngleMin = 5.497787
WindPingPongEndAngleMax = 6.283185
SlaveSystem = MineFXLight
- SlavePosOffset = X:0.00 Y:0.00 Z:0.60
+ SlavePosOffset = X:0.00 Y:0.00 Z:5.00
End
ParticleSystem MineFXPurple
@@ -3637,7 +3640,7 @@ ParticleSystem MineFXPurple
WindPingPongEndAngleMin = 5.497787
WindPingPongEndAngleMax = 6.283185
SlaveSystem = MineFXLightPurple
- SlavePosOffset = X:0.00 Y:0.00 Z:0.60
+ SlavePosOffset = X:0.00 Y:0.00 Z:5.00
End
; A mine going off under a vehicle (WeaponFX_MineDetonation and Neutron_WeaponFX_Mine in
diff --git a/GeneralsMD/Code/Tools/mine_marks.py b/GeneralsMD/Code/Tools/mine_marks.py
index a57d0a17c..4bad750e6 100644
--- a/GeneralsMD/Code/Tools/mine_marks.py
+++ b/GeneralsMD/Code/Tools/mine_marks.py
@@ -3,9 +3,10 @@ of disturbed earth. The game lays it flat on the ground at each of a mine field
(ParticleSystemReforged.ini, MineFX and MineFXPurple), so it is shaded here once, lit from the top
left, and the soil ring fades out into whatever ground it lands on.
-The arming light over each mine is an LED seen from above: a hard, nearly white core a fifth of the
-picture across inside a small glow in the light's colour, red for the standard and cluster mines and
-a cold sky blue for the EMP mines. It is drawn additively, so black is nothing.
+The arming light over each mine is an LED seen from above: a lens in the light's colour, red for the
+standard and cluster mines and a saturated blue for the EMP mines, with a near-white hot spot in its
+middle, inside a dark bezel. It is alpha blended, not additive, so the lens keeps its colour over
+grass, sand or snow and the bezel parts it from whatever ground is round it.
python Tools/mine_marks.py # writes Data/Art/Textures/ReforgedMine.tga and ReforgedMineLed*.tga
@@ -28,10 +29,12 @@ OUTLINE = 0.035 # a near-black edge round the steel, as a share of the half wi
PLATE = 0.70 # radius of the steel, as a share of the half width
SOIL_OUT = 0.98
BOLTS = 0.55
-LED_CORE = 0.22 # radius of the hard core, as a share of the half width
-LED_GLOW = 0.22 # the glow falls off as exp(-(r - core) / this)
-LED_GLOW_PEAK = 0.85 # the glow's strength just outside the core, against the core's 1
-LEDS = (("Red", (255, 30, 12), (255, 215, 200)), ("Blue", (60, 100, 255), (170, 200, 255)))
+LED_HOT = 0.10 # radius of the near-white hot spot, as a share of the half width
+LED_LENS = 0.50 # radius of the lit lens in the light's colour
+LED_BEZEL_OUT = 0.74 # outer edge of the dark bezel round the lens
+LED_BEZEL = (10, 8, 8)
+LED_BEZEL_ALPHA = 0.9
+LEDS = (("Red", (255, 28, 10), (255, 235, 225)), ("Blue", (40, 110, 255), (225, 240, 255)))
OUT_FOLDER = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "Data", "Art", "Textures")
@@ -96,7 +99,7 @@ def main():
print(path)
-def led(glow, core):
+def led(lens, hot):
image = Image.new("RGBA", (DRAWN, DRAWN))
pixels = image.load()
for py in range(DRAWN):
@@ -104,12 +107,13 @@ def led(glow, core):
for px in range(DRAWN):
x = (px - CENTRE) / CENTRE
r = math.hypot(x, y)
- if r < LED_CORE:
- colour = core
- else:
- strength = LED_GLOW_PEAK * math.exp(-(r - LED_CORE) / LED_GLOW) * (1.0 - ramp(0.8, 1.0, r))
- colour = tuple(int(c * strength) for c in glow)
- pixels[px, py] = colour + (max(colour),)
+ lit = ramp(LED_HOT, LED_HOT + 0.08, r)
+ colour = tuple(h + (l - h) * lit for h, l in zip(hot, lens))
+ bezel = ramp(LED_LENS - 0.02, LED_LENS + 0.02, r)
+ colour = tuple(int(c + (b - c) * bezel) for c, b in zip(colour, LED_BEZEL))
+ alpha = 1.0 - ramp(LED_BEZEL_OUT - 0.04, LED_BEZEL_OUT + 0.04, r)
+ alpha *= 1.0 - (1.0 - LED_BEZEL_ALPHA) * bezel
+ pixels[px, py] = colour + (int(255 * alpha),)
return image