Ability to customize the display of notifications (& more)

Moderator: GZDoom Developers

User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Ability to customize the display of notifications (& more)

Post by Marisa the Magician »

I'm sure that other modders that have made custom HUDs can agree that this is definitely a must. The way these are drawn is hardcoded, which is annoying when you want to make a nice HUD but they will always draw on top of whatever you put on the top left (or top center), plus in the case of some HUDs one may want to have a specific location for these to display, with specific attributes and whatnot.

I have a general idea on how to do this, but I first wanted to know if this is an OK thing to do. I would be adding a little "hook" inside PrintString() to do this.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Ability to customize the display of notifications

Post by Nash »

I was tossing the idea around of some kind of virtual you'd be able to override for the top notifications, but if you have other ideas like the PrintString hook, well that's even better.

One question, will your hook also affect the center-printed messages? Like the ones called from Print() in ACS. NOT HUDMessages. I think, uh, it's called MidPrint?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Ability to customize the display of notifications

Post by Graf Zahl »

Marisa Kirisame wrote:I'm sure that other modders that have made custom HUDs can agree that this is definitely a must. The way these are drawn is hardcoded.

Well,someone needs to un-hardcode them then... ;)
There's lots of code that may benefit from getting scriptified but before this is done there first has to be a proven need.
User avatar
Kinsie
Posts: 7399
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: Ability to customize the display of notifications

Post by Kinsie »

Graf Zahl wrote:
Marisa Kirisame wrote:There's lots of code that may benefit from getting scriptified but before this is done there first has to be a proven need.
Here's one real-world example already being done in-engine: Doom Delta does some interesting things with item pickup notifications - there are multiple HUDs to choose from (all themed on pre-release versions of Doom), and the way these notifications are handled changes depending on the HUD used.

In the bar-based HUDs, item notifications loosely imitate the originals, with some different behavior (only one line visible etc.) to imitate pre-release versions.
Image

In the helmet HUD, one part is dedicated to a running log of items collected, complete with a clever bit of handling for picking up multiples of an item type within rapid proximity.
Image

There are other possibilities raised by other games of Doom's era. The Amiga FPS Gloom, for example, printed notifications on a scrolling marquee on the bar HUD...
Image

...and of course modern games and games from other genres can provide inspiration as well.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Ability to customize the display of notifications

Post by Marisa the Magician »

Well, I only needed a small amount of lines to implement this, now to test that it works.

Also while I was screwing around with it, I'm wondering how come the ZScript version of Printf doesn't allow setting the print level and always uses PRINT_HIGH.
Nash wrote:One question, will your hook also affect the center-printed messages? Like the ones called from Print() in ACS. NOT HUDMessages. I think, uh, it's called MidPrint?
Oh yeah, I forgot about those. I don't know, depends on if people want them to be customizable too (for now I personally don't have a need for it).

Edit: Aaaand it doesn't compile. Well I guess it's my first time passing a string to zscript and I really don't know how this works. Looks like neither FString nor const char* can be put inside the VMValue array. How do I do this?
Edit 2: Ok I figured it out, just had to look at another virtual that took a string.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Ability to customize the display of notifications

Post by Graf Zahl »

Marisa Kirisame wrote:Well, I only needed a small amount of lines to implement this, now to test that it works.

Also while I was screwing around with it, I'm wondering how come the ZScript version of Printf doesn't allow setting the print level and always uses PRINT_HIGH.
You have to ask ZZYZX for that, he implemented it this way.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Ability to customize the display of notifications

Post by Graf Zahl »

Marisa Kirisame wrote: Oh yeah, I forgot about those. I don't know, depends on if people want them to be customizable too (for now I personally don't have a need for it).
HUD messages are a lot trickier because all the positioning stuff is part of the message - redirecting them somewhere else will cause massive problems. The default centered message could be done but that's really it.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Ability to customize the display of notifications

Post by Marisa the Magician »

Everything seems to be working so far, although I may want to make the "say" prompt be customizable, mainly for positioning reasons too.

I'll have an example wad and PR once I'm done experimenting.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Ability to customize the display of notifications

Post by Marisa the Magician »

Alright, the pull request is up.

I'll move this to code submissions, if you don't mind.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Ability to customize the display of notifications (& mor

Post by Graf Zahl »

What's there looks good, but there's one concern I have: I know fully well how this community ticks when it comes to use of styled fonts - but one important thing here is that the text that may go through these functions may easily be non-English, even Japanese or Korean - so it is very, very easy to seriously break message display with a bad implementation!

I'm going to think a bit about how I can force users of these overrides to consider internationalization, because if I don't there will be bug reports later.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Ability to customize the display of notifications (& mor

Post by Marisa the Magician »

Yeah, I figured that might be important.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Ability to customize the display of notifications (& mor

Post by Marisa the Magician »

My heart almost skipped a beat when this got merged.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Ability to customize the display of notifications (& mor

Post by Graf Zahl »

Unfortunately I didn't have any idea how to handle the internationalization issue. These functions may not print anything themselves, so there's simply no way to do an engine check, I guess the only way is to publicly lambast the makers for being so careless... :twisted:
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Ability to customize the display of notifications (& mor

Post by Major Cooke »

What is the name for the font that is internationalized in GZDoom? That way I know what to set it to. Honestly I can live without other stylized fonts.
User avatar
Marisa the Magician
Posts: 3886
Joined: Fri Feb 08, 2008 9:15 am
Preferred Pronouns: She/Her
Operating System Version (Optional): (btw I use) Arch
Graphics Processor: nVidia with Vulkan support
Location: Vigo, Galicia
Contact:

Re: Ability to customize the display of notifications (& mor

Post by Marisa the Magician »

Actually about this issue, I first need to know two things:

1. What's the range of glyphs that an international font should cover.
2. How do I make such a font in a format that GZDoom supports.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”