[Added] Ability to customize the display of notifications (& more)

Moderator: GZDoom Developers

Ability to customize the display of notifications (& more)

Postby Marisa Kirisame » Thu Aug 15, 2019 7:49 pm

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
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Ability to customize the display of notifications

Postby Nash » Thu Aug 15, 2019 9:19 pm

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
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Ability to customize the display of notifications

Postby Graf Zahl » Fri Aug 16, 2019 1:16 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Ability to customize the display of notifications

Postby Kinsie » Fri Aug 16, 2019 3:15 am

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
Kinsie
A Concept Utterly Obsolete
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: Ability to customize the display of notifications

Postby Marisa Kirisame » Fri Aug 16, 2019 4:32 am

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
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Ability to customize the display of notifications

Postby Graf Zahl » Fri Aug 16, 2019 4:33 am

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 Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Ability to customize the display of notifications

Postby Graf Zahl » Fri Aug 16, 2019 4:34 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Ability to customize the display of notifications

Postby Marisa Kirisame » Fri Aug 16, 2019 7:00 am

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 Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Ability to customize the display of notifications

Postby Marisa Kirisame » Fri Aug 16, 2019 11:59 am

Alright, the pull request is up.

I'll move this to code submissions, if you don't mind.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby Graf Zahl » Fri Aug 16, 2019 2:40 pm

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Marisa Kirisame » Fri Aug 16, 2019 3:28 pm

Yeah, I figured that might be important.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby Marisa Kirisame » Mon Aug 19, 2019 2:33 pm

My heart almost skipped a beat when this got merged.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

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

Postby Graf Zahl » Mon Aug 19, 2019 2:51 pm

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Major Cooke » Mon Aug 19, 2019 2:56 pm

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
Major Cooke
Do unto others as you would have unto you. Judge yourself first.
 
Joined: 28 Jan 2007

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

Postby Marisa Kirisame » Mon Aug 19, 2019 3:15 pm

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.
User avatar
Marisa Kirisame
ZScript Magician
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
Graphics Processor: nVidia with Vulkan support

Next

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest