[Rant] Mods that use HUD Messages

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

[Rant] Mods that use HUD Messages

Postby Nash » Thu Jan 19, 2012 9:54 am

I have been holding back about this topic - for a few years - but I think it's time I talk about it, because I think it is a somewhat serious issue and awareness needs to be raised about it, as I don't want mods to be continuously created with this annoyance.

The issue is regarding HUD messages. It is good that mod authors are using these, but time and again, they have failed to address a VERY important issue: the fact that not everyone is using the same screen resolution.

I am a 1920x1200 user, and with a screen that large, the standard Doom font appears VERY tiny unscaled. So I turn on the "scale messages" option. I turn it to ON, not DOUBLE, because I want my fonts to be large and clear. I don't mind the fonts being large and pixelated - since Doom is an old game anyway (and I turn off filtering with GZDoom).

So what's the problem? Well, when mods start using HUDMessage() without explicitly specifying the virtual resolution first (SetHUDSize()).

More often than not, what happens is that when I start playing mods that use these HUD message functions, I just see... a bunch of mess on my screen. Large overlapping texts all over the place (as was the case with Serpent: Resurrection and Reelism).

This forces me to change my message scaling settings everytime I play a mod with HUD message problems (setting it to either double or off; depending on the mod and the amount of text mess I'm seeing on the screen). And when I want to play regular Doom again, I'll have to AGAIN change the setting to my usual setting (which will be ON, since anything other than that just isn't comfortable enough for me).

So what am I proposing? Mod authors, please be aware that not using SetHUDSize can cause annoyance for some users, because not every user uses the same screen resolution and message scaling settings as you (and the latter, WILL tamper with the appearance of your printed HUD messages).

Here are some valid solutions:

1) Predetermine a HUD size so that the message will appear at a consistant size, independant of the user's screen settings (SetHudSize). This is a modding convention that I have practiced for many years, even before I noticed my first annoyance with the issue at hand.

2) If you don't want to force the user to view the HUD message at a predetermined size, then modify your text drawing functions to take into account of the user's text scale settings - scaled and unscaled. Use GetCVar to find the user's settings, and adjust your drawing functions accordingly.

3) Allow the user to choose how the text is drawn, either via a keybind, an in-game option toggleable via an ACS-driven menu or something, etc. Let the user choose to leave the text unscaled, or scaled (in which case, SetHUDSize again).

That is all. I hope mod authors can take this seriously, and perhaps this becomes a modding standard.
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: [Rant] Mods that use HUD Messages

Postby Jimmy » Thu Jan 19, 2012 10:10 am

FWIW, Nash, I have similar gripes for those who aren't considerate, but as someone who plays with HUDmessages a lot myselfs (and tries to consider the factors you mentioned), I can say that it's not always easy.

I also always try to bear the display settings of others in mind, but I'm constricted to a 1280x800 maximum resolution, so I have next to no clue of what I'm making will look like to those who aren't. Obviously things like my custom ACS dialogue system require the HUDmessages to always stay a certain distance apart, and so they appear the same in pretty much all resolutions because I use SetHudSize. On the rare occasions where I don't use it (since I consider it prudent to not force a HUDmessage size on the player if it's not necessary - especially if there's a lot of text and condensing it down would bug users who might be stuck on smaller resolutions like 800x600), I try to get the positions and spacings correct, but of course I only have my own resolution/text scaling options to confirm how they look. I think I have a rule of thumb which basically says that my HUDmessages are always spaced vertically by an absolute minimum of 0.08 when SetHudSize isn't being used, but I'm not entirely sure that this is sufficient.

Nash, I'm curious - how does Jukebox's now playing message system/playlist display look to you?
User avatar
Jimmy
 
 
 
Joined: 10 Apr 2006
Discord: Jimmy#4100
Twitch ID: JimmySquared
Operating System: Windows 10/8.1/8/201x 64-bit

Re: [Rant] Mods that use HUD Messages

Postby Enjay » Thu Jan 19, 2012 1:51 pm

Jimmy wrote:but I'm constricted to a 1280x800 maximum resolution, so I have next to no clue of what I'm making will look like to those who aren't.

That's a fair point. I too try to get things looking acceptable as far as possible and I do try to force different resolutions and ratios when I am testing a mod but, like with most authors, it is often difficult to try a large number of combinations of hardware.

However, Nash's point is well made and if people want their mod to be accessible to as many users as possible then it makes sense to consider and to try to accommodate different setups as the author can (especially when the problem at hand is a relatively trivial one to address). I also appreciate that it is very easy to forget and, equally, it is very easy (especially for less experienced modders) to not even realise that such problems can exist. Which I guess is what this thread is, at least in part, trying to address.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: [Rant] Mods that use HUD Messages

Postby chopkinsca » Thu Jan 19, 2012 2:16 pm

Related: I just fixed a bug in my project where I forgot to set the hud size in script. I can't imagine using HudMessages without SetHudSize.
User avatar
chopkinsca
Nothing
 
Joined: 11 Dec 2003

Re: [Rant] Mods that use HUD Messages

Postby NeuralStunner » Thu Jan 19, 2012 3:53 pm

chopkinsca wrote:I can't imagine using HudMessages without SetHudSize.
Neither can I. I find the default fixed-point coordinates horribly unintuitive, especially when just about everything else in ZDoom uses pixel coordinates.

So I ues SetHudSize as much for my own benefit as for anyone else's. :P
User avatar
NeuralStunner
not actually a catgirl
 
 
 
Joined: 21 Jul 2009
Location: =o_O=
Discord: NeuralStunner#4201
Operating System: Windows Vista/7/2008 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: [Rant] Mods that use HUD Messages

Postby Kinsie » Fri Jan 20, 2012 5:08 am

Oh sweet, now I have to choose between public shame by someone with a hipster screen resolution or making my fonts look like absolute shit from poor scaling.

Thanks Nash, this is the best Christmas ever.
User avatar
Kinsie
Dog Days
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: [Rant] Mods that use HUD Messages

Postby Kinsie » Fri Jan 20, 2012 5:16 am

Seriously. This looks like a dog threw it up. If this is the right way, I think I was happier doing things all wrong.
Image
User avatar
Kinsie
Dog Days
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: [Rant] Mods that use HUD Messages

Postby Nash » Fri Jan 20, 2012 5:18 am

I meant no offense from this. The 2 projects I mentioned in my first post are just the 2 most recent that I've played and quickly comes to mind at the time of posting. Truth is, this little pet peeve has bothered me for many, many years with lots of ZDoom-specific mods. If it would really help prove that I am not simply targetting specific mods (and make it seem like a personal attack), I can go through my collection of ZDoom mods and listen down every single mod that demonstrates this issue.

More importantly, the message that I really meant to convey is:

HUDMessages, when used alone, without SetHUDSize, WILL get messed up because several user options influence the way it is rendered.
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: [Rant] Mods that use HUD Messages

Postby Nash » Fri Jan 20, 2012 5:19 am

Kinsie:

Your multiline issues can be solved by either using \n, or keeping track of the Y position of the last printed HUDMessage, then offsetting the new HUDMessage using that stored variable.
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: [Rant] Mods that use HUD Messages

Postby Kinsie » Fri Jan 20, 2012 5:21 am

Nash wrote:Kinsie:

Your multiline issues can be solved by either using \n, or keeping track of the Y position of the last printed HUDMessage, then offsetting the new HUDMessage using that stored variable.
This has nothing to do with the Y positioning, I'm fixing those fine. It has EVERYTHING to do with the font itself looking poorly scaled like a bad MSPaint.

And don't tell me to use OpenGL filters to fix it. I'm not telling you to play in Doubled message size in a 1024x768 window, now am I?
User avatar
Kinsie
Dog Days
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: [Rant] Mods that use HUD Messages

Postby Nash » Fri Jan 20, 2012 5:24 am

If you want to maintain the unscaled look, then do SetHUDSize(GetCVar("vid_defwidth"), GetCVar("vid_defheight"), [0, 1]).
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: [Rant] Mods that use HUD Messages

Postby Nash » Fri Jan 20, 2012 5:28 am

And to help with resolution-independant positioning, these functions will be useful. I'm trying to be helpful here!

Code: Select allExpand view
// GetAspectRatio() by blzut3

#libdefine ASPECT_4_3 (4.0 / 3)
#libdefine ASPECT_5_4 1.25
#libdefine ASPECT_16_9 (16.0 / 9)
#libdefine ASPECT_16_10 1.6

function int GetAspectRatio(void)
{
    
int width GetCVar("vid_defwidth");
    
int height GetCVar("vid_defheight");
    
int nowidescreen GetCVar("vid_nowidescreen");
    
int tft GetCVar("vid_tft");
    
int aspect GetCVar("vid_aspect");
    
    switch(
aspect)
    {
        case 
1:     return ASPECT_16_9;
        case 
2:     return ASPECT_16_10;
        case 
3:     return ASPECT_4_3;
        case 
4:     return ASPECT_5_4;
    }
    
    if(
nowidescreen)
    {
        if(!
tft)
            return 
ASPECT_4_3;
        if(
FixedMul(height << 16FixedDiv(5.04.0)) == width << 16)
            Return 
ASPECT_5_4;
        else
            return 
ASPECT_4_3;
    }
    
    if(
abs((abs(FixedMul(height << 16FixedDiv(16.09.0))) >> 16) - width) < 10)
    {
        return 
ASPECT_16_9;
    }
    
    if(
abs((abs(FixedMul(height << 16FixedDiv(16.010.0))) >> 16) - width) < 60)
    {
        if((
width == 320 && height == 200) || (width == 640 && height == 400))
            return 
ASPECT_4_3;
        return 
ASPECT_16_10;
    }
    
    if(
FixedMul(height << 16FixedDiv(5.04.0)) >> 16 == width && tft)
    {
        return 
ASPECT_5_4;
    }
    
    return 
ASPECT_4_3;
}

// HUD edge positioning functions by bagheadspidey
function int GetHUDRight(int w)
{
    
int ar GetAspectRatio();

    if (
ar == ASPECT_16_10)
    {
        return 
+ (FixedDiv(<< 16,10.0) >> 16);
    }

    if (
ar == ASPECT_16_9)
    {
        return 
+ (FixedDiv(<< 16,5.9) >> 16);
    }

    return 
w;
}

function 
int GetHUDLeft(int w)
{
    return 
GetHUDRight(w);
}
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: [Rant] Mods that use HUD Messages

Postby Kinsie » Fri Jan 20, 2012 5:31 am

Nash wrote:If you want to maintain the unscaled look, then do SetHUDSize(GetCVar("vid_defwidth"), GetCVar("vid_defheight"), [0, 1]).

Code: Select allExpand view
Line 381 in file "C:\Games\Doom\Editors\Doom Builder 2\Compilers\ZDoom\SPLOT.acs" ...
C:\Games\Doom\Editors\Doom Builder 2\Compilers\ZDoom\SPLOT.acs:381: Syntax error in expression.
>  SetHUDSize(GetCVar("vid_defwidth"), GetCVar("vid_defheight"), [0
>                                                                ^
C:\Games\Doom\Editors\Doom Builder 2\Compilers\ZDoom\SPLOT.acs:381: Missing ')'.
>  SetHUDSize(GetCVar("vid_defwidth"), GetCVar("vid_defheight"), [0,
>                                                                 ^
User avatar
Kinsie
Dog Days
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: [Rant] Mods that use HUD Messages

Postby Nash » Fri Jan 20, 2012 5:32 am

You're supposed to change the [0, 1] to EITHER 0 or 1, depending on whether you want the statusbar to influence the rendering. :P SetHudSize

And also, GetAspectRatio() uses abs()... if you don't have that, here it is:

Code: Select allExpand view
function int abs (int x)
{
    if (
0)
        return -
x;

    return 
x;
}
 
User avatar
Nash
Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: [Rant] Mods that use HUD Messages

Postby Kinsie » Fri Jan 20, 2012 5:38 am

Nash wrote:You're supposed to change the [0, 1] to EITHER 0 or 1, depending on whether you want the statusbar to influence the rendering. :P SetHudSize
 [/code]

Right then. Works perfect now (with a little tweak to forcibly double the font size properly).

But how do I center text on screen now? I can't just use 0.5 or whatever anymore. I tried (GetCVar("vid_defwidth") / 4) but it obviously didn't work right due to not getting a .0 on the end.
User avatar
Kinsie
Dog Days
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest