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.

feat(gameclient): order lines off also hides the target marker and click ring

Olcay Seygan3693c4abe25c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3592f382d..0afe10a80 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -830,7 +830,7 @@ found and fixed, EA's own, not port damage.**
- How far the pointer travels before a click becomes a drag is yours to set. Drag Threshold on Options > Controls runs from 2 to 50 pixels, and the game's own value was 25. Raise it if selection boxes start by accident, lower it if your drags are read as clicks.
- An isometric camera, on Options > Controls. It looks at the battlefield from far off through a narrow lens, so a tank at the top of the screen is drawn the same size as one at the bottom and a base reads like a city-builder's plan instead of shrinking into the distance. It buys no extra sight. The normal camera's corners, edges and centre are laid over the isometric screen as closely as a flat picture allows, hills and ultrawide screens included: the normal camera still sees a little more at the far corners and the isometric one the same amount more at the near corners, because a perspective view is wider at the back than at the front and an isometric one is not. Pan across a ridge and the picture holds its size and its angle; it does not rise and dip with the ground under it. Campaign cinematics are filmed with the normal camera whatever the box says, and the isometric view comes back when the black bars go. They are shot from ten feet off the ground looking up at a rocket leaving its pad or a skyline, and the isometric camera turned each of those shots into a view from above of somewhere else: the picture lurched sideways every time the shot tilted, and a low shot ran off the edge of the map into a white screen. With the box ticked, USA 1's opening now plays the way it does without it. You still turn and zoom it the way you always did, and the box takes effect the moment you tick it, mid-match included.
- Press V, or the move button, then drag the left button, or just hold Shift and drag, and you draw a line: the selection spreads itself evenly along it, in the order the units already stand, so a column arrives as a firing line instead of a queue. While you drag, it is drawn as a smooth curve through the points the order carries; it used to be a jagged chain of short straight pieces. It is the line you actually drew, curves and all, however far you keep drawing it: a long sweep used to give up partway through and finish as one straight run to the cursor, and now it holds its shape to the end. Letting go over the sidebar finishes the order rather than leaving the line stuck to the cursor. A line pulled up past the horizon into the sky ends where the ground does: the stretch over the sky used to land in one corner of the map, and the units whose stations fell on it walked off there. A soldier riding in a transport or sitting in a bunker gets no station on a move or attack-move line, as a plain click has always left him where he is, so the units that can walk share the whole line instead of leaving gaps where the riders were counted. Draw the line with the left button while attack move is armed and the whole line is an attack move: artillery spread across a front, each gun firing on what walks into it, instead of one clump on one spot. Guard draws the same way. Every line, and the attack circle, is drawn with the button a click on the ground moves your units with. In the default mouse that is the left, and the right button's drag stays the camera. Under the Alternate Mouse Setup it is the right: a right drag with a key armed, Shift or Ctrl held draws the line or the circle, a plain right drag still scrolls the map, and the left drag is the selection box whatever is held. Without an order armed a left drag in the default mouse is the selection box it always was. Armed with attack instead, every unit fires on its own station along the line, which is a barrage laid across a ridge in one drag. `FormationDrag = no` in Options.ini turns the line off if you would rather an armed drag did nothing.
-- Selected units draw a line to wherever they are going, and it looks like a building's rally point: EA's blue rally line, with the rally flag in your colour planted on the ground they are headed for. A selected factory shows that one flag at the rally you set; a second disc used to sit at the door as well, so the path around the building read as two destinations. Every order draws one: move, attack move, attack, force fire, ground fire, enter, dock, repair, heal, capture, hack, guard, a waypoint path. An order aimed at something rather than somewhere, a tank to kill, a building to shoot, take or climb into, a unit to guard, ends on the line's joint instead of a flag, a small disc sitting just over the target and riding along with it while it drives, so a flag never stands on a tank. A shift list runs one line through all its stops, a joint on each and the flag on the last bit of ground. With order lines on, that last point gets a joint under its flag as well, so the end of the line reads the same as every stop before it. Units standing together and headed the same way share one thread, from the middle of the knot to the middle of where they are going, so twenty tanks sent across the map draw one line instead of twenty laid on top of each other; a selection spread over the map draws one per knot, and a flank sent on its own still shows. An angry mob draws one thread for the whole mob, not one per rioter. An attack move and a shot at the ground both point at the spot you clicked: the attack move's thread used to wander off to whichever free ground each unit was steering for, and ground fire pointed at the middle of the nearest map cell. An attack move stays pink from start to finish, too. A unit that stopped to fight used to swing its thread onto the enemy it was fighting, and only swung it back to your destination once the enemy was dead. It is not a flash at the moment of the order: the line is asked of the unit every frame, so it lasts until the unit gets there, changes its mind or leaves your selection, and it shows on the formation line while you are still drawing it. A unit that has walked off the edge of the screen still draws its line, which is how you see where the half of your army you cannot see is headed. The animated ring the ground used to sprout wherever you clicked is gone: it flashed for a second and told you nothing the flag on the destination does not, and the flag stays for as long as the order does. Aircraft draw their thread from the click, not from the moment they leave the runway. A plane parked on its airfield answers an order by starting its takeoff and puts the order itself aside until the wheels are up, so the taxi and the climb, which is exactly the stretch where you are wondering whether the strike went out at all, used to show nothing.
+- Selected units draw a line to wherever they are going, and it looks like a building's rally point: EA's blue rally line, with the rally flag in your colour planted on the ground they are headed for. A selected factory shows that one flag at the rally you set; a second disc used to sit at the door as well, so the path around the building read as two destinations. Every order draws one: move, attack move, attack, force fire, ground fire, enter, dock, repair, heal, capture, hack, guard, a waypoint path. An order aimed at something rather than somewhere, a tank to kill, a building to shoot, take or climb into, a unit to guard, ends on the line's joint instead of a flag, a small disc sitting just over the target and riding along with it while it drives, so a flag never stands on a tank. A shift list runs one line through all its stops, a joint on each and the flag on the last bit of ground. With order lines on, that last point gets a joint under its flag as well, so the end of the line reads the same as every stop before it. Units standing together and headed the same way share one thread, from the middle of the knot to the middle of where they are going, so twenty tanks sent across the map draw one line instead of twenty laid on top of each other; a selection spread over the map draws one per knot, and a flank sent on its own still shows. An angry mob draws one thread for the whole mob, not one per rioter. An attack move and a shot at the ground both point at the spot you clicked: the attack move's thread used to wander off to whichever free ground each unit was steering for, and ground fire pointed at the middle of the nearest map cell. An attack move stays pink from start to finish, too. A unit that stopped to fight used to swing its thread onto the enemy it was fighting, and only swung it back to your destination once the enemy was dead. It is not a flash at the moment of the order: the line is asked of the unit every frame, so it lasts until the unit gets there, changes its mind or leaves your selection, and it shows on the formation line while you are still drawing it. A unit that has walked off the edge of the screen still draws its line, which is how you see where the half of your army you cannot see is headed. EA's animated ring still flashes on the ground where you click, and goes with the lines when Order Lines is off. Aircraft draw their thread from the click, not from the moment they leave the runway. A plane parked on its airfield answers an order by starting its takeoff and puts the order itself aside until the wheels are up, so the taxi and the climb, which is exactly the stretch where you are wondering whether the strike went out at all, used to show nothing.
- A unit standing guard draws its marker on the ground it is guarding. A guard order clears the unit's goal on the way in, so every guard marker used to sit in the bottom left corner of the map with a thread running the whole way across it, whatever the unit was actually watching.
- A is attack and D is attack move, each arming the next order click. A click on the ground with A held down is a shot at that ground, on your own tank a shot at your own tank, and the mode drops again the moment the order goes out, so nothing stays armed behind your back. The click keeps your group, too: an attack click that was not a drag used to run the same deselect an ordinary left click runs, so the order arrived a moment after the units it was meant for had been dropped. Both orders are aimed with the left button, the way a special power is, and a right click puts the key down again without giving any order. Holding ctrl no longer forces fire: A is the one way to shoot the ground, and ctrl on a move is only the shared pace. The two keys turn each other off, and the letters they took were sitting on grid commands that moved. With A armed, pointing at something nothing in your selection can shoot shows the game's can't-do-that pointer: a Sentry Drone before its gun is researched has no weapon at all, and the pointer used to look ready while the click did nothing.
- G is guard, armed the same way and aimed with the same left button. A left click posts the selection on that spot: they hold it, shoot what walks into range and do not chase it off the post you put them on. G looks the way Zero Hour's own guard button always looked: the targeting cross, with the guard range laid on the ground under it. Roll the mouse wheel while G is armed and the circle grows or shrinks before you click, from half the unit's own range out to 500, and the whole group then guards that one circle; leave the wheel alone and the click is the guard Zero Hour always had. Only the ring changes size: the shield in the middle stays as it is, where the old picture stretched it with the ring. The guard button on the command bar arms the same key, so it clicks and drags the same way. Drag the left button with G armed and they post along the line you draw, one unit per station, the way an attack move line spreads them, which is how a hill or a bridge approach gets covered in one gesture instead of a click per tank. A right click puts the key down again. Hold position, which posts every unit on the spot it is already standing on, has moved to H.
@@ -1823,7 +1823,7 @@ The whole HUD is on the hardware. Four colours carry it, and they mean the same
- The promotion screen closes when you press its key again, however fast you press it. The screen fades in, and the fade drives the window itself for several frames either way - so a second press during the fade read the screen as still shut and opened it again, and a press just after it was closed was undone by the fade's next frame.
- The command bar stops changing under you while you are using it. With nothing selected the bar shows one of your builders so you can place a structure without picking a dozer first, and it showed whichever one happened to be idle - so a dozer finishing a building on the far side of the base took the bar over, dropping a half-typed build hotkey and taking the structure off your cursor. The builder you are working with keeps the bar.
- The command bar's artwork moves with the command bar. Minimising it slid the buttons off the bottom of the screen and left the metal they sit on painted over the battlefield; the same painting stood still through the slide the bar makes when a match opens. It travels with the bar and goes with it.
-- The lines from your selection to where it is headed can be switched off. Options > Interface has an Order Lines box, on by default. Off, a unit sent to one place shows no line to it, only the marker on the spot. A shift queue and a waypoint path keep their lines, stop to stop, and a building's rally line stays too: those are plans you are still reading, and with the box off v3.0.0 took their lines away as well. The line you draw while dragging a formation still shows, because that one is the order being given. It changes the moment you press Accept.
+- The lines from your selection to where it is headed can be switched off. Options > Interface has an Order Lines box, on by default. Off, a unit sent to one place shows nothing: no line to it, no marker on the spot or on the tank or building it was sent at, and no ring flashing on the ground where you clicked. A shift queue and a waypoint path keep their lines, stop to stop, and a building's rally line stays too: those are plans you are still reading, and with the box off v3.0.0 took their lines away as well. The line you draw while dragging a formation still shows, because that one is the order being given. It changes the moment you press Accept.
- Zoom to cursor is a box on Options > Controls again, in Classic and Reforged, and starts unticked: the wheel zooms on the middle of the screen, as it did in 1.04, until you ask for the cursor. A tick saved while it defaulted on does not carry over. It also stopped fighting you. The camera corrected itself a frame after each step of the zoom, so the ground slid off the cursor and was pulled back the whole way in, and the last pull landed after the zoom had finished, as a small jump towards the cursor. And a wheel spun over a spot with no ground under it, out past the edge of the map, threw the camera to the corner of the map. The ground under the cursor stays under it on every frame now, and a spot with no ground zooms on the middle of the screen.
- Scrolling keeps up with the zoom. The camera moved the same distance over the ground at every height, so right down on the ground the map flew past and from the farthest zoom it crawled, ten times slower across the screen, and turning the scroll speed up hardly showed. The pace now follows the zoom: where a map opens it is exactly what it was, zoomed out it covers ground as fast as the picture shows it, and the scroll speed slider sets that pace at every height. Arrow keys, the screen's edges and a right drag all go by it, in Classic and Reforged alike.
- Orders land where you clicked when the camera is right down on the ground. Zoomed all the way in, a right click sent the units to the corner of the map instead of to the spot under the pointer, and the marker and the line went there with them. The game works out what you clicked on by firing a line from the camera at the ground, and that line was thrown away whenever the camera itself had dropped below the height of the tallest hill on the map - so it went wrong on hilly maps first and stayed fine on flat ones, which is why it looked random.
diff --git a/GeneralsMD/Code/Data/Patch.str b/GeneralsMD/Code/Data/Patch.str
index cb08e8bc6..7e7c14088 100644
--- a/GeneralsMD/Code/Data/Patch.str
+++ b/GeneralsMD/Code/Data/Patch.str
@@ -884,7 +884,7 @@ GUI:OrderLines
END
TOOLTIP:OrderLines
-"A line from each selected unit to where it is going, and on through every point it has queued. Off, the markers on those points stay."
+"A line from each selected unit to where it is going, and on through every point it has queued. Off, a single order draws no line and no marker and a click leaves no ring on the ground; a queued route keeps its line and markers."
END
GUI:AircraftAltitudeLine
diff --git a/GeneralsMD/Code/Data/Russian/Generals.str b/GeneralsMD/Code/Data/Russian/Generals.str
index 9fd6e8afd..bbdd60b94 100644
--- a/GeneralsMD/Code/Data/Russian/Generals.str
+++ b/GeneralsMD/Code/Data/Russian/Generals.str
@@ -16334,7 +16334,7 @@ GUI:OrderLines
END
TOOLTIP:OrderLines
-"Линия от каждого выбранного юнита к цели и далее через все точки в очереди. Выключено: маркеры на этих точках остаются."
+"Линия от каждого выбранного юнита к цели и далее через все точки в очереди. Выключено: одиночный приказ без линии и маркера, и щелчок не оставляет кольца на земле; маршрут в очереди сохраняет и линию, и маркеры."
END
GUI:PlayerColors
diff --git a/GeneralsMD/Code/Data/Turkish/Generals.str b/GeneralsMD/Code/Data/Turkish/Generals.str
index 42b1f33a2..8fee7ebe7 100644
--- a/GeneralsMD/Code/Data/Turkish/Generals.str
+++ b/GeneralsMD/Code/Data/Turkish/Generals.str
@@ -15386,7 +15386,7 @@ GUI:OrderLines
END
TOOLTIP:OrderLines
-"Seçili her birimden gittiği yere, oradan da sıraya aldığı her noktaya bir çizgi çeker. Kapalıyken çizgiler gider, o noktalardaki işaretler kalır."
+"Seçili her birimden gittiği yere, oradan da sıraya aldığı her noktaya bir çizgi çeker. Kapalıyken tek bir emir çizgisiz ve işaretsiz kalır, tıklanan yerde halka da çıkmaz; sıraya alınmış rota çizgisini ve işaretlerini korur."
END
GUI:AircraftAltitudeLine
diff --git a/GeneralsMD/Code/Data/Ukrainian/Generals.str b/GeneralsMD/Code/Data/Ukrainian/Generals.str
index d8bdfaae9..8c029949c 100644
--- a/GeneralsMD/Code/Data/Ukrainian/Generals.str
+++ b/GeneralsMD/Code/Data/Ukrainian/Generals.str
@@ -16334,7 +16334,7 @@ GUI:OrderLines
END
TOOLTIP:OrderLines
-"Лінія від кожного вибраного підрозділу до місця призначення і далі крізь кожну точку в черзі. Вимк. — маркери на цих точках лишаються."
+"Лінія від кожного вибраного підрозділу до місця призначення і далі крізь кожну точку в черзі. Вимк. — одиночний наказ без лінії та маркера, і клік не лишає кільця на землі; маршрут у черзі зберігає і лінію, і маркери."
END
GUI:PlayerColors
diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
index 86e597653..4207e5173 100644
--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp
@@ -5329,6 +5329,10 @@ void InGameUI::markNextOrderQueued( OrderQueueMode mode )
//-------------------------------------------------------------------------------------------------
void InGameUI::createMoveHint( const GameMessage *msg )
{
+ // Order Lines off takes away everything drawn where an order lands, this ring included
+ if( !TheGlobalData->m_showOrderLines )
+ return;
+
if( getSelectCount() == 1 )
{
Drawable *draw = getFirstSelectedDrawable();
diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp
index 2d8466c44..c2d9853ef 100644
--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp
+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp
@@ -258,8 +258,7 @@ void W3DWaypointBuffer::takeReadsForRender(void)
// let go, so the white duplicate is gone.
//
// Every order the selection is on is drawn the way a building's rally point is drawn: this
- // line, the puck on each point short of the end and on any unit or building it is aimed at, and
- // the rally flag on the last bit of ground (a drawable of its own, InGameUI::updateOrderFlags).
+ // line and a puck on each of its points, on the ground or on any unit or building it is aimed at.
// The hints are rebuilt off the units every frame, so a puck on a target follows it.
{
const std::vector<InGameUI::OrderHint>& hints = TheInGameUI->getOrderHints();
@@ -274,18 +273,15 @@ void W3DWaypointBuffer::takeReadsForRender(void)
points[ 0 ].Set( it->from.x, it->from.y, max( it->from.z, TheTerrainLogic->getGroundHeight( it->from.x, it->from.y ) ) );
points[ 1 ].Set( it->to.x, it->to.y, max( it->to.z, TheTerrainLogic->getGroundHeight( it->to.x, it->to.y ) ) );
- // Order Lines off in the options takes away the line of a plain one-point order and leaves
- // its point. A unit with more than one place to go (a shift queue, a waypoint path; step
- // is numbered then) keeps its threads, since that list is the thing being planned
- const Bool lineShown = TheGlobalData->m_showOrderLines || it->step > 0
- || it->kind == InGameUI::ORDER_HINT_WAYPOINT;
- if( lineShown )
- record( DRAW_LINE, TRUE, 2, points );
-
- // with the line drawn, its end wears the puck the joints between orders do
- if( it->mark == InGameUI::ORDER_MARK_JOINT
- || ( lineShown && it->mark == InGameUI::ORDER_MARK_FLAG ) )
- record( DRAW_PUCK, TRUE, 1, &points[ 1 ] );
+ // Order Lines off in the options takes away a plain one-point order's line and the puck at
+ // its end, on ground or on the unit it is aimed at. A unit with more than one place to go
+ // (a shift queue, a waypoint path; step is numbered then) keeps its threads and pucks,
+ // since that list is the thing being planned
+ if( !TheGlobalData->m_showOrderLines && it->step == 0 && it->kind != InGameUI::ORDER_HINT_WAYPOINT )
+ continue;
+
+ record( DRAW_LINE, TRUE, 2, points );
+ record( DRAW_PUCK, TRUE, 1, &points[ 1 ] ); // the end wears the puck the joints between orders do
}
// the lines stay queued: the rally and placement pucks below would flush them into the
// terrain pass, under the buildings (see queueLine)