DarklightGames / DarkestHour

Darkest Hour: Europe '44-'45
https://store.steampowered.com/app/1280/Darkest_Hour_Europe_4445/
68 stars 21 forks source link

Round types that have depleted their ammunition should be displayed in another color #626

Closed cmbasnett closed 7 years ago

cmbasnett commented 7 years ago

On the interface, the round type list makes no visual distinction between a round type that's not currently loaded and a round type that is depleted. We should have a visual distinction between the two. Depleted rounds should perhaps be red or transparent, whichever one is used to indicate an "out of ammo" status in other parts of the game.

handsm commented 7 years ago

Not a bad idea. And I don't expect any difficulties with it. I've worked on this part of the code before so I'm familiar with it.

My gut feeling is greyed out for out of ammo, rather than red. The HUD is an artificial thing that can become intrusive and I think we should be wary of too much red.

Currently the ammo icon for the cannon or coax MG goes red temporarily during a reload process. I think that's ok as it's short lived and was originally in RO (we've added it for the MG as well as the cannon). Those cannon ammo does also go red if the player is completely out of ammo, but that is red and it's more a 'big shouty' situation that screams at the player to go get some more ammo. Where if just one of three ammo types is out, e.g. player has fired off his few smoke rounds but still has lots of AP and HE rounds, I think it will be more appropriate to grey out the smoke label rather than make it red.

handsm commented 7 years ago

Implemented in commit https://github.com/DarklightGames/DarkestHour/commit/a8a90328d726563717fc55189d938bbcd3679891.

Changed my mind after trials and have gone with red for out of ammo. Forgot that I already use greyed out text for ammo types other than the one selected, for the purpose of emphasising the selected round type. So if we use a paler grey for out of ammo it doesn't look quite right when you see 3 shades of white/grey (white for current round, grey for non-current, pale grey for out of ammo).

For the out of ammo text I have used the same red colour and weight as for the ammo icon when reloading or out of ammo, so there is consistency. But to reduce the intrusive red on the screen I've played around with the red tint and reduced the alpha, so it less bright and less intrusive. Ended up reducing alpha on the red from 128 to 80. 64 is perhaps ideal with full HUD opacity, but players can reduce HUD opacity down to as low as 50% of normal, so 80 is a good balance.

With the extra out of ammo indication, but also toning down all the red on the HUD, I think we end up with the best of both worlds.

handsm commented 7 years ago

Fixed to work with autocannons in commit https://github.com/DarklightGames/DarkestHour/commit/74f988dfe11f6e432f364574d1beae6de9a2258e.

Was checking whether had any of each round type using the HasAmmo() function, which only works with normal cannon shells. Switched to using more generic HasAmmoToReload function(), which handles autocannon mags as well.

handsm commented 7 years ago

Re-opened as doesn't display red ammo indicator if out of currently selected round, which can happen if (1) out of all ammo types, so selected round stays on last type fired, now depleted, or (2) player uses manual cannon reloading and runs out of current round, where game waits for him to manually change rounds.

Fix is very simple. Will commit soon, when separated out various code work.

handsm commented 7 years ago

Improved fix in commit https://github.com/DarklightGames/DarkestHour/commit/751941d7cd697878fe56eb4e24652e6a5bf18d38, to fix small problem mentioned in comment above.