Ability to customize the display of notifications (& more)
Moderator: GZDoom Developers
- 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)
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.
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.
Re: Ability to customize the display of notifications
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?
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?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Ability to customize the display of notifications
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.
- 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
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.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.
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.
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.
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...
...and of course modern games and games from other genres can provide inspiration as well.
- 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
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.
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.
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.
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).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?
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Ability to customize the display of notifications
You have to ask ZZYZX for that, he implemented it this way.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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Ability to customize the display of notifications
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.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).
- 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
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.
I'll have an example wad and PR once I'm done experimenting.
- 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:
- Graf Zahl
- 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
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.
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.
- 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
Yeah, I figured that might be important.
- 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
My heart almost skipped a beat when this got merged.
- Graf Zahl
- 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
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...
- 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
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.
- 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
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.
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.