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(w3ddevice): fainter, thinner build placement grid

Olcay Seygan64dfc44a6007
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a503f99d5..cb3695b3b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,6 +30,7 @@ found and fixed — EA's own, not port damage.**
- Your production queue stands on the console over your selection, five to a row, each row only as long as what is in it. The event feed runs down from the menu key in the top left corner, and the chat sits under it.
- Point at the attack, hold position or move key and a card says what it does, in English or Turkish. Those three are painted onto the grid rather than given to a unit, so the game had no card for them and showed nothing. The card stands on top of the command bar like every other button's.
- HUD Size grows the console from its middle, and on a narrow screen it stops at the size that still fits.
+- The grid under a building you are placing is fainter and its lines thinner, and the red squares where nothing can stand are lighter, so the ground under them shows through. Untick grid placement on the Controls page and the lines go altogether.
## Groups attack-move at their own speed
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
index 960e10743..5c37a22d3 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp
@@ -746,7 +746,7 @@ void W3DInGameUI::drawBuildGrid( void )
enum { GRID_CELLS = GRID_RADIUS * 2 + 1, GRID_POINTS = GRID_CELLS + 1 };
// half the width of a painted line, in world units - a cell is PLACEMENT_CELL (10) across
- const Real LINE_HALF_WIDTH = 0.45f;
+ const Real LINE_HALF_WIDTH = 0.3f;
// the ground is sampled at the line, so a line running across a slope would sink into the hill
// on one side; lifting the whole sheet a hair keeps it out of the dirt without floating
const Real GRID_LIFT = 0.35f;
@@ -791,8 +791,9 @@ void W3DInGameUI::drawBuildGrid( void )
GroundOverlayQuads &quads = theGroundOverlayQuads;
- // the lines themselves, one quad per cell edge so they follow the ground over every bump
- const Real LINE_ALPHA = 0x58;
+ // the lines themselves, one quad per cell edge so they follow the ground over every bump. Faint
+ // on purpose: players said the brighter grid hid the ground they were trying to read
+ const Real LINE_ALPHA = 0x26;
for( iy = 0; drawLines && iy < GRID_POINTS; ++iy )
{
for( ix = 0; ix < GRID_POINTS; ++ix )
@@ -823,7 +824,7 @@ void W3DInGameUI::drawBuildGrid( void )
// and a red wash over every cell a structure cannot stand on. Filling the cell reads at a
// glance where an X drawn in thin lines did not.
- const Real BLOCKED_ALPHA = 0x44;
+ const Real BLOCKED_ALPHA = 0x30;
for( iy = 0; iy < GRID_CELLS; ++iy )
{
for( ix = 0; ix < GRID_CELLS; ++ix )