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
fix(gameengine): nine-deep queue, stealth fade, one rally
Olcay Seygan90d6bcba97a0
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 69e34399c..6ddb604c3 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -53,7 +53,7 @@ found and fixed — EA's own, not port damage.**- The choice between a Classic and a Reforged interface is gone. There is one, laid out the way Zero Hour shipped, and the orders Reforged added now live on the keys you already know: A attack-moves, holding Ctrl fires on whatever is under the cursor as it did in 2003, a guard order can cover a patch of ground instead of one spot, and orders queue up one after another. Everything your base is building stands on the screen as a line of text each, the six closest to done first and "+N more" for the rest. Superweapon countdowns are listed the same way, up to eighteen. Both lists are in bold type, the build list in white and each countdown in its owner's colour. The promotion screen no longer darkens the battlefield behind it. Whether the right button gives orders, or the left as in 1.04, is a setting in the launcher.- An attack move and a Ctrl attack fire on the left click in every mouse setup. With the right button giving orders, A then a right click attack-moved, and Ctrl fired only on a right click, so the same hands did different things depending on one checkbox. Now A, or Ctrl held, then a left click is the attack everywhere, and a right click with A armed puts the key down without an order. Ctrl with a right click gives none. Plain orders stay on whichever button your setup gives them.-- Buildings select together again, which the one interface had taken away. Shift-click them, drag a box over them, or double-click one for every building of its kind on the screen; select four War Factories and each tank you click goes to whichever has the shortest queue. A building and a unit still never share a selection.+- Buildings select together again, which the one interface had taken away. Shift-click them, drag a box over them, or double-click one for every building of its kind on the screen; select four War Factories and each tank you click goes to whichever has the shortest queue. Double-click a unit and every one of that kind whose feet sit in the picture is taken, including the ones sitting past the camera's far clip that used to be skipped. A building and a unit still never share a selection.- Formation lines are back for everyone. With move, attack move or guard armed, a left drag spreads the selection along the line you draw again; since the one interface it drew a selection box instead, because the line was switched off for the Classic mouse that every player now runs. A drag with no order armed is still the selection box.- Every key is yours to move. The launcher's Hotkeys page draws the command bar of every building and unit each general can field, cameos and letters as the game shows them, and a click and a keypress gives any button a new letter or none. Two buttons on one bar that would share a letter are marked before you play. The keyboard commands are there too, from bookmarks and team keys to the camera, along with the ones Zero Hour never bound: select every fighting unit, vehicle or aircraft, every barracks, war factory or airfield, the next idle worker or unit, pause, the general's promotions, the three signals to your allies and the general's powers. Your keys are yours alone; the other players in a match keep theirs, and a match never refuses you for them. Every mod you install brings its own generals to the page, ShockWave's fifteen next to Zero Hour's thirteen, and a key you give a ShockWave button stays with ShockWave.- Some keys now mean one thing on every bar: A attack move, S stop, G guard, Y rally point, V evacuate, N sell, C combat drop, and H for land mines, camo netting and the GLA worker's switch to fake buildings. Sell sits on its own key, so emptying a bunker can never sell it. The 188 buttons Zero Hour had put on one of those letters take another, kept off the grid keys where the bar leaves room (the Avenger is J now), and no bar gained a clash doing it.@@ -352,11 +352,11 @@ 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 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. 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 is drawn with the left button, the one armed orders are aimed with, and the right button never draws one: its drag is the camera. Without an order armed a left drag 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. 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. 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.- 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, and the mouse wheel still zooms the camera. 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.-- With A armed, or with Ctrl held down, hold the left button and drag a circle instead: the enemies you can see inside it are split across the units that can shoot, as evenly as the numbers allow, in the order both sides stand around the circle. The tank on the left of your group takes the enemy on the left of theirs. Ten of yours against three of theirs put four guns on one and three on each of the others. Three of yours against ten of theirs each take a run of three or four and work down that run. One enemy, and every selected gun takes it. When a unit's target dies the next of its own goes out the same frame, so a strike group clears a circle without you clicking once per tank. It moves on from a target the group has stopped working on, too, rather than only from a dead one: something none of them can reach or hurt used to sit at the head of the list and hold every other target behind it for the rest of the match. That list is the same queue a shift-clicked attack builds, so you can see it: every target still owed has its own thread and marker, in the order they will be taken, instead of one line to whatever is being shot at this second. Hold shift while you draw the circle and its targets go on the end of what the group is already working through; draw it without shift and the circle replaces the lot. The circle's rim is red and the ground inside it is washed the same red while you drag it, painted on the map rather than over it, so it runs up the hills inside the circle and your own tanks stand on top of it. Any order you give by hand ends the list. Losing a unit does not: the list belongs to the group that was told and carries on with whoever is left, which is worth saying because for a while it did not, and one tank dying threw away every target still owed. Running out of ammo does not cost you the list either. A flight that empties its racks flies home, lands, rearms and comes back to the target it left, and the queue waits for it instead of counting the trip as the group giving up: a circle drawn for four planes used to be empty by the time they were back in the air, one entry lost every two seconds they were away. The threads stay on the ground for the whole trip, too. A plane flying home has no target and no order to read, so the list it was still holding used to vanish off the map the moment it turned for base and reappear only when it was shooting again, which looks exactly like the list being thrown away. What the circle picks up is what you can shoot: a shell or a missile crossing it is on the enemy's side like everything else and used to go on the list as a target, costing the group a two second stall on something that was about to stop existing. A target that has driven into the shroud since you picked it keeps its place in the list but stops drawing its thread, so the line cannot be used to trace it through the fog. An attack-move queued behind other orders keeps the force fire it was given rather than losing it when the attack key drops. A stroke drawn across enemies splits them across the units that can shoot, as evenly as the numbers allow, in the order both sides stand along the stroke. The unit nearest the start takes the enemy nearest the start. Ten guns on three enemies put four on one and three on each of the others. Three guns on ten each work down a run of three or four. The whole group used to walk one list and pour every gun into each enemy in turn. Before that the line poured fire into the ground under it and hit whatever happened to be standing there. A stroke that crosses nobody still fires on the ground along it.+- With A armed, or with Ctrl held down, hold the left button and drag a circle instead: the enemies you can see inside it are split across the units that can shoot, as evenly as the numbers allow, in the order both sides stand around the circle. The tank on the left of your group takes the enemy on the left of theirs. Ten of yours against three of theirs put four guns on one and three on each of the others. Three of yours against ten of theirs each take a run of three or four and work down that run. One enemy, and every selected gun takes it. When a unit's target dies the next of its own goes out the same frame, so a strike group clears a circle without you clicking once per tank. It moves on from a target the group has stopped working on, too, rather than only from a dead one: something none of them can reach or hurt used to sit at the head of the list and hold every other target behind it for the rest of the match. That list is the same queue a shift-clicked attack builds, so you can see it: every target still owed has its own thread and marker, in the order they will be taken, instead of one line to whatever is being shot at this second. Hold shift while you draw the circle and its targets go on the end of what the group is already working through; draw it without shift and the circle replaces the lot. The circle's rim is red and the ground inside it is washed the same red while you drag it, painted on the map rather than over it, so it runs up the hills inside the circle and your own tanks stand on top of it. The rim sits in the plane of the press, so a hill or a building under the cursor no longer jumps the circle every frame. Any order you give by hand ends the list. Losing a unit does not: the list belongs to the group that was told and carries on with whoever is left, which is worth saying because for a while it did not, and one tank dying threw away every target still owed. Running out of ammo does not cost you the list either. A flight that empties its racks flies home, lands, rearms and comes back to the target it left, and the queue waits for it instead of counting the trip as the group giving up: a circle drawn for four planes used to be empty by the time they were back in the air, one entry lost every two seconds they were away. The threads stay on the ground for the whole trip, too. A plane flying home has no target and no order to read, so the list it was still holding used to vanish off the map the moment it turned for base and reappear only when it was shooting again, which looks exactly like the list being thrown away. What the circle picks up is what you can shoot: a shell or a missile crossing it is on the enemy's side like everything else and used to go on the list as a target, costing the group a two second stall on something that was about to stop existing. A target that has driven into the shroud since you picked it keeps its place in the list but stops drawing its thread, so the line cannot be used to trace it through the fog. An attack-move queued behind other orders keeps the force fire it was given rather than losing it when the attack key drops. A stroke drawn across enemies splits them across the units that can shoot, as evenly as the numbers allow, in the order both sides stand along the stroke. The unit nearest the start takes the enemy nearest the start. Ten guns on three enemies put four on one and three on each of the others. Three guns on ten each work down a run of three or four. The whole group used to walk one list and pour every gun into each enemy in turn. Before that the line poured fire into the ground under it and hit whatever happened to be standing there. A stroke that crosses nobody still fires on the ground along it.- Shift queues a guard as well, and it is where the line of orders stops. Hold shift with G armed and click, and the group takes up its post once it has finished everything queued in front of it: clear that ridge, then sit on it, in one set of clicks instead of standing over the fight waiting to give the last order. Nothing goes behind a guard, because a posted unit has no next place to be. The thread to the post is drawn in the guard colour like any other guard.- Shift queues an attack now, not only a move. A or F held down while you shift-click adds a force-attack or an attack-move to the line of orders a group is already holding, and it fires the moment the order in front of it is finished - a target dead, or nobody left chasing an attack-move point. The coloured thread that shows a queued order covers it too, so a queue of "go here, then attack that, then attack-move over there" reads as one continuous line in three colours. The game's own white waypoint markings, which used to draw over the same ground the moment shift went down, are gone - they only ever duplicated what the coloured thread already showed, and doing both left a queued attack sitting under two different pictures of itself.- The shift queue takes any mix of orders now and stays with the units you gave it to. Move, attack-move, attack a target, draw a formation line, then guard: hold shift, click them in whatever order you like, and the group works down the list by itself. Queue an army's whole route, select something else, go back to your base, and the army keeps going. Before, clicking anything else threw the list away. Each step also starts the moment the one before it is done. It used to wait for the order to travel to the other players and back, which on a 250ms connection was a quarter of a second standing still at every corner. The group keeps together: nobody starts the next order until everyone still alive has finished this one, so a column does not string out behind its fastest tank. Select part of a group and shift-click, and that part takes its own copy of the list with the new order on the end while the others carry on with theirs. Shift-click a group that is already on an ordinary move and the new point goes behind the move instead of replacing it.@@ -791,9 +791,9 @@ A third pass went through the generals' powers, promotions and unit abilities.- A unit still rolling out of its factory takes your orders. Click a tank the moment it appears and send it anywhere, or queue a route with shift: it drives out of the door first and then goes, instead of ignoring the click until it was clear. The order replaces the rally point. A dozer told to build the instant it leaves the Command Center used to drive straight from the door to the site, through the Command Center's walls; it comes out and goes round now.- An upgrade stays available if any selected building can still buy it.- One right click cancels one thing, counted the moment you press.-- A build button takes a batch: Shift queues five, Ctrl twenty, both together as many as the queue will hold and the bank will pay for. Right-click with the same keys and the same number comes back out. Ten tanks used to be ten clicks. How many are still coming is written in the corner of the button, half again bigger than the price and the countdown beside it and on a plate you can actually read it against: at the size the other markings wear, the one number you check in the middle of a fight was a smudge you had to look for.+- A build button takes a batch: Shift queues five, Ctrl twenty, both together as many as the queue will hold and the bank will pay for, and the queue holds nine. Shift on a barracks that already has eight coming used to push it to thirteen; it now fills the ninth slot and stops. Select several factories and the same nine-deep cap is counted per building, so a click never overfills one of them, and when every selected factory is full the build buttons go grey. A recorded match that queued past nine plays back differently. Right-click with the same keys and the same number comes back out. Ten tanks used to be ten clicks. How many are still coming is written in the corner of the button, half again bigger than the price and the countdown beside it and on a plate you can actually read it against: at the size the other markings wear, the one number you check in the middle of a fight was a smudge you had to look for.- Right-click a picture on the strip and that one order is cancelled and paid back, without walking the camera over to the building first. A build button greyed out because the bank is empty or the queue is full still takes the right click, so what is already queued on it can come back out.-- A factory builds a unit on repeat. Hold Ctrl and Alt and press the unit's key, or click its button, and a green pair of arrows starts turning in the button's corner: whenever the factory has nothing queued it orders another and pays for it, waiting for the money like a click would. Do it again to stop. Several units on repeat take turns in the order you put them on, each factory keeps its own, and with several factories selected one press sets them all. Losing the building that unlocks the unit takes it off the repeat; selling or losing the factory ends it. Right-click still takes queued units back out. A button whose unit is on repeat stays clickable when the bank is empty, so the repeat can always be stopped.+- A factory builds a unit on repeat. Hold Ctrl and Alt and press the unit's key, or click its button, and a green pair of arrows starts turning in the button's corner: whenever the factory has nothing queued it orders another and pays for it, waiting for the money like a click would. Do it again to stop. Only one unit is on repeat at a time: turning a second on takes the first off. Each factory keeps its own, and with several factories selected one press sets them all. Losing the building that unlocks the unit takes it off the repeat; selling or losing the factory ends it. Right-click still takes queued units back out. A button whose unit is on repeat stays clickable when the bank is empty, so the repeat can always be stopped.- Buying an upgrade for a group starts it in all of them.- The progress clock over a picture is steady at any frame rate.- A group's upgrade shows its progress, whichever building is paying for it.@@ -1463,10 +1463,10 @@ 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.-- Blasts throw fragments that smoke. Every explosion flings hot sparks into the air, each drawing a white line of smoke that arcs over and curves down. Where a shell, rocket or missile lands the spray opens back up the line it came in on, towards the gun that fired it, low for a tank shell and steeper for a diving rocket, so you can read where the fire came from. The bigger the blast, the higher and longer the fan: a Stinger or a rocket pod throws three short ones, a tank shell or a rocket four, a bomb, a heavy shell, a Scud or a building eight that climb several times a tank's length, and a nuke, a MOAB, a Daisy Cutter or a large building fourteen that arc over its own fireball and hang for nearly five seconds. A vehicle that blows up throws burning pieces that drag near-black smoke and bounce where they land, and the turret, wheels and plates it throws off trail smoke and flame too, then smoulder a moment on the ground. In a fight of seventeen tanks the screen held about 1400 particles where it held 890, peaking at 2159 of the 2500 limit; the fragments and their smoke are the first effects that limit and a lower detail setting drop, so a bigger fight keeps its explosions and loses some lines. What a weapon does is unchanged. Rather have the explosions as they always were? Explosion Debris Trails in the launcher's Options turns all of it off, for you alone: the other players in your match keep whatever they picked, and nobody's game falls out of step over it.+- Blasts throw fragments that smoke. The bigger explosions fling hot sparks into the air, each drawing a white line of smoke that arcs over and curves down. A Stinger, a rocket pod, a tank shell or a rocket used to throw them too, and a fight filled with them; they now show on a bomb, a heavy shell, a Scud or a building, eight that climb several times a tank's length, and on a nuke, a MOAB, a Daisy Cutter or a large building, fourteen that arc over its own fireball and hang for nearly five seconds. Where those land the spray opens back up the line it came in on, towards the gun that fired it. A vehicle that blows up throws burning pieces that drag near-black smoke and bounce where they land, and the turret, wheels and plates it throws off trail smoke and flame too, then smoulder a moment on the ground. In a fight of seventeen tanks the screen held about 1400 particles where it held 890, peaking at 2159 of the 2500 limit; the fragments and their smoke are the first effects that limit and a lower detail setting drop, so a bigger fight keeps its explosions and loses some lines. What a weapon does is unchanged. Rather have the explosions as they always were? Explosion Debris Trails in the launcher's Options turns all of it off, for you alone: the other players in your match keep whatever they picked, and nobody's game falls out of step over it.- A China mine field tells you what kind it is. EA's field had no model at all, only a soft white glint swelling and fading on each of its eight spots, so your own minefield looked like a patch of fireflies. Each mine is now marked by a small arming light that snaps on for a quarter of a second every second and a half, red on standard and cluster mines and blue on EMP mines, with a white-hot point and a dark rim that keep it readable on grass, sand or snow. No mine body is drawn on the ground, only the light. The enemy still sees nothing until he detects the field. 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 throws no earth, so you can tell which kind went off: it lights a blue ring across the ground, a crackle of blue sparks and a short blue flash at the spot; EA's flash grew until it washed the whole screen white for a fifth of a second. What a mine does is unchanged.- A base out of power looks out of power. A building that switches off when your power runs short, 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 like glass, not like ice. In 3.0 a camouflaged Rebel, a Pathfinder or Colonel Burton came out under a blue skin with bands running up it, which players rightly called ugly. The blue is gone: the ground behind him shows through his body in its own colours and bends, a slow lens that ripples along him and pulls harder at his outline, with a muted share of his own paint left in it. The bend is what you find him by: each face of him tips the ground behind it its own way, so his shape shows even on plain sand, and the bend never drops below a few pixels, and a cool haze that thickens at his outline makes a cloaked squad or a camouflaged base read at a glance at the zoom you play at, still as glass and without turning white. Up close a building's flat wall bends across its face. It moves slowly and never fizzes. He never turns solid, and the 2003 breathing of the fade is still there. His shadow fades with him, to between a quarter and a half of its strength as he breathes, where it used to lie on the ground at full strength and give him away before his body did; on Classic and the old renderer the shadow stays whole. When an enemy detector has found him, his whole body beats amber along with his edge, so a spotted building reads as spotted and does not just turn tan. On every renderer, a stealthed unit of yours no longer comes out solid whenever no building is on the screen: the game drew it a second time without its see-through. An enemy stealth unit your detector finds used to turn into a flat orange shape with no paint; now it shows as heat, its own shading run from dark red through orange to a warm yellow that stops short of white, so you can still tell a tank from a soldier and bright GLA paint keeps its detail, with a burning outline and a slow glow climbing it that flares on every sweep of the detector. The fine scan lines of 3.0 are gone, since zoomed out they broke into stripes. This is the default renderer; Classic and the old renderer keep the 2003 look for all of these.+- Your own stealthed units look like glass, not like ice. In 3.0 a camouflaged Rebel, a Pathfinder or Colonel Burton came out under a blue skin with bands running up it, which players rightly called ugly. The blue is gone: the ground behind him shows through his body in its own colours and bends, a slow lens that ripples along him and pulls harder at his outline, with a muted share of his own paint left in it. The bend is what you find him by: each face of him tips the ground behind it its own way, so his shape shows even on plain sand, and the bend never drops below a few pixels, and a cool haze that thickens at his outline makes a cloaked squad or a camouflaged base read at a glance at the zoom you play at, still as glass and without turning white. Up close a building's flat wall bends across its face. It moves slowly and never fizzes. He breathes solid at the top of the 2003 pulse and back to glass at the bottom, and a building going invisible or coming out of it fades instead of popping; an enemy a detector finds fades into heat the same way. His shadow fades with him, to between a quarter and a half of its strength as he breathes, where it used to lie on the ground at full strength and give him away before his body did; on Classic and the old renderer the shadow stays whole. When an enemy detector has found him, his whole body beats amber along with his edge, so a spotted building reads as spotted and does not just turn tan. On every renderer, a stealthed unit of yours no longer comes out solid whenever no building is on the screen: the game drew it a second time without its see-through. An enemy stealth unit your detector finds used to turn into a flat orange shape with no paint; now it shows as heat, its own shading run from dark red through orange to a warm yellow that stops short of white, so you can still tell a tank from a soldier and bright GLA paint keeps its detail, with a burning outline and a slow glow climbing it that flares on every sweep of the detector. The fine scan lines of 3.0 are gone, since zoomed out they broke into stripes. This is the default renderer; Classic and the old renderer keep the 2003 look for all of these.- A hidden base no longer burns in plain view. The fire and smoke on a stealthed building or unit, damage flames and chimney smoke alike, kept drawing for the enemy while the building itself was invisible, so a burning Stealth General base under Camo Netting stood out as a column of black smoke on an empty patch of ground. The enemy now sees none of it until a detector finds the building, and then all of it. On your own side the flames and smoke go faint with the building and breathe with it, the fire a little stronger than the smoke, so they no longer sit at full strength beside the glass. This holds on every renderer, and the smoke's shadow and the light its fire throws on nearby smoke go with it.- 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.- Toxin, anthrax and radiation pools lie on the ground. A pool is a carpet of puddle pictures spread up to 140 paces from where the shell or the spray came down, and every one of them was drawn dead flat at the height of that one spot: on a hillside the uphill half of the pool disappeared into the slope and the downhill half hung in the air above it. Each puddle now bends over the ground underneath it, on both renderers, and a pool on a bridge stays on the deck. The pool also holds still. It used to throb twice a second, because every half second the pool's poison fired a fresh batch of puddles that swelled out of black to full green and back to black in two seconds, each batch somewhere new. Now it comes up in half a second, stays one pool at full colour for as long as it does damage, and fades over its last three seconds, or over three seconds from the moment the fog of war closes over it. It is not frozen, though: each puddle fades down and back up on its own beat, so the surface shimmers like something liquid while the pool as a whole never pulses. Four Scud warheads landing on one spot used to stack into a white-hot blotch in the middle; overlapping pools now share their light and the middle stays toxin green. The ground under it takes on its colour, green for toxin and the anthrax colours for anthrax, so it looks spilled rather than shone onto the grass. China's radiation keeps its orange but glows instead of browning the grass, which made it look like a scorch mark, and small bubbles swell out of it and pop. A nuke's radiation lies on the hillside as a pool from three seconds after the blast, where its first ten seconds used to be flat squares cutting into the slope.diff --git a/GeneralsMD/Code/Data/INI/FXListReforged.ini b/GeneralsMD/Code/Data/INI/FXListReforged.iniindex 20a7d8289..7e0433aea 100644--- a/GeneralsMD/Code/Data/INI/FXListReforged.ini+++ b/GeneralsMD/Code/Data/INI/FXListReforged.ini@@ -80,11 +80,6 @@ End; ----------------------------------------------FXList WeaponFX_GenericTankShellDetonation- ParticleSystem- Name = ReforgedBlastShards- OrientToObject = Yes- RotateY = -55- EndSoundName = ExplosionRocketBuggyMissileEnd@@ -810,9 +805,6 @@ End; ----------------------------------------------FXList FX_BarrelDeathExplosion- ParticleSystem- Name = ReforgedBlastShardsSmall- EndParticleSystemName = BarrelExplosionEnd@@ -888,11 +880,6 @@ End; ----------------------------------------------FXList WeaponFX_ComancheAntiTankMissileDetonation- ParticleSystem- Name = ReforgedBlastShards- OrientToObject = Yes- RotateY = -55- EndSoundName = ExplosionRocketBuggyMissileEnd@@ -912,11 +899,6 @@ End; ----------------------------------------------FXList WeaponFX_ComancheRocketPodRocketDetonation- ParticleSystem- Name = ReforgedBlastShardsSmall- OrientToObject = Yes- RotateY = -55- EndSoundName = ExplosionRocketBuggyMissileEnd@@ -936,11 +918,6 @@ End; ----------------------------------------------FXList WeaponFX_RocketBuggyMissileDetonation- ParticleSystem- Name = ReforgedBlastShards- OrientToObject = Yes- RotateY = -55- EndSoundName = ExplosionRocketBuggyMissileEnd@@ -1071,11 +1048,6 @@ End; ----------------------------------------------FXList WeaponFX_TomahawkMissileDetonation- ParticleSystem- Name = ReforgedBlastShards- OrientToObject = Yes- RotateY = -55- EndSoundName = ExplosionRocketBuggyMissileEnd@@ -1095,11 +1067,6 @@ End; ----------------------------------------------FXList WeaponFX_HumveeMissileDetonation- ParticleSystem- Name = ReforgedBlastShardsSmall- OrientToObject = Yes- RotateY = -55- EndSoundName = ExplosionRocketBuggyMissileEnd@@ -1257,11 +1224,6 @@ End; ----------------------------------------------FXList WeaponFX_StingerMissileDetonation- ParticleSystem- Name = ReforgedBlastShardsSmall- OrientToObject = Yes- RotateY = -55- EndSoundName = ExplosionRocketBuggyMissileEnd@@ -1356,9 +1318,6 @@ End; ----------------------------------------------FXList WeaponFX_SuicideDynamitePackDetonation- ParticleSystem- Name = ReforgedBlastShards- EndParticleSystemName = CarpetBombExplosionShockwaveEnd@@ -1385,9 +1344,6 @@ End; ----------------------------------------------FXList WeaponFX_SuicideDynamitePackDetonationPlusFire- ParticleSystem- Name = ReforgedBlastShards- EndSoundName = TerroristSuicidesEnd@@ -1423,9 +1379,6 @@ End; ----------------------------------------------FXList WeaponFX_TNTStickyBombDetonation- ParticleSystem- Name = ReforgedBlastShards- EndParticleSystemName = LargeStructureExplosionShockwaveEnd@@ -1455,9 +1408,6 @@ End; ----------------------------------------------FXList FX_BoobyTrapExplosion- ParticleSystem- Name = ReforgedBlastShards- EndParticleSystemUseCallersRadius = Yes ; Radius of emission set by radius of damage.Name = BoobyTrapSmoke@@ -1791,11 +1741,6 @@ End; ----------------------------------------------FXList FX_A10ThunderboltMissileExplosion- ParticleSystem- Name = ReforgedBlastShards- OrientToObject = Yes- RotateY = -55- EndParticleSystemName = CarpetBombExplosion@@ -2831,11 +2776,6 @@ End; ----------------------------------------------FXList WeaponFX_DEMOGENRocketBuggyMissileDetonation- ParticleSystem- Name = ReforgedBlastShards- OrientToObject = Yes- RotateY = -55- EndSoundName = ExplosionRocketBuggyMissileEnd@@ -2858,11 +2798,6 @@ End; ----------------------------------------------FXList WeaponFX_DEMOGenericTankShellDetonation- ParticleSystem- Name = ReforgedBlastShards- OrientToObject = Yes- RotateY = -55- EndSoundName = ExplosionRocketBuggyMissileEnd@@ -2944,11 +2879,6 @@ End; ----------------------------------------------FXList WeaponFX_DEMORocketBuggyMissileDetonation- ParticleSystem- Name = ReforgedBlastShards- OrientToObject = Yes- RotateY = -55- EndSoundName = ExplosionRocketBuggyMissileEnd@@ -3009,9 +2939,6 @@ End; ----------------------------------------------FXList WeaponFX_DemoSuicideDynamitePackDetonation- ParticleSystem- Name = ReforgedBlastShards- EndParticleSystemName = RedDonuteCloudEnd@@ -3044,9 +2971,6 @@ End; dozen shells or more. ExplosionArtilleryBarrage is recorded for it, allows three voices and was; never named. Everything else is EA's.FXList FX_ArtilleryBarrage- ParticleSystem- Name = ReforgedBlastShards- EndViewShakeType = SUBTLEEnd@@ -3090,9 +3014,6 @@ End; ----------------------------------------------FXList WeaponFX_DemoSuicideDynamitePackDetonationPlusFire- ParticleSystem- Name = ReforgedBlastShards- EndSoundName = TerroristSuicidesEnd@@ -3148,9 +3069,6 @@ End; ----------------------------------------------FXList FX_StructureTinyDeath- ParticleSystem- Name = ReforgedBlastShards- EndParticleSystemName = StructureTransitionTinySmokeEnd@@ -3942,9 +3860,6 @@ End; ----------------------------------------------FXList FX_CarpetBomb- ParticleSystem- Name = ReforgedBlastShards- EndViewShakeType = STRONG@@ -4218,9 +4133,6 @@ End; ----------------------------------------------FXList FX_StrategyCenterBarrage- ParticleSystem- Name = ReforgedBlastShards- EndViewShakeType = SUBTLEEnd@@ -4258,9 +4170,6 @@ End; ----------------------------------------------FXList FX_GenericCarExplode- ParticleSystem- Name = ReforgedBlastShards- EndSoundName = CarDieEnd@@ -4967,16 +4876,12 @@ FXList WeaponFX_HeroicGenericTankGunNoTracerSmallEnd; -----------------------------------------------; Fragments with smoke trails (ParticleSystemReforged.ini) on two of EA's blasts that had no entry-; here: the Raptor's and the Stealth Fighter's missiles, and the Particle Cannon's beam where it-; ploughs the ground, which plays twenty times along its sweep. EA's own nuggets and light-; unchanged; the beam had no light and gets a short pale one so the block keeps the file's rule.+; Two of EA's blasts that had no entry here: the Raptor's and the Stealth Fighter's missiles, and+; the Particle Cannon's beam where it ploughs the ground, which plays twenty times along its sweep.+; EA's own nuggets and light unchanged; the beam had no light and gets a short pale one so the+; block keeps the file's rule. Smoke-trail fragments stay off these: they are small and the beam+; repeats.FXList WeaponFX_JetMissileDetonation- ParticleSystem- Name = ReforgedBlastShards- OrientToObject = Yes- RotateY = -55- EndViewShakeType = NORMALEnd@@ -5003,9 +4908,6 @@ End; ----------------------------------------------FXList FX_ParticleUplinkCannon_BeamHitsGround- ParticleSystem- Name = ReforgedBlastShards- EndParticleSystemName = ParticleCannonUplink_HitFlareOffset = X:0.0 Y:0.0 Z:2.0diff --git a/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h b/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.hindex 15c2339c4..320863351 100644--- a/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h+++ b/GeneralsMD/Code/GameEngine/Include/GameClient/Drawable.h@@ -397,6 +397,8 @@ public:void setStealthLook(StealthLookType look);StealthLookType getStealthLook() const { return m_stealthLook; }+ StealthLookType getStealthDrawnLook() const { return m_stealthDrawnLook; }+ Real getStealthFade() const { return m_stealthFade; }void updateDrawableClipStatus( UnsignedInt shotsRemaining, UnsignedInt maxShots, WeaponSlotType slot ); ///< This will do the show/hide work if ProjectileBoneFeedbackEnabled is set.void updateDrawableSupplyStatus( Int maxSupply, Int currentSupply ); ///< This will do visual feedback on Supplies carried@@ -758,6 +760,8 @@ private:Module** m_modules[NUM_DRAWABLE_MODULE_TYPES];StealthLookType m_stealthLook;+ StealthLookType m_stealthDrawnLook; ///< look the shader is fading, while m_stealthLook is the target+ Real m_stealthFade; ///< 0 invisible / 1 fully the drawn lookInt m_flashCount; ///< number of times to flash the drawableColor m_flashColor; ///< color to flash the drawablediff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ProductionUpdate.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ProductionUpdate.hindex d31881b6b..514854e63 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ProductionUpdate.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ProductionUpdate.h@@ -145,15 +145,15 @@ public:};//--------------------------------------------------------------------------------------------------/** The units a factory builds on repeat (fork). The player turns one on and off with Ctrl+Alt and+/** The unit a factory builds on repeat (fork). The player turns one on and off with Ctrl+Alt and* the button's key, or a Ctrl+Alt click on it. Whenever the factory's queue is empty it queues- * the unit whose turn it is, and the turn passes to the next in the order they were turned on.+ * that unit. Only one unit at a time: turning a second on takes the first off.* Logic state, set only by MSG_SET_REPEAT_UNIT; kept apart from the module so the test binary can* drive it with no object behind it. *///-------------------------------------------------------------------------------------------------struct ProductionRepeat{- std::vector<const ThingTemplate *> m_units; ///< in the order they were turned on+ std::vector<const ThingTemplate *> m_units; ///< the unit on repeat, or emptyUnsignedInt m_next; ///< index into m_units of the one whose turn it isProductionRepeat() : m_next( 0 ) {}@@ -166,25 +166,29 @@ struct ProductionRepeatreturn FALSE;}- /// on appends it at the end of the turn order, off takes it out; either is a no-op when it already is+ /// on replaces whatever was on repeat with this unit; off takes it outvoid set( const ThingTemplate *unit, Bool on ){+ if( on )+ {+ if( m_units.size() == 1 && m_units[ 0 ] == unit )+ return;+ m_units.clear();+ m_units.push_back( unit );+ m_next = 0;+ return;+ }for( size_t i = 0; i < m_units.size(); ++i ){if( m_units[ i ] != unit )continue;- if( on )- return;m_units.erase( m_units.begin() + i );- // the turn stays with the unit it was on, or wraps to the first when that was the lastif( i < m_next )--m_next;if( m_next >= m_units.size() )m_next = 0;return;}- if( on )- m_units.push_back( unit );}const ThingTemplate *turn() const { return m_units.empty() ? NULL : m_units[ m_next ]; }diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cppindex d73197ea6..ab9a3986d 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Drawable.cpp@@ -616,6 +616,8 @@ Drawable::Drawable( const ThingTemplate *thingTemplate, DrawableStatus statusBitm_modules[i] = NULL;m_stealthLook = STEALTHLOOK_NONE;+ m_stealthDrawnLook = STEALTHLOOK_NONE;+ m_stealthFade = 0.0f;m_flashCount = 0;@@ -1371,6 +1373,8 @@ void Drawable::imitateStealthLook( Drawable& otherDraw )m_hidden = otherDraw.isDrawableEffectivelyHidden();m_hiddenByStealth = otherDraw.isDrawableEffectivelyHidden();m_stealthLook = otherDraw.getStealthLook();+ m_stealthDrawnLook = otherDraw.getStealthDrawnLook();+ m_stealthFade = otherDraw.getStealthFade();m_secondMaterialPassOpacity = otherDraw.getSecondMaterialPassOpacity();}@@ -2914,6 +2918,8 @@ void Drawable::setStealthLook(StealthLookType look){if (look != m_stealthLook){+ const StealthLookType previous = m_stealthLook;+ const Bool wasHidden = m_hiddenByStealth;m_stealthOpacity = 1.0f; //assume not transparentswitch (look)@@ -2982,11 +2988,36 @@ void Drawable::setStealthLook(StealthLookType look)break;case STEALTHLOOK_INVISIBLE:- m_hiddenByStealth = true;m_secondMaterialPassOpacity = 0.0f;+ // snap hide when the unit has never been drawn stealthed: an enemy spawning cloaked+ // must not flash a frame of its body. Classic and Direct3D 9 have no cloak shader+ // to fade with, so they hide at once as they did in 2003. The D3D11 path keeps+ // drawing while draw() eases the fade out.+ {+ const Bool shaderFade = TheGlobalData+ && TheGlobalData->m_direct3D11+ && !TheGlobalData->m_classicGraphics;+ if( ( previous == STEALTHLOOK_NONE && m_stealthFade <= 0.0f ) || !shaderFade )+ {+ m_hiddenByStealth = true;+ m_stealthDrawnLook = STEALTHLOOK_INVISIBLE;+ m_stealthFade = 0.0f;+ }+ else+ m_hiddenByStealth = false;+ }break;}+m_stealthLook = look;++ if( look != STEALTHLOOK_INVISIBLE && look != STEALTHLOOK_NONE && look != STEALTHLOOK_DISGUISED_ENEMY )+ {+ m_stealthDrawnLook = look;+ if( wasHidden )+ m_stealthFade = 0.0f;+ }+updateHiddenStatus();}}@@ -3034,6 +3065,32 @@ void Drawable::draw( View *view )m_secondMaterialPassOpacity = 0.0f;}+ {+ const Bool wantEffect = ( m_stealthLook == STEALTHLOOK_VISIBLE_FRIENDLY+ || m_stealthLook == STEALTHLOOK_VISIBLE_FRIENDLY_DETECTED+ || m_stealthLook == STEALTHLOOK_VISIBLE_DETECTED );+ if( wantEffect )+ {+ m_stealthDrawnLook = m_stealthLook;+ m_stealthFade = 1.0f - ( 1.0f - m_stealthFade ) * fadeScalar;+ if( m_stealthFade > 0.999f )+ m_stealthFade = 1.0f;+ }+ else+ {+ m_stealthFade *= fadeScalar;+ if( m_stealthFade <= VERY_TRANSPARENT_MATERIAL_PASS_OPACITY )+ {+ m_stealthFade = 0.0f;+ m_stealthDrawnLook = m_stealthLook;+ if( m_stealthLook == STEALTHLOOK_INVISIBLE && !m_hiddenByStealth )+ {+ m_hiddenByStealth = true;+ updateHiddenStatus();+ }+ }+ }+ }if (m_hidden || m_hiddenByStealth || getFullyObscuredByShroud())return; // my, that was easy@@ -6314,6 +6371,8 @@ void Drawable::xfer( Xfer *xfer )// when it changes. So in the next stealth update, it will be set to// it's correct value, and the drawable updated (hide shadows and such). jba.m_stealthLook = STEALTHLOOK_NONE;+ m_stealthDrawnLook = STEALTHLOOK_NONE;+ m_stealthFade = 0.0f;// Also, need to update the hidden status for all sub-modules.if (m_hidden || m_hiddenByStealth) {updateHiddenStatus();diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cppindex 4e3eefa25..a400e46c4 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBarCommandProcessing.cpp@@ -537,7 +537,9 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control,// gather the "factory" objects that could make the thing. With several factories// selected (multi-select context) every one that can make it is a candidate, and each- // unit of the batch goes to the least loaded one, so the work spreads over all of them+ // unit of the batch goes to the least loaded one, so the work spreads over all of them.+ // A factory already at the nine-deep strip is left out, and with none able to take it+ // the click does nothing: the button is already grey.std::vector<Object *> factories;std::vector<UnsignedInt> queued; // real production count plus what this click already gave itif( obj )@@ -555,26 +557,34 @@ CBCommandStatus ControlBar::processCommandUI( GameWindow *control,ProductionUpdateInterface *cpu = candidate ? candidate->getProductionUpdateInterface() : NULL;if( cpu == NULL || TheBuildAssistant->canMakeUnit( candidate, whatToBuild ) != CANMAKE_OK )continue;+ if( cpu->getProductionCount() >= getQueueCap( cpu ) )+ continue;factories.push_back( candidate );queued.push_back( cpu->getProductionCount() );}- // nothing can take it: fall back to the first factory so the usual messages fire- if( factories.empty() && !selected->empty() && selected->front()->getObject() )- {- factories.push_back( selected->front()->getObject() );- queued.push_back( 0 );- }}if( factories.empty() )break;for( Int built = 0; built < wanted; built++ ){- // least loaded factory takes this one- Int best = 0;- for( Int i = 1; i < (Int)factories.size(); i++ )- if( queued[ i ] < queued[ best ] )+ // least loaded factory that still has a free queue slot takes this one+ Int best = -1;+ for( Int i = 0; i < (Int)factories.size(); i++ )+ {+ ProductionUpdateInterface *fpu = factories[ i ]->getProductionUpdateInterface();+ const UnsignedInt cap = fpu ? getQueueCap( fpu ) : 0;+ if( queued[ i ] >= cap )+ continue;+ if( best < 0 || queued[ i ] < queued[ best ] )best = i;+ }+ if( best < 0 )+ {+ if( built == 0 )+ TheInGameUI->message( "GUI:ProductionQueueFull" );+ break;+ }Object *factory = factories[ best ];CanMakeType cmt = TheBuildAssistant->canMakeUnit(factory, whatToBuild);diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex b1e6ea07a..d58a82a18 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -3963,9 +3963,11 @@ void InGameUI::updateAttackCircle( const ICoord2D& pt )//-------------------------------------------------------------------------------------------------/** The circle the player is dragging, in world terms: its centre is the ground the press landed on,- * and the cursor sits on its rim. Both the rim drawn on the screen and the wash laid on the ground- * ask this, so they cannot disagree about where the circle is. The centre is kept as ground, not- * as the pixel: a camera that moves during the drag used to slide the whole circle over the map. */+ * and the cursor sits on its rim in that same plane. The rim is not rayed onto the terrain: a+ * hill or a building under the cursor used to jump the radius every frame. Both the rim drawn on+ * the screen and the wash laid on the ground ask this, so they cannot disagree about where the+ * circle is. The centre is kept as ground, not as the pixel: a camera that moves during the drag+ * used to slide the whole circle over the map. *///-------------------------------------------------------------------------------------------------Bool InGameUI::getAttackCircleGround( Coord3D& center, Real& radius ) const{@@ -3974,7 +3976,7 @@ Bool InGameUI::getAttackCircleGround( Coord3D& center, Real& radius ) constCoord3D rim;center = m_attackCircleCenter;- TheTacticalView->screenToTerrain( &m_attackCircleCursor, &rim );+ TheTacticalView->screenToWorldAtZ( &m_attackCircleCursor, &rim, center.z );const Real dx = rim.x - center.x;const Real dy = rim.y - center.y;diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cppindex ad103074f..b69698360 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ProductionUpdate.cpp@@ -108,8 +108,8 @@ ProductionUpdateModuleData::ProductionUpdateModuleData( void )m_doorClosingTime = 0;m_constructionCompleteDuration = 0;m_quantityModifiers.clear();- // deep queues; objects that must build one at a time still say MaxQueueEntries = 1 in INI- m_maxQueueEntries = 100;+ // nine, matching the queue strip; objects that must build one at a time still say MaxQueueEntries = 1 in INI+ m_maxQueueEntries = 9;m_disabledTypesToProcess = MAKE_DISABLED_MASK(DISABLED_HELD);}diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cppindex 513aec57e..5f0f4fb6f 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp@@ -4416,11 +4416,12 @@ void W3DVolumetricShadowManager::renderShadowMap( CameraClass &sceneCamera )const DrawableInfo *casterInfo = (const DrawableInfo *)robj->Get_User_Data();const Drawable *caster = casterInfo ? casterInfo->m_drawable : NULL;if (caster && Direct3D11_Draw_Effects()- && (caster->getStealthLook() == STEALTHLOOK_VISIBLE_FRIENDLY- || caster->getStealthLook() == STEALTHLOOK_VISIBLE_FRIENDLY_DETECTED))+ && (caster->getStealthDrawnLook() == STEALTHLOOK_VISIBLE_FRIENDLY+ || caster->getStealthDrawnLook() == STEALTHLOOK_VISIBLE_FRIENDLY_DETECTED)+ && caster->getStealthFade() > 0.001f){sunInfo.drawEffect = DRAW_EFFECT_CLOAK_SHADOW;- sunInfo.drawEffectParameters[3] = caster->getEffectiveOpacity();+ sunInfo.drawEffectParameters[3] = caster->getEffectiveOpacity() * caster->getStealthFade();}robj->Render( sunInfo );diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cppindex 99d491de5..681078e86 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DInGameUI.cpp@@ -1077,8 +1077,8 @@ void W3DInGameUI::drawFormationLine( void )} // end drawFormationLine//--------------------------------------------------------------------------------------------------/** A circle on the ground, not on the screen, so it follows the terrain the way the units it is- * about do */+/** A circle in the plane of the press, not rayed onto the terrain: a hill under the rim used to+ * jump the radius every frame. *///-------------------------------------------------------------------------------------------------static void drawGroundRing( const Coord3D& center, Real radius, UnsignedInt color, Real width ){@@ -1092,7 +1092,7 @@ static void drawGroundRing( const Coord3D& center, Real radius, UnsignedInt coloCoord3D world;world.x = center.x + radius * (Real)cos( angle );world.y = center.y + radius * (Real)sin( angle );- world.z = TheTerrainLogic->getGroundHeight( world.x, world.y );+ world.z = center.z;ICoord2D screen;if( TheTacticalView->worldToScreenTriReturn( &world, &screen ) == View::WTS_INVALID )@@ -1123,7 +1123,6 @@ void W3DInGameUI::drawAttackCircle( void )// and the radius itself, so the drag reads as a radius rather than a rubber bandICoord2D middle;- center.z = TheTerrainLogic->getGroundHeight( center.x, center.y );if( TheTacticalView->worldToScreenTriReturn( ¢er, &middle ) != View::WTS_INVALID )TheDisplay->drawLine( middle.x, middle.y, getAttackCircleCursor().x,getAttackCircleCursor().y, 1.0f, 0x66FF5555 );diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cppindex 7a066d433..fa936026a 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp@@ -100,9 +100,16 @@ static Bool theTranslucentPass = FALSE;static Bool wearsCloak( const Drawable *draw ){- const StealthLookType look = draw->getStealthLook();- return ( look == STEALTHLOOK_VISIBLE_FRIENDLY || look == STEALTHLOOK_VISIBLE_FRIENDLY_DETECTED )- && Direct3D11_Draw_Effects();+ if( !Direct3D11_Draw_Effects() )+ return FALSE;+ const StealthLookType look = draw->getStealthDrawnLook();+ const Real fade = draw->getStealthFade();+ if( look == STEALTHLOOK_VISIBLE_FRIENDLY || look == STEALTHLOOK_VISIBLE_FRIENDLY_DETECTED )+ return fade > 0.001f;+ // revealed fades in the translucent pass so the heat can come up from nothing+ if( look == STEALTHLOOK_VISIBLE_DETECTED && fade < 0.99f )+ return TRUE;+ return FALSE;}// No texturing, no zbuffer reading/writing, primary gradient, no@@ -660,17 +667,25 @@ static unsigned chooseDrawEffect( const Drawable *draw, const Object *obj, Boolreturn DRAW_EFFECT_NONE;unsigned effect = DRAW_EFFECT_NONE;- const StealthLookType look = draw->getStealthLook();+ const StealthLookType look = draw->getStealthDrawnLook();const Real pulse = draw->getSecondMaterialPassOpacity();- const Real opacity = draw->getEffectiveOpacity();+ const Real fade = draw->getStealthFade();+ Real opacity = draw->getEffectiveOpacity();+ if( draw->getStealthLook() == STEALTHLOOK_NONE )+ opacity = opacity + ( 1.0f - opacity ) * ( 1.0f - fade );+ else+ opacity *= fade;Real strength = 1.0f;- if ( look == STEALTHLOOK_VISIBLE_DETECTED && !draw->isKindOf( KINDOF_MINE ) )+ if ( look == STEALTHLOOK_VISIBLE_DETECTED && !draw->isKindOf( KINDOF_MINE )+ && ( translucentPass || fade >= 0.99f ) ){effect = DRAW_EFFECT_REVEALED;strength = pulse;+ opacity = fade;}- else if ( translucentPass && wearsCloak( draw ) )+ else if ( translucentPass && wearsCloak( draw )+ && look != STEALTHLOOK_VISIBLE_DETECTED ){// Detected, the amber stays on and the detector's sweep brightens it; on the pulse alone it// showed for a few frames a sweep and was never seen.diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cppindex 4a25e8273..3acfd774f 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp@@ -3110,8 +3110,11 @@ Int W3DView::iterateDrawablesInRegion( IRegion2D *screenRegion,world.Y = pos.y;world.Z = pos.z;- // project the world point to the screen- if( m_3DCamera->Project( screen, world ) == CameraClass::INSIDE_FRUSTUM &&+ // project the world point to the screen. Near-clip returns 0,0,0 and is a miss.+ // Far-clip still writes x,y, and those feet can sit in the 2D view: skipping them+ // is why a double-click missed units that were on screen.+ enum CameraClass::ProjectionResType projection = m_3DCamera->Project( screen, world );+ if( projection != CameraClass::OUTSIDE_NEAR_CLIP &&screen.X >= normalizedRegion.lo.x &&screen.X <= normalizedRegion.hi.x &&screen.Y >= normalizedRegion.lo.y &&diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cppindex fc58cc5d7..00c3a0341 100644--- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp+++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3dWaypointBuffer.cpp@@ -502,8 +502,6 @@ void W3DWaypointBuffer::drawWaypoints(RenderInfoClass &rinfo)if (pNearElbow)//did we find a nearest corner?{- m_waypointNodeRobj->Set_Position(Vector3(pNearElbow->x,pNearElbow->y,ctr->z));- WW3D::Render(*m_waypointNodeRobj,localRinfo); //The little hockey puckpoints[ numPoints ].Set( Vector3( pNearElbow->x, pNearElbow->y, ctr->z ) );numPoints++;@@ -528,8 +526,6 @@ void W3DWaypointBuffer::drawWaypoints(RenderInfoClass &rinfo)dot = firstToRPDelta.x * firstElbowDelta.x + firstToRPDelta.y * firstElbowDelta.y;if (dot < 0)// we have a second elbow{- m_waypointNodeRobj->Set_Position(Vector3(pFarElbow->x,pFarElbow->y,ctr->z));- WW3D::Render(*m_waypointNodeRobj,localRinfo); //The little hockey puckpoints[ numPoints ].Set( Vector3( pFarElbow->x, pFarElbow->y, ctr->z ) );numPoints++;}@@ -550,10 +546,6 @@ void W3DWaypointBuffer::drawWaypoints(RenderInfoClass &rinfo)elsecontinue;- m_waypointNodeRobj->Set_Position(Vector3(naturalRallyPoint.x,naturalRallyPoint.y,naturalRallyPoint.z));- WW3D::Render(*m_waypointNodeRobj,localRinfo); //The little hockey puck--queueLine( numPoints, points );}// end if exit interfacediff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ffshader.h b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ffshader.hindex b965a1668..b4ad6d3d4 100644--- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ffshader.h+++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ffshader.h@@ -571,9 +571,8 @@ const unsigned NORMAL_MAPPED_LIGHTS = 4;" left a squad barely there, so the glass also leans toward a cool mid grey, 12% face on and\n" \" about three quarters at the outline, where a soldier's round body has most of its faces and\n" \" a building's flat walls have few: a haze rather than a white edge, darkening bright ground as\n" \- " much as it lifts dark ground. Three eighths to a half of the unit's own paint stays in it,\n" \- " breathing with the game's own stealth opacity as it did in 2003, which is what makes a group\n" \- " read at a glance while it still looks like glass. Detected (the strength is never below 0.6\n" \+ " much as it lifts dark ground. The unit's own paint is mixed in by the game's stealth opacity,\n" \+ " so the 2003 breath goes solid at the top of the pulse and back to glass at the bottom. Detected (the strength is never below 0.6\n" \" then), the whole body beats amber as well as its edge: a big flat building has almost no\n" \" edge facing away from the eye, and with the beat on the rim alone it only turned tan. The\n" \" alpha goes back up to the texel's own, because the shade already holds the mix. */\n" \@@ -583,7 +582,7 @@ const unsigned NORMAL_MAPPED_LIGHTS = 4;" effect_surface(position, world, surface, facing);\n" \" float t = DrawEffectParameters.x;\n" \" float detected = DrawEffectParameters.y;\n" \- " float opacity = max(DrawEffectParameters.w, 0.05);\n" \+ " float opacity = saturate(DrawEffectParameters.w);\n" \" float rim = pow(1.0 - facing, 2.0);\n" \" float swim_x = effect_noise(world * 0.09 + float3(t * 0.35, t * 0.2, t * 0.45)) - 0.5;\n" \" float swim_y = effect_noise(world * 0.09 + float3(7.3 - t * 0.3, 2.1, t * 0.4)) - 0.5;\n" \@@ -601,15 +600,15 @@ const unsigned NORMAL_MAPPED_LIGHTS = 4;" float3 behind = SceneColour.Load(int3(at, 0)).rgb;\n" \" float grey = dot(current.rgb, float3(0.299, 0.587, 0.114));\n" \" float3 own = lerp(grey.xxx, current.rgb, 0.7);\n" \- " float3 glass = lerp(behind, own, 0.25 + 0.25 * opacity);\n" \- " glass = lerp(glass, float3(0.52, 0.55, 0.59), 0.12 + 0.65 * rim);\n" \+ " float3 glass = lerp(behind, own, opacity);\n" \+ " glass = lerp(glass, float3(0.52, 0.55, 0.59), (1.0 - opacity) * (0.12 + 0.65 * rim));\n" \" float found = step(0.01, detected);\n" \" float beat = 0.55 + 0.45 * sin(t * 6.0);\n" \" float3 amber = float3(1.0, 0.55, 0.15);\n" \" float lum = dot(glass, float3(0.299, 0.587, 0.114));\n" \" glass = lerp(glass, amber * (0.3 + lum), found * (0.25 + 0.3 * beat)) + found * (rim * 1.2 + 0.18) * beat * amber;\n" \" current.rgb = glass;\n" \- " current.a = saturate(current.a / opacity);\n" \+ " current.a = (opacity < 0.02) ? 0.0 : saturate(current.a / max(opacity, 0.05));\n" \" return current;\n" \"}\n" \"\n" \@@ -631,7 +630,11 @@ const unsigned NORMAL_MAPPED_LIGHTS = 4;" float rim = pow(1.0 - facing, 2.0);\n" \" float sweep = smoothstep(0.9, 1.0, sin(world.z * 0.06 - t * 1.8));\n" \" float gain = 0.6 + 0.35 * pulse;\n" \- " current.rgb = ramp * gain + float3(1.0, 0.40, 0.12) * (rim * 0.9 + sweep * 0.35) * gain;\n" \+ " float mix = saturate(DrawEffectParameters.w);\n" \+ " float3 heatRgb = ramp * gain + float3(1.0, 0.40, 0.12) * (rim * 0.9 + sweep * 0.35) * gain;\n" \+ " current.rgb = heatRgb;\n" \+ " if (mix < 0.999)\n" \+ " current.a *= mix;\n" \" return current;\n" \"}\n" \"\n" \diff --git a/GeneralsMD/Code/Tests/test_gameengine.cpp b/GeneralsMD/Code/Tests/test_gameengine.cppindex 4b44fc8ca..db6dd37ec 100644--- a/GeneralsMD/Code/Tests/test_gameengine.cpp+++ b/GeneralsMD/Code/Tests/test_gameengine.cpp@@ -11072,16 +11072,13 @@ TEST(replay_crc_queue_aligns_to_either_kind_of_network_recording)}-/** The build queue strip has nine buttons, and that number had become the production cap: every- build button greyed out at nine units even though the queue itself is a hundred deep. The two- numbers are unrelated - one is how many entries fit on screen, the other is how many the factory- will take (INI MaxQueueEntries). */-TEST(a_factorys_queue_is_as_deep_as_its_ini_says_not_as_wide_as_the_button_strip)+/** The build queue strip has nine buttons, and that is the production cap: a shift-click that+ would overshoot stops at nine, and so does the factory itself (INI MaxQueueEntries, default 9). */+TEST(a_factorys_queue_is_as_deep_as_the_button_strip){ProductionUpdateModuleData data;- CHECK_EQ( 100, data.m_maxQueueEntries );- CHECK( data.m_maxQueueEntries > MAX_BUILD_QUEUE_BUTTONS );+ CHECK_EQ( MAX_BUILD_QUEUE_BUTTONS, data.m_maxQueueEntries );}/** A docking ends on the frame the last box changes hands, not one action delay later. Both ends@@ -12958,10 +12955,9 @@ TEST(a_door_stays_open_while_another_unit_is_still_coming)CHECK( !Production_shouldCloseDoorNow( 31, 30, true, true ) );}-/* ProductionUpdate.h: production repeat. A factory keeps a list of units on repeat in the order- they were turned on, and every time its queue runs empty it queues the one whose turn it is and- passes the turn on. Turning one off must leave the turn with the unit it was on. */-TEST(production_repeat_turns_round_the_units_in_the_order_they_were_turned_on)+/* ProductionUpdate.h: production repeat. A factory keeps one unit on repeat. Turning a second+ on takes the first off. Turning the same one on again is a no-op, and off takes it out. */+TEST(production_repeat_is_one_unit_at_a_time){static const char a = 0, b = 0, c = 0;const ThingTemplate *tank = (const ThingTemplate *)&a;@@ -12974,34 +12970,29 @@ TEST(production_repeat_turns_round_the_units_in_the_order_they_were_turned_on)CHECK( repeat.turn() == NULL );repeat.set( tank, TRUE );- repeat.set( apc, TRUE );- repeat.set( tank, TRUE ); // already on: not a second entry- CHECK_EQ( 2, (Int)repeat.m_units.size() );- CHECK( repeat.has( tank ) && repeat.has( apc ) && !repeat.has( jeep ) );-+ repeat.set( tank, TRUE ); // already on: still one+ CHECK_EQ( 1, (Int)repeat.m_units.size() );+ CHECK( repeat.has( tank ) && !repeat.has( apc ) && !repeat.has( jeep ) );CHECK( repeat.turn() == tank );- repeat.advance();++ repeat.set( apc, TRUE ); // a second unit replaces the first+ CHECK_EQ( 1, (Int)repeat.m_units.size() );+ CHECK( repeat.has( apc ) && !repeat.has( tank ) );CHECK( repeat.turn() == apc );repeat.advance();- CHECK( repeat.turn() == tank );+ CHECK( repeat.turn() == apc );- /* the turn is on the third of three; taking the first off keeps it on the third */repeat.set( jeep, TRUE );- repeat.advance();- repeat.advance();- CHECK( repeat.turn() == jeep );- repeat.set( tank, FALSE );CHECK( repeat.turn() == jeep );-- /* taking off the one whose turn it is, when it is the last, wraps to the first */repeat.set( jeep, FALSE );- CHECK( repeat.turn() == apc );+ CHECK( repeat.turn() == NULL );repeat.set( jeep, FALSE ); // already off: nothing happens- CHECK_EQ( 1, (Int)repeat.m_units.size() );+ CHECK_EQ( 0, (Int)repeat.m_units.size() );+ repeat.set( tank, TRUE );repeat.clear();CHECK( repeat.turn() == NULL );- CHECK( !repeat.has( apc ) );+ CHECK( !repeat.has( tank ) );}/* What a factory on repeat does when canMakeUnit answers: money, a full queue or parking, the unit