Jump to content
The Dark Mod Forums

Subtitles - Possibilities Beyond 2.11


Geep

Recommended Posts

Posted (edited)

I gather you're looking to shorten the backing fields, to improve world viewing. Reasonable.

Certainly I could put a translucent box behind the widget, much as you have shown. Except, for reasons discussed above, I can't spare that many pixels vertically. So the widget top edge would be at the box top edge, and the widget bottom edge would still be close to the top of the text chars. Probably a tight fit on the sides would look better in that case.

EDIT: Maybe the widget can jut more into the gap between fields, so a few pixels can be stolen.

I don't think I can get the gui itself to draw a translucent background in an oval, instead of a rectangle. The widget image itself could have a translucent background within the oval, but it would be hard to match alpha'ing with the text backing field. Alternatively, as mentioned before, you could forgo a widget background and just have an opaque widget interior. Maybe 2 shades of gray to denote the sector.

BTW, I noticed your white widget had a yellow center dot. Was that on purpose, or just an artifact of making a yellow version?

Edited by Geep
Link to comment
Share on other sites

20 minutes ago, Geep said:

Certainly I could put a translucent box behind the widget, much as you have shown. Except, for reasons discussed above, I can't spare that many pixels vertically. So the widget top edge would be at the box top edge, and the widget bottom edge would still be close to the top of the text chars.

All the space we need is already available in this screenshot:

testSubtitlesDrunk (2024-01-04 11-59-20) (0 75.5 4.25).jpg

Leave ~two pixels top and bottom for the text. Move the widget up by a pixel or two.

plenty-of-space.jpg

20 minutes ago, Geep said:

I don't think I can get the gui itself to draw a translucent background in an oval, instead of a rectangle. The widget image itself could have a translucent background within the oval, but it would be hard to match alpha'ing with the text backing field. Alternatively, as mentioned before, you could forgo a widget background and just have an opaque widget interior. Maybe 2 shades of gray to denote the sector.

Forget about this for the moment. Just leave the widget outside of any backgrounds (if you aren't sure how to create a dedicated background for it).

20 minutes ago, Geep said:

BTW, I noticed your white widget had a yellow center dot. Was that on purpose, or just an artifact of making a yellow version?

Does it? Probably I mixed up things at some point, I don't know. My current white is ok. Added to the list of things to check in the future.

widget.jpg

Edited by snatcher

TDM_Modpack_Thumb.png

Link to comment
Share on other sites

Posted (edited)

Um, maybe the dot in the center is just not fully opaque in its center.

Anyway, here's the latest version. Also, the location of the red dot may have been off by 0.5px vertically in the previous versions (and maybe the beta?). Fixed.
 

Spoiler

/**
 * stgatilov: This GUI header is included many times into subtitles GUI
 *
 * Mission Authors: DO NOT EDIT, INCLUDE OR OVERRIDE THIS FILE IN YOUR MISSION PK4.
 */

//must be defined outside: which subtitle slot to generate
//#define SUBTITLE_IDX 3
//#define SUBTITLE_DIGIT "3"
// Currently, lowest slot is 0, highest is 2

//preprocessor magic for composing window names
#define SUBTITLES_CONCAT3X(a, b, c) a##b##c
#define SUBTITLES_CONCAT3(a, b, c) SUBTITLES_CONCAT3X(a, b, c)

#define SUBTITLE_BASE_Y (379 - 50 * SUBTITLE_IDX)
#define SUBTITLE_NONEMPTY SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_nonempty")
#define SUBTITLE_ALPHA SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_alpha")
#define SUBTITLE_SPATIALIZED SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_spatialized")
#define SUBTITLE_LOCATION_X SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_locationXclamped")
#define SUBTITLE_LOCATION_Y SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_locationYclamped")

// SUBTITLE_MARGIN_DIFF's value will be 0 with a "story" subtitle; otherwise, value is 100.
// 100 is the difference between horizontal field margin for nonstory (200) and story (100):
#define SUBTITLE_VERBOSITY SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_verbosity")
#define SUBTITLE_MARGIN_DIFF ((SUBTITLE_VERBOSITY) == 1 ? 0 : 100)

windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesTextHolder, SUBTITLE_IDX)
{
    rect        (102.5 + SUBTITLE_MARGIN_DIFF), SUBTITLE_BASE_Y, 435 - (2 * SUBTITLE_MARGIN_DIFF), 37
    backcolor    SUBTITLES_TEXT_BACKCOLOR
    bordercolor    SUBTITLES_TEXT_BORDERCOLOR
    visible        SUBTITLE_NONEMPTY

    windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesText, SUBTITLE_IDX)
    {
        // #5914: engine allows overflowing textbox size by one character. As of 2.12,
        // maximum likely character width is 7.5 (among lower-case ASCII, Stone at textscale 0.25, width-compressed by 0.75)
        // so leave horizontal padding 7.5 on the right, and same on left to improve text centering appearance.
        rect        7.5, 0, 420 - (2 * SUBTITLE_MARGIN_DIFF), 37
        text        SUBTITLES_CONCAT("gui::subtitle", SUBTITLE_DIGIT)
        font        SUBTITLES_TEXT_FONT
        textscale    SUBTITLES_TEXT_SCALE
        textAlign    1
        forecolor    SUBTITLES_TEXT_FORECOLOR
    }
}

windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesLocationBacking, SUBTITLE_IDX)
{
    rect        307, SUBTITLE_BASE_Y-12, 26, 12
    visible        SUBTITLE_NONEMPTY && SUBTITLE_SPATIALIZED
    backcolor    SUBTITLES_TEXT_BACKCOLOR
    bordercolor    SUBTITLES_TEXT_BORDERCOLOR
    visible        SUBTITLE_NONEMPTY
}
windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesLocationRing, SUBTITLE_IDX)
{
    rect        310, SUBTITLE_BASE_Y-10, 20, 14
    visible        SUBTITLE_NONEMPTY && SUBTITLE_SPATIALIZED
    background    "guis/assets/common/subtitle_location_ring"
    matcolor    1,1,1,SUBTITLE_ALPHA
}
windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesLocationPoint, SUBTITLE_IDX)
{
    rect        317.5 - 9 * SUBTITLE_LOCATION_Y, SUBTITLE_BASE_Y - 5.5 - 6 * SUBTITLE_LOCATION_X, 5, 5
    visible        SUBTITLE_NONEMPTY && SUBTITLE_SPATIALIZED
    background    "guis/assets/common/frobhelper"
    matcolor    1,0,0,1
}

windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesDebugText, SUBTITLE_IDX)
{
    rect        100 + SUBTITLE_MARGIN_DIFF, SUBTITLE_BASE_Y + 31, 440 - (2 * SUBTITLE_MARGIN_DIFF), 45
    text        SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_debug")
    visible        SUBTITLE_NONEMPTY
    font        SUBTITLES_TEXT_FONT
    textscale    0.15
    forecolor    0.5,1,0.5,1
}


#undef SUBTITLE_IDX
#undef SUBTITLE_DIGIT

#undef SUBTITLES_CONCAT3X
#undef SUBTITLES_CONCAT3

#undef SUBTITLE_BASE_Y
#undef SUBTITLE_NONEMPTY
#undef SUBTITLE_ALPHA
#undef SUBTITLE_SPATIALIZED
#undef SUBTITLE_LOCATION_X
#undef SUBTITLE_LOCATION_Y

#undef SUBTITLE_VERBOSITY
#undef SUBTITLE_MARGIN_DIFF

testSubtitlesDrunk (2024-01-04 19-31-35) (0 75.5 4.25).jpg

Edited by Geep
  • Like 1
Link to comment
Share on other sites

7 hours ago, nbohr1more said:

Hmm... the background image seems to be doing a naive relative attenuation. I wonder if we could configure a shader with a max rgb that is always some percentage darker than the text color

min ( value, ( textcolor * 0.7 ))

I'll see if I can locate where the behavior is defined.

the definition is just using backcolor set to all black with 50% alpha

should be able to create a material with a translucent filter effect and replace backcolor with background /material/path

  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

OK here is a mockup:

zzzz_subdark.pk4

It currently doesn't work as an overlay to movies or purely gui elements ( probably need to toggle back to the simple behavior on those )... but it works to prevent background lights from making the text illegible.

Try it out :)

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

10 hours ago, Geep said:

Anyway, here's the latest version.

Very well done, Geep! Remove the second "visible" parameter from SubtitlesLocationBacking and we have a RC1 (Release Candidate 1). What do you think of the result so far?

You mentioned your version of the code didn't make into the beta for whatever reason. @stgatilov should run a sanity check now.

10 hours ago, Geep said:

Also, the location of the red dot may have been off by 0.5px vertically in the previous versions (and maybe the beta?). Fixed.

It was intentionally off from the beginning to support the 3D illusion, along with the thickness on lower half of the ellipse. I don't mind it one way or the other.

Edited by snatcher

TDM_Modpack_Thumb.png

Link to comment
Share on other sites

1 hour ago, snatcher said:

It was intentionally off from the beginning to support the 3D illusion, along with the thickness on lower half of the ellipse. I don't mind it one way or the other.

Actually, you can notice in my graphic I moved the center point a couple of pixels back because otherwise there was too much "empty space", if you know what I mean. Having the red dot off by half unit compensates in a way for that.

EDIT - The above statement about the red dot is BS because the dots are more far away from each other that way. I don't know, having both the center point and the red dot a little off in opposite ways looks good to me. The widget (source) isn't pixel perfect but it gives the idea that there's more room ahead of you than behind. I don't know 😊

Edited by snatcher

TDM_Modpack_Thumb.png

Link to comment
Share on other sites

4 hours ago, nbohr1more said:

It currently doesn't work as an overlay to movies or purely gui elements ( probably need to toggle back to the simple behavior on those )... but it works to prevent background lights from making the text illegible.

Try it out :)

I get this consistent behavior when moving the mouse around.

newjob-2024-01-05-10-38-53-66-76-1727-26

newjob-2024-01-05-10-45-02-167-65-410-57

TDM_Modpack_Thumb.png

Link to comment
Share on other sites

16 hours ago, MirceaKitsune said:

Technically both could be done with a script. So if I ever need it I might put together such a dialogue system myself in a custom entity. Would definitely be fun to see someone else experiment with this through the new subtitles though.

Yeah I think everything can be done already.

Every cutscene needs seperate camera viewpoints, but this has been done before in missions I think.

Multiple choice gui with dialog options. When you select one, you get a new dialogue option, or a script runs and something happens.

Link to comment
Share on other sites

6 hours ago, snatcher said:

I get this consistent behavior when moving the mouse around.

newjob-2024-01-05-10-38-53-66-76-1727-26

newjob-2024-01-05-10-45-02-167-65-410-57

can you confirm that your heatHaze_dark.fs file looks like:
 

Spoiler


/*****************************************************************************
The Dark Mod GPL Source Code

This file is part of the The Dark Mod Source Code, originally based
on the Doom 3 GPL Source Code as published in 2011.

The Dark Mod Source Code is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the License,
or (at your option) any later version. For details, see LICENSE.TXT.

Project: The Dark Mod (http://www.thedarkmod.com/)

******************************************************************************/
#version 140
// !!ARBfp1.0

in vec4 var_tc1;
in vec4 var_tc2;
out vec4 draw_Color;
uniform sampler2D u_texture0;
uniform sampler2D u_texture1;
uniform vec4 u_scalePotToWindow;
uniform vec4 u_scaleWindowToUnit;

void main() {
    // OPTION ARB_precision_hint_fastest;
    
    // texture 0 is _currentRender
    // texture 1 is a normal map that we will use to deform texture 0
    //
    // env[0] is the 1.0 to _currentRender conversion
    // env[1] is the fragment.position to 0.0 - 1.0 conversion
    
    vec4 localNormal, R0;                                                                               //TEMP    localNormal, R0;
    
    vec4 subOne = vec4(-1, -1, -1, -1);                                                                 //PARAM    subOne = { -1, -1, -1, -1 };
    vec4 scaleTwo = vec4(2, 2, 2, 2);                                                                   //PARAM    scaleTwo = { 2, 2, 2, 2 };
    
    // load the filtered normal map and convert to -1 to 1 range
    localNormal = texture(u_texture1, var_tc1.xy);                                                      //TEX        localNormal, fragment.texcoord[1], texture[1], 2D;
//    localNormal.x = localNormal.a;                                                                      //MOV        localNormal.x, localNormal.a;
    localNormal = (localNormal) * (scaleTwo) + (subOne);                                                //MAD        localNormal, localNormal, scaleTwo, subOne;
    localNormal.z = sqrt(max(0, 1-localNormal.x*localNormal.x-localNormal.y*localNormal.y));
    
    // calculate the screen texcoord in the 0.0 to 1.0 range
    R0 = (gl_FragCoord) * (u_scaleWindowToUnit);                                                        //MUL        R0, fragment.position, program.env[1];
    
    // offset by the scaled localNormal and clamp it to 0.0 - 1.0
    R0 = clamp((localNormal) * (var_tc2) + (R0), 0.0, 1.0);                                             //MAD_SAT    R0, localNormal, fragment.texcoord[2], R0;
    
    // scale by the screen non-power-of-two-adjust
    R0 = (R0) * (u_scalePotToWindow);                                                                   //MUL        R0, R0, program.env[0];
    
    // load the screen render
    //draw_Color.xyz = texture(u_texture0, R0.xy).xyz;                                                    //TEX        result.color.xyz, R0, texture[0], 2D;
    draw_Color = min( (texture(u_texture0, R0.xy)), vec4(0.2, 0.2, 0.2, 1.0));                      //TEX        result.color.xyz, R0, texture[0], 2D;
    
}

 

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

7 hours ago, snatcher said:

Remove the second "visible" parameter from SubtitlesLocationBacking

I dunno, it seems to me that if you're not going to show the ring widget (because, say, it's the narrator talking, so second parameter SUBTITLE_SPATIALIZED is false), you shouldn't show the tab it sits on either.

About the red dot location. I understand what you are saying about perspective earlier, but that might have been more apt when the ring had a thicker lower edge. As it is, I tested by first facing the sound source, then turning 180 degrees. I expect the red dot to be about the same distance from the ring perimeter... that's why I tweaked by 0.5 px

Quote

[...] we have a RC1 (Release Candidate 1)

Hmm, maybe we should at least try to get subtitle font color among the possible CVars. That is probably the least controversial. I see the choice as either to be fully flexible (triplet for RGB) or, easier for the user, just a boolean (white vs yellow). Either would work for me. You guys?

BTW, it is possible to markup particular words in the subtitle with a primary color, for emphasis. @datiswous, you asked about this a while ago. Did you actually apply it to any game FM?

The 2 obvious colors for emphasis are red and yellow. A yellow emphasis would be lost if all the text was yellow.

Another potential problem: if the fake drop shadows were an option, then the markup would also override the black shadow with color, leading to the emphasized word becoming an unreadable blob. (This could be resolved by the engine providing a second version of the text string, stripped of markup.) Otherwise, maybe a policy for subtitlers: "no markup on subtitles"

 

Link to comment
Share on other sites

@Geep

You must settle on something that is ready to be shipped and "submit" it to @stgatilov for review and approval asap. The next build might be around the corner and it may very well be your last chance.

You have a whole year ahead to improve and innovate. Players will enjoy your work up until this day in the meantime.

Cheers!

TDM_Modpack_Thumb.png

Link to comment
Share on other sites

4 hours ago, Geep said:

BTW, it is possible to markup particular words in the subtitle with a primary color, for emphasis. @datiswous, you asked about this a while ago. Did you actually apply it to any game FM?

The 2 obvious colors for emphasis are red and yellow. A yellow emphasis would be lost if all the text was yellow.

No I didn't. Why yellow btw? I think yellow is relatively close to white, so I would rather go for red and blue or green I think.

But thanks for the reminder. Interesting to check this out.

 

2 hours ago, snatcher said:

You must settle on something that is ready to be shipped and "submit" it to @stgatilov for review and approval asap. The next build might be around the corner and it may very well be your last chance.

Let's not rush things..

Link to comment
Share on other sites

On 1/4/2024 at 11:13 PM, snatcher said:

Forget about this for the moment. Just leave the widget outside of any backgrounds (if you aren't sure how to create a dedicated background for it).

I think it looks much better when included in the subtitle background block.

Link to comment
Share on other sites

I really like the location ring image by @snatcher , the white symmetric one with a sector.
I'd like to replace the current image with it.

@snatcher, could you please share it for download?
Thus far I can only see enlarged jpeg version, but I think tga/png version is needed.
 

Also, big thumbs up for outlined font version.

This was my first idea when subtitles were initially implemented, but I did not manage to make this outlining. I added "dilate" image processing function and applied it to the font atlas. But then letter boxes in atlas must be enlarged, and the whole atlas needs to be repacked because otherwise there is not enough padding.

Rendering the text with 4 shifts sounds stupid but solves the problem in much better way.


As for layout and spacing of subtitles, I think it would be everlasting discussion. Everyone has his own taste regarding this.

It might be OK to shift the subtitles up and down. But all the discussions about making them narrower/wider or removing padding (basically, everything which may affect text layout) is potentially breaking, so I'd prefer not to do such changes unless it is crucial.

Link to comment
Share on other sites

36 minutes ago, stgatilov said:

@snatcher, could you please share it for download?

Download the "White" or "Geep" version from this post.

Latest code by Geep can be found in this post (the second "visible" parameter from SubtitlesLocationBacking must be removed).

39 minutes ago, stgatilov said:

Rendering the text with 4 shifts sounds stupid but solves the problem in much better way.

Unless we are talking different things text must be rendered with 8 shifts, otherwise it doesn't look as good: top-left, top, top-right, right, bottom-right, bottom, bottom-left, left.

TDM_Modpack_Thumb.png

Link to comment
Share on other sites

Posted (edited)
15 hours ago, stgatilov said:

It might be OK to shift the subtitles up and down. But all the discussions about making them narrower/wider or removing padding (basically, everything which may affect text layout) is potentially breaking, so I'd prefer not to do such changes unless it is crucial.

I have been quite careful to ensure that making the subtitles narrower for barks (but not story verbosity) is not potentially breaking. Examples of this treatment have been included in all my more recent testSubtitles... releases. Yes, this is "crucial" for me.

Regarding the padding issue, to restate: TDM 2.11 and on through the 2.12 released beta version use a subtitle right text padding of 20 px. While some padding is necessary, this does a poor job of centering the text visually in the backing field. This is obvious with a short bark. My redo of this, with padding of 7.5px on both sides, fixes it, while I believe not causing any problems for word wrap of subtitles with the given compressed font & scale. I'm provided several versions above of this fix (code hidden as Spoiler). Most recently, this was with snatcher's suggested tabbed location ring and vertically-tighter backing field, here

This version will also be incorporated into testSubtitlesDrunk, to be released tomorrow just released. I would urge you to incorporate this code (or a close variant) into the next beta release.

Edited by Geep
testSubtitlesDrunk released now
  • Like 2
Link to comment
Share on other sites

On 1/5/2024 at 6:30 PM, Geep said:

I dunno, it seems to me that if you're not going to show the ring widget (because, say, it's the narrator talking, so second parameter SUBTITLE_SPATIALIZED is false), you shouldn't show the tab it sits on either.

In your code you have a duplicated "visible" line. The last line needs to be removed. Excuse if I didn't make myself clear.

Quote

windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesLocationBacking, SUBTITLE_IDX)
{
    rect        307, SUBTITLE_BASE_Y-12, 26, 12
    visible        SUBTITLE_NONEMPTY && SUBTITLE_SPATIALIZED
    backcolor    SUBTITLES_TEXT_BACKCOLOR
    bordercolor    SUBTITLES_TEXT_BORDERCOLOR
    visible        SUBTITLE_NONEMPTY
}

  • Like 1

TDM_Modpack_Thumb.png

Link to comment
Share on other sites

14 minutes ago, snatcher said:

In your code you have a duplicated "visible" line. The last line needs to be removed.

Ah, got it. Thanks. Corrected version:

Spoiler

/**
 * stgatilov: This GUI header is included many times into subtitles GUI
 *
 * Mission Authors: DO NOT EDIT, INCLUDE OR OVERRIDE THIS FILE IN YOUR MISSION PK4.
 */

//must be defined outside: which subtitle slot to generate
//#define SUBTITLE_IDX 3
//#define SUBTITLE_DIGIT "3"
// Currently, lowest slot is 0, highest is 2

//preprocessor magic for composing window names
#define SUBTITLES_CONCAT3X(a, b, c) a##b##c
#define SUBTITLES_CONCAT3(a, b, c) SUBTITLES_CONCAT3X(a, b, c)

#define SUBTITLE_BASE_Y (379 - 50 * SUBTITLE_IDX)
#define SUBTITLE_NONEMPTY SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_nonempty")
#define SUBTITLE_ALPHA SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_alpha")
#define SUBTITLE_SPATIALIZED SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_spatialized")
#define SUBTITLE_LOCATION_X SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_locationXclamped")
#define SUBTITLE_LOCATION_Y SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_locationYclamped")

// SUBTITLE_MARGIN_DIFF's value will be 0 with a "story" subtitle; otherwise, value is 100.
// 100 is the difference between horizontal field margin for nonstory (200) and story (100):
#define SUBTITLE_VERBOSITY SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_verbosity")
#define SUBTITLE_MARGIN_DIFF ((SUBTITLE_VERBOSITY) == 1 ? 0 : 100)

windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesTextHolder, SUBTITLE_IDX)
{
    rect        (102.5 + SUBTITLE_MARGIN_DIFF), SUBTITLE_BASE_Y, 435 - (2 * SUBTITLE_MARGIN_DIFF), 37
    backcolor    SUBTITLES_TEXT_BACKCOLOR
    bordercolor    SUBTITLES_TEXT_BORDERCOLOR
    visible        SUBTITLE_NONEMPTY

    windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesText, SUBTITLE_IDX)
    {
        // #5914: engine allows overflowing textbox size by one character. As of 2.12,
        // maximum likely character width is 7.5 (among lower-case ASCII, Stone at textscale 0.25, width-compressed by 0.75)
        // so leave horizontal padding 7.5 on the right, and same on left to improve text centering appearance.
        rect        7.5, 0, 420 - (2 * SUBTITLE_MARGIN_DIFF), 37
        text        SUBTITLES_CONCAT("gui::subtitle", SUBTITLE_DIGIT)
        font        SUBTITLES_TEXT_FONT
        textscale    SUBTITLES_TEXT_SCALE
        textAlign    1
        forecolor    SUBTITLES_TEXT_FORECOLOR
    }
}

windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesLocationBacking, SUBTITLE_IDX)
{
    rect        307, SUBTITLE_BASE_Y-12, 26, 12
    visible        SUBTITLE_NONEMPTY && SUBTITLE_SPATIALIZED
    backcolor    SUBTITLES_TEXT_BACKCOLOR
    bordercolor    SUBTITLES_TEXT_BORDERCOLOR
}
windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesLocationRing, SUBTITLE_IDX)
{
    rect        310, SUBTITLE_BASE_Y-10, 20, 14
    visible        SUBTITLE_NONEMPTY && SUBTITLE_SPATIALIZED
    background    "guis/assets/common/subtitle_location_ring"
    matcolor    1,1,1,SUBTITLE_ALPHA
}
windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesLocationPoint, SUBTITLE_IDX)
{
    rect        317.5 - 9 * SUBTITLE_LOCATION_Y, SUBTITLE_BASE_Y - 5.5 - 6 * SUBTITLE_LOCATION_X, 5, 5
    visible        SUBTITLE_NONEMPTY && SUBTITLE_SPATIALIZED
    background    "guis/assets/common/frobhelper"
    matcolor    1,0,0,1
}

windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesDebugText, SUBTITLE_IDX)
{
    rect        100 + SUBTITLE_MARGIN_DIFF, SUBTITLE_BASE_Y + 31, 440 - (2 * SUBTITLE_MARGIN_DIFF), 45
    text        SUBTITLES_CONCAT3("gui::subtitle", SUBTITLE_DIGIT, "_debug")
    visible        SUBTITLE_NONEMPTY
    font        SUBTITLES_TEXT_FONT
    textscale    0.15
    forecolor    0.5,1,0.5,1
}


#undef SUBTITLE_IDX
#undef SUBTITLE_DIGIT

#undef SUBTITLES_CONCAT3X
#undef SUBTITLES_CONCAT3

#undef SUBTITLE_BASE_Y
#undef SUBTITLE_NONEMPTY
#undef SUBTITLE_ALPHA
#undef SUBTITLE_SPATIALIZED
#undef SUBTITLE_LOCATION_X
#undef SUBTITLE_LOCATION_Y

#undef SUBTITLE_VERBOSITY
#undef SUBTITLE_MARGIN_DIFF

 

Link to comment
Share on other sites

17 hours ago, snatcher said:

Here you are, plus the Gimp template.

Replaced in svn rev 16896.

15 hours ago, Geep said:

Regarding the padding issue, to restate: TDM 2.11 and on through the 2.12 released beta version use a subtitle right text padding of 20 px. While some padding is necessary, this does a poor job of centering the text visually in the backing field. This is obvious with a short bark. My redo of this, with padding of 7.5px on both sides, fixes it, while I believe not causing any problems for word wrap of subtitles with the given compressed font & scale.

The 20 pixel padding was introduce conservatively before the font was changed.
Merely applying the 16:9 vs 4:3 correction allows to reduce it to 15.
But also the font is significantly smaller now.

I tried to edit text in order to see maximum overflow.
It seems that capital W is the widest letter in this font, and I can't get a significant overflow (see image below).


So I have reduced padding from 20 to 10.

Also I shifted everything to the right, so that now subtitle ring and text field are centered horizontally (instead of the background box being centered). This looks much better with frobhelper activated, because previously frobhelper and location ring center we not at the same X position.

Finally, I have increased step between subtitles from 50 to 55 to avoid next subtitle box overlapping with previous subtitle location ring.

These tweaks can still be changed, since they don't change anything regarding the text layout.
Here is how it looks now (blue background shows the text box):

newjob(2024-01-0712-52-11)(-375.6-320_8263.98).thumb.jpg.d249d0b71f3737baab45dae898239157.jpg

 

Quote

I have been quite careful to ensure that making the subtitles narrower for barks (but not story verbosity) is not potentially breaking. Examples of this treatment have been included in all my more recent testSubtitles... releases. Yes, this is "crucial" for me.

My stance on this is still the same: if large empty boxes look ugly, then we can make several possible background boxes and make engine select the best one that text fits into. This way the decision of which box is OK can be made with the very same code that actually renders this text, instead of some external independent computation.

There is no reason why smaller background box should be applied depending on verbosity, except that "it looks all non-story subtitles are small enough now". One exception is enough to break this idea.

Alternatively, it is quite possible that we switch from background boxes to black outline around text. Both approaches works rather well, and without background we can forget about tweaking the background box.

 

tdm_subtitles_message.gui

  • Like 2
Link to comment
Share on other sites

Your latest design is OK, but doesn't touch on several aspects that I addressed in my design:

  1. ring lower edge no longer crushing the top of 1st line text
  2. excess backing field below text 2nd line trimmed, to allow space for (1)
  3. backing field behind ring, as I believe requested by snatcher & datiswous

I could further discuss this and the narrowing issue, where views differ, but I'm more than OK to "switch from background boxes to outline around text", as you suggest. There is still leaves improvements to ring vertical spacing - a la (1) - and not have the ring interior be transparent (probably just opaque) - similar in spirit to (3). And of course, actually implementing it in the beta. snatcher found 8-fold to be visually best.

The minor artifacting with the scaled Stone font (e.g, a wisp to the left of a capital T) will become more prominent with drop shadows. But that could be addressed in a font update to include native Stone 12pt in 2.13

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • Sotha

      WIP mission name confirmed: "The Last Offering"
       
      · 5 replies
    • Sotha

      Today I started writing readables for my WIP mission.
      I wrote my usual text and then crammed it into AI and boom, high quality stuff comes out.
      I used to say that clipper is the mappers best friend, but now it seems it is more like "AI is the mappers best friend."
      · 2 replies
    • The Black Arrow

      Just saw further into 2.13 development, or is it 2.14? Anyway, proper Parallax Mapping...Absolutely fuck yes, please!
      · 2 replies
    • nbohr1more

      Happy Halloween! "Gem of Souls" is out:
       
      Psst, someone let Darkfate know...
      · 1 reply
    • The Black Arrow

      Is there a thread for "Moving Day 2: Look Who's Moving Now"? If not, could someone hint me on what is Dick's birthday? This mission is quite enjoyable on its disturbing creepy implications.
      · 3 replies
×
×
  • Create New...