Page 1 of 2

GZSHud - Gutawer's ZScript HUD

PostPosted: Sun Apr 30, 2017 12:46 pm
by Gutawer
Gutawer's ZScript HUD - a minimalist status bar-inspired HUD

Note - GZSHud requires GZDoom 3.0.0 to work properly. Update GZDoom before complaining that something is broken.

Spoiler: Screenshots

GZSHud is written entirely in ZScript, meaning that it maintains a very large amount of mod compatibility compared to previous SBARINFO HUDs where compatibility patches are necessary - specifically, the ammo bar will display ammo from any mod you throw at it, as can be seen here:
Spoiler: Mod Compatibility Screenshots

(Note - I'm not claiming full mod compatibility here, certain mods will still cause oddities, but most simple weapon packs will work just fine.)

Download
https://www.dropbox.com/s/7dbdxiyyrjysa ... d.pk3?dl=0

Other stuff

GZSHud might look like a status bar, but it works as a fullscreen HUD, so please switch to that if you want to actually use the HUD.

Check the GZSHud Options menu item for customisation options, including background box alpha, ammo bar display, etc.

Feel free to use the code to learn about ZScript status bars (I urge you to give it a go, they're pretty cool), and feel free to use parts of the code in your own projects if you want (provided I get credited).
Critique, improvements, etc. are encouraged.

So, urr... that's about it. Enjoy!

Spoiler: Updates


Spoiler: Credits

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Sun Apr 30, 2017 2:35 pm
by leodoom85
Did a little showcase of the hud :)

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Sun Apr 30, 2017 3:03 pm
by jpalomo
Gutawer wrote:These aren't in any menu, because I don't want to clash with other mods' MENUDEF lumps. Change them through the console, if you want to.


You can use AddOptionMenu in MENUDEF. If you need an example of how to use it, see Xaser's DamNums mod.

I really like the simplistic look of this. I'll give it a try.

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Sun Apr 30, 2017 3:28 pm
by Gutawer
Good point about the AddOptionMenu thing, I'll put that in the next update with the level stat stuff.

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Sun Apr 30, 2017 4:43 pm
by Gutawer
https://www.dropbox.com/s/7dbdxiyyrjysa ... d.pk3?dl=0
New version (link is the same as it was), added a menu item for the HUD's settings + level stat stuff.

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Sat Sep 09, 2017 2:32 pm
by argv
Looks cool, but murders my frame rate! FPS in a small room is down by 80% (from 100 to 20). “stat vm” (in the console) shows that it's spending a lot of time in the VM (around 20ms per frame with this mod, and 0.2ms without). Running GZDoom 3.1.0.

So, I went and optimized it. :D Now it has no noticeable performance impact. Here's the patch: https://gist.github.com/argv-minus-one/ ... 2634a0d53a

Please consider publishing your mod on a code hosting site like GitHub (https://github.com/). Then, others can observe the changes you make, and easily contribute (with pull requests).

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Sat Sep 09, 2017 6:50 pm
by Gutawer
Good call! Looking back on my original code for that... I was probably tired when I wrote that part, it's fucking awful (also, I was much newer to ZScript and wasn't aware that array.find() functioned similarly to C++'s std::vector::find(), heh) :P. I'll merge this in in a short while (though I don't plan to move GZDHud to github, it's pretty much done as of now).

EDIT: Alright, updated. The DL link in the OP should contain the newest version. Thanks for that :D.

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Sun Sep 10, 2017 9:54 pm
by argv
Oh, I didn't notice the word “minimalist”, heh. Fair enough. Hopefully there'll be more feature-rich ZScript HUDs soon.

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Mon Sep 11, 2017 3:44 pm
by TERMiNAL
This is an awesome HUD, works well with Project Brutality!

But any chance you could add mines/grenades to the hud for PB?

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Mon Sep 11, 2017 4:10 pm
by Gutawer
The code for the ammo bar & ammo display is all done automatically based on the ammo that weapons use - one goal of this mod is to showcase ZScript's ability to create mods which are inherently compatible with other mods (much moreso than previously possible using SBARINFO/DECORATE/ACS, anyway). As such, I feel that it would be going against my intent for this mod to write code specifically to support one of PB's features; many mods add hotkey grenades, and unfortunately there is no community-agreed on (or in-engine) standard for that feature, making it impossible for me to support PB's grenades without going against the point of this mod. Sorry about that.

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Tue Sep 12, 2017 12:19 pm
by Outtagum
I've only just come across this HUD. It's really pretty cool. I like the modern vibe mixed with the traditional layout and it seems to work with pretty much every Doom thing I throw at it!

I wonder, though, if you'd consider making a Heretic version or make this one Heretic compatible?

Regardless, this HUD is now on my Doom autoload list. Thank you. :)

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Sat Oct 07, 2017 12:42 pm
by Gutawer
Sorry about taking so long to respond, but yeah I'll have a go at adding Heretic support, along with an update I've been planning to add a fullscreen mode with the boxes off in the corners.

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Mon Nov 18, 2019 7:09 am
by Barry Burton
Apologies for the bump but I thought I should mention that the HUD doesn't seem to function correctly for me in GZDoom 4.2.4. While the stat numbers are updated there is no health bar and the armour bar seems to stay yellow.

I wonder if there's any chance of an update? Being a nice mix of modern aesthetic and old school layout it looks really pretty. :)

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Mon Nov 18, 2019 7:32 am
by Gutawer
I've been aware of these issues for a while but didn't fix them due to not knowing if anyone actually used the HUD, heh. I'll take a look at fixing it now that someone's asked about it. Thanks!

EDIT: Fixed. Here's a new link: https://www.dropbox.com/s/7dbdxiyyrjysa ... d.pk3?dl=0

If anyone's curious on why this broke cross-versions, I was accidentally relying on undefined behaviour related to the lack of implicit defaulting for values declared in ZScript in the past. Now, ZScript does implicitly provide a default values for variables, so my code broke.

Re: GZSHud - Gutawer's ZScript HUD

PostPosted: Mon Nov 18, 2019 12:31 pm
by Barry Burton
Thanks so much for your quick reply and super quick fix. All's running well now. It looks particularly good with D4V. :)