Jump to content
The Dark Mod Forums

Subtitles - Possibilities Beyond 2.11


Geep

Recommended Posts

Just too small a gap currently between blocks, to not overlap with something. I think it's better to overlap with the subtitle it's associated with, rather than the one above. The gap could be enlarged, but then 3rd topmost block would be close to screen center vertically, blocking more of the general view. Oval could be further shrunk, but becomes less informative. I guess, with tricky programming, you could suppress the ovals when there are more than 1 blocks shown. Probably no perfect answer.

Link to comment
Share on other sites

  • 2 weeks later...
On 12/20/2023 at 4:30 PM, Geep said:

You raised the oval further up from the text, but that will put it atop a different caption text when 2-3 are showing stacked simultaneously. So shouldn't change that aspect of implementation.

There can be up to three blocks and each block can contain up to two lines of text, right? Plus the graphic at the top when appropriate, correct? If that's so then the new sample attached should be ok.

I take the assumption that it is not possible to measure the length of each character and have a background that fits the the length of the text and as such, I once again removed the background but now added a kind of outline (fake drop shadow). Unfortunately the current font is sometimes thick and sometimes thin and the outline would be more effective if we had a typeface with a more consistent, thick outline. Subs are displayed by limited time and the more clear the font the faster we scan the text.

I know you want the background because you are concerned some words cannot be read in some situations but my main concern is about those players that wouldn't mind having subs but end up disabling them simply because they find the whole approach too obtrusive.

In my sample I went from pure white text to a light grey shade. Yellow color works quite well too for the subs.

On 12/20/2023 at 6:43 PM, stgatilov said:

The old oval had thicker bottom line to give the illusion of 3D slope.
The new oval is fully symmetric and looks like fully 2D shape.

Which one is better?

I understood what you were going for but it didn't land here. I haven't thought of alternatives for the graphic but I am impressed with some of @MirceaKitsune's gui/hud work so perhaps he can come up with different ideas.

EDIT: Download removed. Check this post for the latest version.

 

Edited by snatcher

TDM_Modpack_42.png

Link to comment
Share on other sites

Thanks, @Wellingtoncrab. Yes, @Geep, @stgatilov and @datiswous are doing a great job with the subs.

Having no background to rely on one may argue yellow is the worst choice since yellows are supposed to be more common in the TDM world however, from my limited testing, I detected occasional interferences with both white and yellow colors.

White feels colder and yellow feels warmer. I, for some reason, find yellow more welcoming and less out of place. We could try with different shades of yellow.

Find below v3 in white color for completeness sake.

newjob-2024-01-02-16-47-52-57-37-357-56-

EDIT: Download removed. Check this post for the latest version.

Edited by snatcher
  • Like 2

TDM_Modpack_42.png

Link to comment
Share on other sites

@snatcherI think all the options look pretty good - I guess the only thing that occurs to me is check the legibility in bright environments?

I use an off white gui pop up in the missions I have worked and in some conditions this can be quite hard to read - so it’s just a theory but perhaps the yellow might have an edge there?

-=  IRIS  =-    ♦    = SLL =

Link to comment
Share on other sites

7 hours ago, snatcher said:

There can be up to three blocks and each block can contain up to two lines of text, right? Plus the graphic at the top when appropriate, correct?

True.

7 hours ago, snatcher said:

I take the assumption that it is not possible to measure the length of each character and have a background that fits the length of the text....

It would require a modification of the engine code. Earlier this year I wrote two experimental C++ utility programs that do the required calculation, for respectively 12 pt Carleton and (scaled to 12 pt) Stone fonts. However, others have expressed distaste, on complexity grounds, to having variable-width backing fields, so I've since been restricting my advocacy to a narrower fixed-width backing field for speech-verbosity subtitles.

Quote

... I once again removed the background but now added a kind of outline (fake drop shadow). Unfortunately the current font is sometimes thick and sometimes thin and the outline would be more effective if we had a typeface with a more consistent, thick outline. Subs are displayed by limited time and the more clear the font the faster we scan the text.

This outlining isn't really visible in your screen shots; and I'd like to see various color-tone game locations too.

I see you use the "bordercolor" attribute for your outlining. I vaguely recall there was some circa-2010 TDM "drop shadow" experiments with (I'm guessing) using this for subtitling, with the Carleton font then in use. (This was before I got involved in subtitling.) Same conclusion: a bit problematic with the given font. So that led to the translucent backing field as an reasonable approach.

It would be possible to add a new unicolor font just for subtitles to TDM. There is a roadmap for this, but it's a major project, so TDM 2.13?

Quote

I know you want the background because you are concerned some words cannot be read in some situations but my main concern is about those players that wouldn't mind having subs but end up disabling them simply because they find the whole approach too obtrusive.

Agreed. That was part of my motivation for wishing to narrow the width of the backing field.

Quote

In my sample I went from pure white text to a light grey shade. Yellow color works quite well too for the subs.

I'm in favor of having settings to let players have more flexibility in the subtitle presentation. That would include font color.

  • Like 1
Link to comment
Share on other sites

I guess added sector is enough to drop the idea of more thickness on lower half of the ellipse.

It is possible to expose colors of background and text to cvars.
If the location ring image is black-and-white with varying alpha, then I suppose it should be possible to expose its color too (by modulating configurable color).

  • Like 1
Link to comment
Share on other sites

11 minutes ago, Wellingtoncrab said:

@snatcherI think all the options look pretty good - I guess the only thing that occurs to me is check the legibility in bright environments?

I use an off white gui pop up in the missions I have worked and in some conditions this can be quite hard to read - so it’s just a theory but perhaps the yellow might have an edge there?

Yellow have an edge, yes. We definitely can't go wrong with white.

Other than the graphic, which I think I cannot innovate further, I wanted @Geep to experience his work without backgrounds. To background or not to background, a tough call for different reasons explained. Fortunately this can be modded to an extent.

12 minutes ago, Geep said:

This outlining isn't really visible in your screen shots; and I'd like to see various color-tone game locations too.

I provided working samples. Download a zip, unzip it and place the "gui" folder in your TDM root. Delete the "gui" folder when you are done.

12 minutes ago, Geep said:

I see you use the "bordercolor" attribute for your outlining.

No, I merely print the same text three times: 1x black a tad top-left, 1x black a tad bottom-right, 1x light grey centered.

12 minutes ago, Geep said:

I vaguely recall there was some circa-2010 TDM "drop shadow" experiments with (I'm guessing) using this for subtitling, with the Carleton font then in use. (This was before I got involved in subtitling.) Same conclusion: a bit problematic with the given font. So that led to the translucent backing field as an reasonable approach.

I think you better experience it for yourself, and draw your own conclusions.

TDM_Modpack_42.png

Link to comment
Share on other sites

45 minutes ago, Wellingtoncrab said:

@snatcherI think all the options look pretty good - I guess the only thing that occurs to me is check the legibility in bright environments?

I use an off white gui pop up in the missions I have worked and in some conditions this can be quite hard to read - so it’s just a theory but perhaps the yellow might have an edge there?

Sorry I don't know if you mean whether yellow have a positive or negative edge in that case. Without a proper thick outline issues will always popup here and there regardless of the color, white with newspapers, yellow with books or scrolls... Having a background is the safest bet, but for small recurrent pieces of text such as barks, the current background if off-putting.

  • Like 1

TDM_Modpack_42.png

Link to comment
Share on other sites

26 minutes ago, snatcher said:

No, I merely print the same text three times: 1x black a tad top-left, 1x black a tad bottom-right, 1x light grey centered.

Ah, I see now. The bordercolor code in the gui is just a remnant around the now-transparent backing field.

Link to comment
Share on other sites

Posted (edited)

 

57 minutes ago, snatcher said:

Having a background is the safest bet, but for small recurrent pieces of text such as barks, the current background is off-putting.

So true. In that regard, gui code has been available for a few months to create a narrower backing field for barks (i.e., speech verbosity) than for story text. This code has not been included in the beta to date. Perhaps it will take users in addition to me to favor and push for it!

If you want to try it, put this code in your FM's "guis" folder as over-ride file "tdm_subtitles_message.gui":
 

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"

//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 (370 - 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 or [planned] if Cvar subtitle_narrowfield_nonstory is false (0); 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)
// To incorporate new CVar:
// #define SUBTITLE_MARGIN_DIFF "gui::subtitle_narrowfield_nonstory" * ((SUBTITLE_VERBOSITY) == 1 ? 0 : 100)

windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesTextHolder, SUBTITLE_IDX)
{
    rect        (100 + SUBTITLE_MARGIN_DIFF), SUBTITLE_BASE_Y, 440 - (2 * SUBTITLE_MARGIN_DIFF), 45
    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
        // maximum character width is 17 at textscale 0.25, so leave horizontal padding 20 on the right
        rect        0, 0, 420 - (2 * SUBTITLE_MARGIN_DIFF), 45
        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, SubtitlesLocationRing, SUBTITLE_IDX)
{
    rect        300, SUBTITLE_BASE_Y - 8, 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        307.5 - 9 * SUBTITLE_LOCATION_Y, SUBTITLE_BASE_Y - 4 - 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 + 40, 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

 

Edited by Geep
Link to comment
Share on other sites

1 hour ago, snatcher said:

Sorry I don't know if you mean whether yellow have a positive or negative edge in that case. Without a proper thick outline issues will always popup here and there regardless of the color, white with newspapers, yellow with books or scrolls... Having a background is the safest bet, but for small recurrent pieces of text such as barks, the current background if off-putting.

My guess was that it would have a positive edge and be more legible in slightly more circumstances than white (though not perfect) - but that is not based on any testing admittedly. Only a hypothesis as I know I have had issues with pure white text in guis I have made.

  • Like 1

-=  IRIS  =-    ♦    = SLL =

Link to comment
Share on other sites

48 minutes ago, Geep said:

So true. In that regard, gui code has been available for a few months to create a narrower backing field for barks (i.e., speech verbosity) than for story text. This code has not been included in the beta to date. Perhaps it will take users in addition to me to favor and push for it!

If you want to try it, put this code in your FM's "guis" folder as over-ride file "tdm_subtitles_message.gui":

Ok but.

newjob-2024-01-02-21-19-10-462-82-405-97

  • Like 1

TDM_Modpack_42.png

Link to comment
Share on other sites

Yes, the backing field shown, while narrower, is still a fixed width for all bark texts, so still wider than ideal for that particular phrase. The width is the minimum needed to safely accommodate subtitle lines up to 42 characters long of 12 pt Stone font.

Link to comment
Share on other sites

Just now, Geep said:

Yes, the backing field shown, while narrower, is still a fixed width for all bark texts, so still wider than ideal for that particular phrase. The width is the minimum needed to safely accommodate subtitle lines up to 42 characters long of 12 pt Stone font.

Thank you. I understand.

TDM_Modpack_42.png

Link to comment
Share on other sites

There's the inner box to constrain the text, and trigger word wrap, and the outer box to show the backing field. These are identical in size and location except the latter is a bit wider, by 20 px. A comment in the .gui code says:

        // #5914: engine allows overflowing textbox size by one character
        // maximum character width is 17 at textscale 0.25, so leave horizontal padding 20 on the right

So the motivation is to keep the text from never visually exceeding the backing field. However, that extra padding can not be considered when the engine decides the point about which to center text in the inner box

Probably a padding of 20 is excessive, even more so now that a width-compressed font is used. That said, there may be something else dominating the anomaly. And the sound location widget is also off-center.

 

Link to comment
Share on other sites

Thank you very much, Geep.

On 1/2/2024 at 10:33 PM, Geep said:

And the sound location widget is also off-center.

Not in my samples but mind you: I consider this a visual exercise to evaluate what looks best and decide what works and what doesn't. No guarantees in the code. Gui values must be properly reviewed once you settle on something.

Find attached to this post v3 "Yellorange". Text is centered and the font color is a yellow leaning to orange, that looks like yellow in the game but it actually is more orange than yellow (for me anyway).

ffb300.jpg

newjob-2024-01-02-18-37-22-56-48-358-07-

EDIT: Download removed. Check this post for the latest version.

Edited by snatcher
Zip re-uploaded
  • Like 1

TDM_Modpack_42.png

Link to comment
Share on other sites

@snatcher, based on your earlier sample, I see that the horizontal widget positioning in the beta release of tdm_subtitles_message.gui and in my version were both off by 10px to the left. (Probably because the widget was originally wider.) My version corrected here (but not addressing text centering problem):
 

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"

//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 (370 - 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 or [planned] if Cvar subtitle_narrowfield_nonstory is false (0); 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)
// To incorporate new CVar:
// #define SUBTITLE_MARGIN_DIFF "gui::subtitle_narrowfield_nonstory" * ((SUBTITLE_VERBOSITY) == 1 ? 0 : 100)

windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesTextHolder, SUBTITLE_IDX)
{
    rect        (100 + SUBTITLE_MARGIN_DIFF), SUBTITLE_BASE_Y, 440 - (2 * SUBTITLE_MARGIN_DIFF), 45
    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
        // maximum character width is 17 at textscale 0.25, so leave horizontal padding 20 on the right
        rect        0, 0, 420 - (2 * SUBTITLE_MARGIN_DIFF), 45
        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, SubtitlesLocationRing, SUBTITLE_IDX)
{
    rect        310, SUBTITLE_BASE_Y - 8, 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 - 4 - 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 + 40, 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

2 minutes ago, Geep said:

@snatcher, based on your earlier sample, I see that the horizontal widget positioning in the beta release of tdm_subtitles_message.gui and in my version were both off by 10px to the left. (Probably because the widget was originally wider.) My version corrected here (but not addressing text centering problem):

Ok, no problem. We shall request @stgatilov's assistance in due time.

I need you to evaluate yes background or no background and have a final word for 2.12. Take your time, please.

TDM_Modpack_42.png

Link to comment
Share on other sites

I will take a look this coming week.

In my heart of hearts, I'd rather make "background or not" a user choice. The simple version of that wouldn't be too hard: just a CVar settng the backing field visibility. The more sophisticated version, where no-background implies fake-drop-shadows, requires more thought to make it live with the backing field code.

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

    • Xolvix

      Took a break from TDM until I got my backlog under control. It's been months and it's still not "under control". Damnit.
      · 1 reply
    • Ansome

      I sleep well at night knowing the player will never see the absolute nightmare that is my sealing brushwork outside the playable area. Only the pointfile can judge me now.
      · 4 replies
    • JackFarmer

      Somehow I admire the fact that the material from Dune has now been filmed for the third time. Personally, I could never do much with the material, but as a child of the 80s, I of course know the David Lynch movie...and that movie was at least funny!
      · 2 replies
    • Baal

      Episode 3 of the second best Doom 3 mod, Phobos,  was just released.
      · 6 replies
    • snatcher

      TDM Modpack v4.2 released!
      · 1 reply
×
×
  • Create New...