No visual indication that hull machine-gun ammunition is completely depleted

Issue #87 resolved
Colin Basnett created an issue

No description provided.

Comments (9)

  1. Matt Hands

    I've done some work on different HUD indicators that a vehicle MG is reloading or completely out of ammo. This should resolve this issue, although the functionality will be commonly be seen during MG reloads. This applies to all vehicle MGs, including coax turret MGs and APCs. Quick videos below to demo.

    Most of the changes are in the HUD's DrawVehicleIcon function. Methods 2 & 3 require a new MG ammo reload texture, which I have attached. If used it would go in DH_InterfaceArt_tex.utx.

    Method 1

    MG ammo icon and number of mags are greyed out while the MG is reloading or if it's entirely out of ammo. Goes back to normal white when reload completes and MG is ready to fire again.

    I think this is my preferred method as it is very simple and adds no clutter to the HUD. The downside is it doesn't indicate reload progress, only that the MG can't fire, although you do of course hear the reload sound. But I think the red 4 stage reload indicator is more important with a cannon reload.

    Method 1 video

    Method 2

    MG reload progress is shown in red on the MG ammo icon, in 4 stages, just like a tank cannon reload.

    This gives slightly greater functionality, as you can see reload progress. But it may be a little OTT for an MG. I'd say it looks fine for an MG position, but for a coax turret MG you get two ammo indicators that can turn red (cannon shell plus coax).

    Method 2 video

    Method 3

    Similar to method 3, but the red reload progress indicator is smooth and continuous, not broken into 4 stages like method 2 or a tank cannon reload.

    I think this looks better than method 2, but the problem is it can only be used on MGs that use a mesh HUDOverlay, like the early stug, the halftracks & the 50 cal, where the reload is done on the overlay. The reload process is completely different for MGs that don't use a mesh overlay, e.g. hull MGs and remote MG on stug, StuH and hetzer. So I think this method is probably ruled out, as we need consistent visuals for different vehicles.

    Method 3 video

  2. Colin Basnett reporter

    Based on what's written here, method 2 seems the most desirable as it is visually consistent with the cannon shell reloading visuals (i.e. being broken up into 4 stages).

    I don't see an issue with there being two different reloading indicators for both the cannon and co-axial machine-gun.

  3. Matt Hands

    Fair enough. Here's the code, although I've had to lash together a temporary GetAmmoReloadState function that should work for hull MGs. I hate posting this untested, but I can't test it, as it's going to be in a different structure to my own work. It is very different to the function I am using in my own version of the MG classes, but my version has pausing reloads & extra variables, so I can't use it with the current dev build.

    However, my temp function should work for anything that extends DH_ROMountedTankMG, so for hull MGs but not exposed MGs on stugs, HTs, etc. I think you've consolidated DH_HiddenTankMG into that class. There are two different reload timer methods and neither records times, so my lash job calculates time remaining using actor internal timer variables. Fingers crossed ! But the coax MG should work fine.

    Note that the modified HUD function also includes some optimisation when drawing vehicle occupants, including a line that will allow 'missing' rider pawns to still get shown as unoccupied slots (i.e. black dots on vehicle HUD icon), now that rider pawns will not exist on clients unless occupied.

    [code removed as now committed]

  4. Colin Basnett reporter

    The DrawVehicleIcon function does not compile due to circular dependencies on packages that rely on DH_Engine.

  5. Matt Hands

    Believe problem stems from DH abstract vehicle classes being in DH_Vehicles, where RO abstract vehicle classes are in ROEngine. For example, ROHud references ROTreadCraft without a problem.

    This is quite limiting and will affect several features. Propose to move DH abstract vehicle classes to DH_Engine and find & update all references to full package.class names.

  6. Matt Hands

    New HUD MG reload progress system partially implemented in commit 767a087

    Fixes this issue. If MG can't fire the ammo icon turns red & if it's reloading the red reduces in 4 stages, like a cannon reload.

    GetAmmoReloadState in MG pawn class is temporary, pending a major re-work of all MG classes I need to commit (all vehicle MGs will use base MG classes).

    Turret coaxial MG works fine & hull MG works fully in single player.

    Hull MG in multi-player shows fully in red until reload completes; no 4 stage progress. Client doesn't have access to variables used to calc progress - will address in the MG classes re-work.

    Other vehicles MGs don't yet extend DH_ROMountedMG & so aren't affected yet (infantry vehicles, stug, stuh, marder).

    Uses a texture I have added to DH_InterfaceArt_tex & uploaded with SVN commit.

  7. Matt Hands

    Slightly updated in commit 7d4b9ef, just a slightly improved HUD MG reload display (red progress indicator more evenly spread in 4 stages).

  8. Log in to comment