FlexiHUD - a universal, extremely flexible HUD mod (3.0.0 released)

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

FlexiHUD - a universal, extremely flexible HUD mod (3.0.0 released)

Post by Jekyll Grim Payne »

FlexiHUD is a universal, highly flexible HUD mod. Not only can you see all the usual information and a lot more, but you can also MOVE every single element!

DOWNLOADS:
Releases: https://github.com/jekyllgrim/Universal ... D/releases
Download repository: https://github.com/jekyllgrim/Universal ... s/main.zip (this gives you the freshest version. Do not unpack, just load the .zip directly as a mod; you can also change its extension to .pk3)

Features
  • FlexiHUD does not replace your HUD; it's drawn on top of the HUD with an event handler. You can either disable the vanilla HUD (by pressing = twice) to only see FlexiHUD, or position/toggle specific elements of FlexiHUD to combine it with the default HUD the way you want
  • Not a single graphical element — everything is done through code.
  • Every single element can be toggled on/off, attached to any screen angle or edge, and offset from there.
  • Many elements have several display modes (such as disabled/autohide after delay/always show)
  • You can select your own color and opacity for background of the elements
  • Heretic, Hexen and Strife support: full inventory bar with fluid animation. Hexen armor is fully accounted for and displays all possessed armor elements.
  • Can display powerup icons even for powerups that don't have them (like Doom powerups).
  • Currently supports 6 languages: English, German, French, Brazilian Portugese, Spanish LatAm and Russian. All text is in LANGUAGE.csv, more localizations are welcome.
  • Heavily commented code—I hope you can learn from it!
  • MIT licence (can be used by anyone for any purpose, just copy-paste my LICENSE file from the mod)
TRAILER


Elements
  • Health, armor and mugshot
    - Health/armor can be represented with numbers or bars
    - Mugshot can be toggled
  • Current weapon and ammo
    - Shows the current ammo amount and icon(s)
    - Weapon icon and ammo bar that can be toggled
  • All Ammo
    - Shows a list of all ammo possessed by the player
    - Can show all ammo or only the ammo that you have weapons for
    - Color-coded to represent the amount left. Ammo for current weapon is highlighted
  • Weapon slots
    - Shows a list of current weapons and their slots
    - Slots have small Quake 2-styled bars representing the amount of ammo for that weapon
    - Can be arranged horizontally or vertically (with bottom>top/top>bottom options)
    - Adjustable icon size
    - Supports always show/auto-hide display
  • Minimap and map data
    - A minimap of the level (supports adjustable zoom and size, can be square or circular)
    - Can also display monster markers (which can be enabled combined with the minimap or separately from it)
    - Customizable minimap colors, size and shape (square or circular)
    - Optional Map Data block that can show kills, secrets, items and level time (all toggleablle)
    - Also supports map markers, such as the ones used by Hellscape Navigator
  • Powerup timers
    - Shows icons and remaining time for current powerups
    - Obtains icons even for those powerups that don't have them (provided the powerup in question is associated with a PowerupGiver class)
    - Vertical or horizontal arrangement
  • Reticle bars
    - Half-Life-styled round bars around the crosshair that represent health, armor, current ammo and the health of the monster you're looking at
    - Each bar can be individually toggled and moved to one of the four positions around the crosshair
    - Adjustable size and width of the bars
    - Supports always show/auto-hide display
  • Incoming damage markers
    - Doom Eternal-styled round damage markers that point at the enemy that has damaged you
    - Adjustable maximum opacity and fade-out time
    - As a separate option, you can adjust the multiplier for the vanilla damage screen reddeing factor. For example, you can set it to 0.0 in case you want to rely solely on the damage markers as indicators of incoming damage.
  • Hit markers
    - Hit marker around your crosshair that flashes when you hit an enemy
    - Several hit marker shapes to choose from
    - Adjustable size and color. Size can either match the crosshair or be set explicitly
    - The marker will grow larger if your attack killed the enemy
  • Inventory bar
    - Animated, smoothly scrolling inventory bar (shows up in the games/mods that actually have items that can be put in the inventory, like Heretic)
    - Supports always visible mode (in the style of Alternative HUD) or auto-hide (only the selected item is visible)
  • Custom items
    - A special block that will display items added to the ITEMINFO lump in the mod (see the contents of ITEMINFO for an example and explanation). Can be utilized to display ammo or items that, for some reason, cannot be captured by other HUD blocks (or just in case you want to display a specific item class separately).
Some screenshots

Default look:


Customization variant:


Another customization variant:


Hexen works too, with inventory and armor:
User avatar
generic name guy
Posts: 123
Joined: Wed Nov 11, 2020 3:25 pm
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by generic name guy »

Hell yeah, can't wait to try this out!
User avatar
kalensar
Posts: 485
Joined: Sun Mar 21, 2021 9:40 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): linux mint 21
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by kalensar »

very nice <3
Anim8
Posts: 18
Joined: Sun Dec 26, 2021 11:58 pm

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by Anim8 »

Nice HUD! Gave it a quick go using GZDoom v4.11.1 x64(Vulkan).

I also see this HUD been excellent for mobile use as fingers often cover the HUD area, so having vital hud information in the central area is ideal.

I did notice a couple of things.

1. The health for the enemies work on first map but when going onto the next map the health no longer shows when pointed at an enemy.

2. Some mods such as Beautiful Doom, can cause issues with the weapon slot HUD locations.
Screenshot example after typing in idkfa: https://u.cubeupload.com/Anim8/BaseProfileScreensho.png
User avatar
Dr_Cosmobyte
Posts: 2833
Joined: Thu Jun 04, 2015 9:07 pm
Preferred Pronouns: He/Him
Location: Killing spiders.

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by Dr_Cosmobyte »

Haven't tried it yet, but since i'm a Hexen enthusiast, you might want to take a look at this.

In my "Semi-Universal Raven Patch" mod, i've created mini icons for all hexen keys to save some space. You might like them and even make them better. I've edited them myself, so no worries about authorization.

Have fun!
User avatar
Delfino Furioso
Posts: 121
Joined: Sat Mar 27, 2021 3:21 pm

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by Delfino Furioso »

this is sweet! I get NCHUD vibes from it

I tried it and got a VM abort, but I managed to find out what was causing it
I had "screenblocks" set to "12" in my ini, due to some tests I was performing yesterday on my hud project

this is the log

Code: Select all

VM execution aborted: tried to read from address zero. In function parameter "self"
Called from CVar.GetBool at gzdoom.pk3:zscript/engine/base.zs, line 681
Called from JGPUFH_FlexibleHUD.DrawPowerups at FlexiHUD.pk3:ufhzscript/ufh_hud.zs, line 2248
Called from CVar.GetInt [Native]




a few suggestions:
- add a background to the "all ammo" widget
- use sprites for stimpack/quartzvial/quartzflask as health icon

and a couple of personal pet peeves
- I feel the current weapon icon is redundant, given the "viewmodel sprite" it's already there right and center
- font consistency: just like the built-in althud, this can use some tweaking.. maybe letting users choose the fontset?
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by Jekyll Grim Payne »

Delfino Furioso wrote: Sat Oct 21, 2023 12:44 am this is sweet! I get NCHUD vibes from it

I tried it and got a VM abort, but I managed to find out what was causing it
I had "screenblocks" set to "12" in my ini, due to some tests I was performing yesterday on my hud project

this is the log

Code: Select all

VM execution aborted: tried to read from address zero. In function parameter "self"
Called from CVar.GetBool at gzdoom.pk3:zscript/engine/base.zs, line 681
Called from JGPUFH_FlexibleHUD.DrawPowerups at FlexiHUD.pk3:ufhzscript/ufh_hud.zs, line 2248
Called from CVar.GetInt [Native]
I will have to look into that. Interesting. This is very strange because CVar caching is called before any other draw function, so I'm not sure how this could be caused by screenblocks. What GZDoom version did you use?

UPD: I found the culprit. This is fixed now, so you can download the repo build or wait for a new version soon. Thanks for reporting it!

Delfino Furioso wrote: Sat Oct 21, 2023 12:44 am a few suggestions:
- add a background to the "all ammo" widget
- use sprites for stimpack/quartzvial/quartzflask as health icon[/code]
The background for all ammo can easily be added. I didn't initially do it because in my mind I classify it as a "secondary element" (like powerup timers and map data) which don't use background.

As for health, I kind of consciously chose not to do it because that would require lifting the sprite off a specific item—and I don't do any specific class checks for the sake of universality. It's meant to be compatible with TCs that might not use Steampack/Quarts Flask or have sprites for them at all. There might be some roundabout way of trying to cache sprites for valid objects first, and only if it fails draw an abstract cross icon, but then there's always a chance that a specific TC has a spritename that would normally be used by Stimpack replaced with something entirely different. I'll have to think about it.

Note that a health item icon can't be lifted off the player dynamically like armor icon can.
Delfino Furioso wrote: Sat Oct 21, 2023 12:44 am - I feel the current weapon icon is redundant, given the "viewmodel sprite" it's already there right and center
The current weapon icon can be disabled, there's an option next to the ammo bar.
Delfino Furioso wrote: Sat Oct 21, 2023 12:44 am - font consistency: just like the built-in althud, this can use some tweaking.. maybe letting users choose the fontset?
I initially planned to let the user choose the font, but there are difficulties with it. For one, I'd have to come up with some kind of system for auto-scaling the font, which is difficult due to different aspect ratio of characters (some fonts are wider/taller). The other problem is how good a font looks when scaled down down: some fonts look MUCH worse than the others. Namely, NewConsoleFont (the font used in the console) is used in the map data block and powerup timers because it looks the best when scaled down to very low values; neither Smallfont or Confont do that well. It's necessary because those blocks are fairly small, and the map data lines (kills/secrets/items/time) are actually localized and auto-scale to account for different string widths so nothing sticks out anywhere.
cosmos10040
Posts: 196
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by cosmos10040 »

Fantastic hud! Is there a way to add enemies on the map like the radar mod?
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by Jekyll Grim Payne »

Anim8 wrote: Fri Oct 20, 2023 9:33 pm I did notice a couple of things.

1. The health for the enemies work on first map but when going onto the next map the health no longer shows when pointed at an enemy.

2. Some mods such as Beautiful Doom, can cause issues with the weapon slot HUD locations.
Screenshot example after typing in idkfa: https://u.cubeupload.com/Anim8/BaseProfileScreensho.png
Thank you for reporting, both of these are now fixed. Looktarget thinker is now initialized in a different place, and I redid the calculation of how weapon slots and indexes are structured. You can download the repo (do not unpack, play as is) for now, until I make a new release.
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by Jekyll Grim Payne »

cosmos10040 wrote: Sat Oct 21, 2023 12:07 pm Fantastic hud! Is there a way to add enemies on the map like the radar mod?
Not yet, but this is something I'd like to do. The only thing I'd need to figure out is scaling, because the methods for obtaining vertex/line positions and actor positions are different.
User avatar
Carrotear
Posts: 163
Joined: Thu Sep 03, 2015 10:45 pm
Preferred Pronouns: No Preference
Graphics Processor: Intel (Modern GZDoom)

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by Carrotear »

I'm getting this when I save and when it autosaves.

"Save failed
Attempt to save pointer to unhandled type NativeStruct<CVar>"
cosmos10040
Posts: 196
Joined: Mon Dec 20, 2021 6:16 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by cosmos10040 »

Carrotear wrote: Sat Oct 21, 2023 12:49 pm I'm getting this when I save and when it autosaves.

"Save failed
Attempt to save pointer to unhandled type NativeStruct<CVar>"
This also happened to me, I wasn't sure what mod caused it.
User avatar
Carrotear
Posts: 163
Joined: Thu Sep 03, 2015 10:45 pm
Preferred Pronouns: No Preference
Graphics Processor: Intel (Modern GZDoom)

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by Carrotear »

cosmos10040 wrote: Sat Oct 21, 2023 12:51 pm
Carrotear wrote: Sat Oct 21, 2023 12:49 pm I'm getting this when I save and when it autosaves.

"Save failed
Attempt to save pointer to unhandled type NativeStruct<CVar>"
This also happened to me, I wasn't sure what mod caused it.
I did think it was a mod at first, but I launched it solo with no other mods and it still happens.
User avatar
Delfino Furioso
Posts: 121
Joined: Sat Mar 27, 2021 3:21 pm

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by Delfino Furioso »

Jekyll Grim Payne wrote: Sat Oct 21, 2023 4:53 amI will have to look into that. Interesting. This is very strange because CVar caching is called before any other draw function, so I'm not sure how this could be caused by screenblocks. What GZDoom version did you use?

UPD: I found the culprit. This is fixed now, so you can download the repo build or wait for a new version soon. Thanks for reporting it!
thank YOU for fixing this, even if no sane people would use a custom HUD and keep screenblocks to 12 :)

btw im using the official 4.11.1 release, win64 build
i was able to reproduce it using a clean installation, with a local empty gzdoom_portable.ini
it would trigger if the "screenblocks 12" assignment came from the autoexec.cfg file
I guess it had to do with how/when the various engine functionalities are initialized



Jekyll Grim Payne wrote: Sat Oct 21, 2023 4:53 am
Delfino Furioso wrote: Sat Oct 21, 2023 12:44 am - use sprites for stimpack/quartzvial/quartzflask as health icon[/code]
There might be some roundabout way of trying to cache sprites for valid objects first, and only if it fails draw an abstract cross icon, but then there's always a chance that a specific TC has a spritename that would normally be used by Stimpack replaced with something entirely different. I'll have to think about it.
Note that a health item icon can't be lifted off the player dynamically like armor icon can.
don't waste too much time on this suggestion, it comes from a personal preference of a single user after all
(huds imho should either be textonly; or use abstract/digital iconography; or be consistent with the game assets - so I find that the current health icon clashes with the rest of the hud)
Jekyll Grim Payne wrote: Sat Oct 21, 2023 4:53 am
Delfino Furioso wrote: Sat Oct 21, 2023 12:44 am - font consistency: just like the built-in althud, this can use some tweaking.. maybe letting users choose the fontset?
I initially planned to let the user choose the font, but there are difficulties with it. For one, I'd have to come up with some kind of system for auto-scaling the font, which is difficult due to different aspect ratio of characters (some fonts are wider/taller). The other problem is how good a font looks when scaled down down: some fonts look MUCH worse than the others. Namely, NewConsoleFont (the font used in the console) is used in the map data block and powerup timers because it looks the best when scaled down to very low values; neither Smallfont or Confont do that well. It's necessary because those blocks are fairly small, and the map data lines (kills/secrets/items/time) are actually localized and auto-scale to account for different string widths so nothing sticks out anywhere.
this is something I can relate to, having created a few sbarinfo-based HUDs lately
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1117
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)

Re: FlexiHUD - a universal, extremely flexible HUD mod

Post by Jekyll Grim Payne »

Delfino Furioso wrote: Sat Oct 21, 2023 1:44 pm thank YOU for fixing this, even if no sane people would use a custom HUD and keep screenblocks to 12 :)

btw im using the official 4.11.1 release, win64 build
i was able to reproduce it using a clean installation, with a local empty gzdoom_portable.ini
it would trigger if the "screenblocks 12" assignment came from the autoexec.cfg file
I guess it had to do with how/when the various engine functionalities are initialized
Actually, this was purely an oversight on my part. User CVARs are cached into pointers for easier and faster access in the HUD. That caching happens as soon as the HUD begins drawing. My oversight was that the caching was conditional: it wouldn't be executed if the HUD was switched to the "None" state (which is what screeblocks 12 equals to, since the HUD is hidden). It seemed reasonable, because if the HUD was in that state, none of the drawing functions would be called either. BUT as it turns out, the BaseStatusBar class still somehow calls its DrawPowerups function if that happens—and that's the only function I was overriding to draw something rather than using a fully custom one. As a result, if the HUD was disabled at startup (screenblocks 12), DrawPowerups() would still be called and try to access a non-cached CVAR pointer, thus causing a null abort.

But like I said, it's solved now if you download the repo build (link in the first post); I simply made CVAR caching unconditional. In retrospect it's safer anyway.
Delfino Furioso wrote: Sat Oct 21, 2023 1:44 pm don't waste too much time on this suggestion, it comes from a personal preference of a single user after all
(huds imho should either be textonly; or use abstract/digital iconography; or be consistent with the game assets - so I find that the current health icon clashes with the rest of the hud)
That is totally valid reasoning. It just causes issues with implementation, because abstract iconography is something that would have to be explicitly added as actual graphics (which I purposefully avoid with this mod), while at the same time seeing the actual item icons, especially armor (where the type matters, not just amount) is important. So, for now there's no perfectly clean solution to this.

Return to “Gameplay Mods”