snatcher Posted January 2, 2024 Report Posted January 2, 2024 Yeah, I guess it is a little too late for customizable backgrounds and font color settings but you'll get there eventually Happy to assist in realizing your vision for this round. Quote
snatcher Posted January 2, 2024 Report Posted January 2, 2024 (edited) And here is v4 "Geep", based on your code from four posts above. Background enabled Text centered New graphic White color (let me know if you want to test other colors) Choose between any v3 or v4. We will take your choice to @stgatilov for a sanity check afterwards. EDIT: Download removed. Check this post for the latest version. Â Edited January 4, 2024 by snatcher Quote
snatcher Posted January 2, 2024 Report Posted January 2, 2024 The problem with (the original and) v4 is this, and there is little we room for improvement unless we go back to the drawing board 1 Quote
snatcher Posted January 2, 2024 Report Posted January 2, 2024 This is how v3 look like in those situations. Verbosity isn't fully realized yet and this shouldn't happen often today but it might happen often in a year time. Quote
stgatilov Posted January 3, 2024 Report Posted January 3, 2024 Padding on the right is necessary because text rendering engine allows one-character overflow. And trying to fix it breaks many readables in many missions. So unless background is disabled, padding will stay. As for how large it is, I think it was minimum plausible at some moment. But then the font was changed and maybe it can be reduced now --- history digging is required here. I believe background will stay by default. There is no other simple way to make sure text is visible in all circumstances. As for size and spacing, I doubt you'll be able to reduce anything without making font even smaller and potentially less readable (especially in Windowed mode). Quote
snatcher Posted January 3, 2024 Report Posted January 3, 2024 (edited) One last chance! In the two mock-ups attached to this post I am printing out each block of text a total of 9 times. In my humble opinion this is as close as we can get to a true outline. 9 times may sound excessive but I recall very complex in-game digital screens with tons of text and graphics in Doom 3 and I assume my approach cannot hinder performance in any way. I can be wrong, though. Download a pk4 and place it in your TDM root folder. Do not use quicksaves/loads, start a new mission when switching pk4. Delete the pk4 once you are done with testing. Some missions to give this a go: Seeking Lady Leicester: Intro Braeden Church: Beginning The Black Mage: Intro + Beginning A New Job: Intro + whole mission Here is a comparison in extreme situations (better to experience it in-game because of image compression): Outlined white [z_Subs_212_NoBG_Yellow_v5.pk4]: Outlined yellow [z_Subs_212_NoBG_Yellow_v5.pk4]: And also attached the original, improved version [z_Subs_212_YesBG_Geep_v4.pk4]: z_Subs_212_NoBG_Yellow_v5.pk4 z_Subs_212_NoBG_White_v5.pk4 z_Subs_212_YesBG_Geep_v4.pk4 Edited January 4, 2024 by snatcher 2 Quote
Geep Posted January 3, 2024 Author Report Posted January 3, 2024 2 hours ago, snatcher said: 9 times may sound excessive I wonder if you could test 9x versus 4x-diagonals and 4x-non-diagonals? Maybe the extra 5 renders don't add much. There probably is some minor performance effect. I think you're still showing the widget too high, so it seems to be associated with the wrong subtitle. I prefer @stgatilov's original vertical positioning, even though it pushes the widget's lower edge against the top of the caption lettering. I wasn't sure what you where trying to point out as a problem... was it the word wrap? Yeah, the automatic word wrap with centered text can look ugly at times. An FM author can choose to insert a manual line break in that case. I do that routinely all the time for barks. 5 hours ago, stgatilov said: Padding on the right is necessary because text rendering engine allows one-character overflow. And trying to fix it breaks many readables in many missions. So unless background is disabled, padding will stay. Since padding is part of the background box, sure. It occurs to me now that maybe, to improve the appearance of text centering, the background box should also have equal-size padding on the left. That is, the location and size of the inner box is unchanged, but the outer box is wider and its origin shifted left, so the inner box is centered horizontally within. Quote As for how large it is, I think it was minimum plausible at some moment. But then the font was changed and maybe it can be reduced now --- history digging is required here. The padding can certainly be made smaller. I imagine the seed value of 17px was for a worse-case character like "W", that was then rounded up to 20. We could shrink it by: - choosing the seed character as the widest that might actually be at the end of a line followed by space to cause word wrap. Probably "w" or "A". - not rounding up - scaling by the compression aspect ratio I'll try to come up with a new number. Quote I believe background will stay by default. There is no other simple way to make sure text is visible in all circumstances. No problem here with having the background by default. But recognize there's a compromise between world visibility and text readability. Can't we make it possible to turn the background off for people who hate it so much that they avoid using subtitles because of it? "...visible in all circumstances" may be too high a bar. The simple implementation would be a single CVar that toggles the background on/off and possibly, conversely toggles fake drop shadows off/on. Quote
Geep Posted January 3, 2024 Author Report Posted January 3, 2024 I reviewed the Stone font spacing vis a vis padding: Worst-case spacing for Stone 24pt for ASCII lower-case characters = 20 (and "A" is less than this) Scale by 50% to 12 pt = 10 Compress-width of font by 0.75 = 7.5 So I'm thinking a reduced right padding, now 7.5 px, plus a new left padding of 7.5 px to improve centering. Quote
Geep Posted January 3, 2024 Author Report Posted January 3, 2024 @snatcher, I meant to mention, I do like your sector sound-source widget. I'd be happy going with that. As to its ring color.... while my personal pref tends toward some color that would contrast with text color, I guess most folks would prefer white, to match the current text color (and likely default if text color is made variable). That would be fine. Quote
snatcher Posted January 3, 2024 Report Posted January 3, 2024 1 hour ago, Geep said: I wonder if you could test 9x versus 4x-diagonals and 4x-non-diagonals? Maybe the extra 5 renders don't add much. There probably is some minor performance effect. Tested it and it doesn't look as good. Similar to v3. 1 hour ago, Geep said: I think you're still showing the widget too high, so it seems to be associated with the wrong subtitle. I prefer @stgatilov's original vertical positioning, even though it pushes the widget's lower edge against the top of the caption lettering. Sure. Settle on an style first please (background and color). 1 hour ago, Geep said: I wasn't sure what you where trying to point out as a problem... was it the word wrap? Yeah, the automatic word wrap with centered text can look ugly at times. An FM author can choose to insert a manual line break in that case. I do that routinely all the time for barks. Overlapping elements is what looks bad. 1 hour ago, Geep said: The simple implementation would be a single CVar that toggles the background on/off and possibly, conversely toggles fake drop shadows off/on. I think players should also be able to toggle the situational graphic off and on. It is well executed but it draws too much attention. I rather not focus on it but on the text and my surroundings. Personally, regular subs is all I need but hey, that's just me. Quote
snatcher Posted January 3, 2024 Report Posted January 3, 2024 14 minutes ago, Geep said: @snatcher, I meant to mention, I do like your sector sound-source widget. I'd be happy going with that. As to its ring color.... while my personal pref tends toward some color that would contrast with text color, I guess most folks would prefer white, to match the current text color (and likely default if text color is made variable). That would be fine. The widget needs a background or a shadow or outline otherwise it cannot be seen in some situations. I am not sure how to deal with this. At this point, I think you are leaning to: The existing background and background color (but from your code that includes a narrower background for barks) Original white text color Newest widget in white color closer to the text it belongs to, similar to the original More centered text Quote
Geep Posted January 3, 2024 Author Report Posted January 3, 2024 8 minutes ago, snatcher said: I think players should also be able to toggle the situational graphic off and on. It is well executed but it draws too much attention. I rather not focus on it but on the text and my surroundings. So maybe new CVars along the lines of the following would do the job for 2.12: subtitleColorR 0.00-1.00 subtitleColorG ditto subtitleColorB ditto subtitleBackground 1/0 subtitleSoundSource 1/0 Quote
snatcher Posted January 3, 2024 Report Posted January 3, 2024 That above would be for @stgatilov or somebody else. How come there's this this difference between the top and the bottom? (asking because I am not sure if there's technical reason or not) I am thinking we could probably include the widget and the text in a same block. 1 Quote
datiswous Posted January 4, 2024 Report Posted January 4, 2024 (edited) 13 hours ago, snatcher said: One last chance! In the following example (ws3), the subtitles are a bit more difficult to read: White: Yellow: Â Btw. your yellow pk4 still gives me white text, but the position marker circle is in yellow.. Edited January 4, 2024 by datiswous Quote
datiswous Posted January 4, 2024 Report Posted January 4, 2024 I think the positioning circle should be part of the subtitle block, not positioned above it. There should be enough space left above the subtitle block with background to include it. Quote
snatcher Posted January 4, 2024 Report Posted January 4, 2024 6 hours ago, datiswous said: Btw. your yellow pk4 still gives me white text, but the position marker circle is in yellow.. Don't use quickload when switching pk4. For some reason the save keeps the font color. Start a new mission each time you have a new pk4. 1 Quote
snatcher Posted January 4, 2024 Report Posted January 4, 2024 I am convinced outlined yellow is the superior version over outlined white. I encourage everyone interested to test the yellow version (z_Subs_212_NoBG_Yellow_v5.pk4) vs the improved original (z_Subs_212_YesBG_Geep_v4.pk4). You can find the downloads in this post. Â Quote
snatcher Posted January 4, 2024 Report Posted January 4, 2024 Don't think the current solution is perfect, eh Quote
Geep Posted January 4, 2024 Author Report Posted January 4, 2024 For the record, here is another version of tdm_subtitles_message.gui and the standard backing field, now improved with the right horizontal padding reduced to 7.5 px, and a new left padding to match, for better visual text centering. I also removed a comment about a possible CVar subtitle_narrowfield_nonstory, which seems less important than the other potential CVars.  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) windowDef SUBTITLES_CONCAT3(SUBTITLES_NAMEPREFIX, SubtitlesTextHolder, SUBTITLE_IDX) {    rect      (102.5 + SUBTITLE_MARGIN_DIFF), SUBTITLE_BASE_Y, 435 - (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. 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), 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 Beyond that, as you guys have noted, vertical dimensions could be adjusted to improve the appearance of the widgets. I'll try to come up with something concrete next, keeping conflicts with other adjustable-size HUD elements in mind. Another question for you: To cover a case where the backing field is suppressed, should the sector widget interior still be largely transparent, or would translucent or opaque be better? Quote
nbohr1more Posted January 4, 2024 Report Posted January 4, 2024 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. 2 Quote 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...)
Geep Posted January 4, 2024 Author Report Posted January 4, 2024 In this next version, the vertical height of the backing field is 1px taller (at the expense of gap space below each field), and the text and widget are vertically repositioned within it. 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 (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; 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), 46    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, 9, 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, SubtitlesLocationRing, SUBTITLE_IDX) {    rect      310, SUBTITLE_BASE_Y, 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  1 Quote
snatcher Posted January 4, 2024 Report Posted January 4, 2024 Definitely an improvement, @Geep I am sure you can still borrow a few pixels here an there and let the widget breathe a little. Quote
MirceaKitsune Posted January 4, 2024 Report Posted January 4, 2024 I know this is semi on-topic and likely guaranteed to never happen. But I still can't help dreaming of TDM someday getting a cinematic dialogue system like in DeusEx: If you get close to or frob an important character that has something to say, movement is blocked and you go into a third person view staring you both down while the music changes, every few lines the angle shifts so you see yourselves from a different direction as you talk to each other. The most awesome thing would be dialogue options still, those I'd dream of seeing even more. Imagine being able to tell different things to a character in a prompt, changing some choices based on what you say! Could be used both as a simple store for street corner vendors... or to tell friendly AI to take different actions like waiting or following you or fleeing, I know TDM doesn't go for those types of missions but I still see it as a worthy possibility. 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. Quote Mods: Builder Blocks minigame | Keypad | Disguises
Geep Posted January 4, 2024 Author Report Posted January 4, 2024 20 minutes ago, snatcher said: I am sure you can still borrow a few pixels here an there and let the widget breathe a little. I could move the text down 1 pixel more, but then the text descenders don't have much to breathe. The overall problem is that the bottom-most subtitle slot, if moved further down, begins to conflict too much with other HUD items. For wider story subtitles, this is the corner inventory and weapon items. For all subtitle types, it is the lower informational messages that can appear above the breathe bar. Keep in mind that all these conflicting HUD elements can be enlarged at user discretion through Settings. One solution is to have the engine change the order in which it fills empty subtitle slots. Currently it is: 0 (lowest), 1, 2. If instead it did either of these policies: Fill order: 1, 2, 0 for all subtitle types; or Fill order: 1, 2, 0 for story subtitles. 0, 1, 2 for non-story subtitles Then the frequency of conflict would be significantly lessened - particularly with (1) - since having 3 subtitles shown at the same time is rare. With a revised policy, the backing fields could be made taller, allowing more widget room, with slot 0 (and slot 1 to a lesser extend) lowered Quote
snatcher Posted January 4, 2024 Report Posted January 4, 2024 How about we proceed next with something like this? If done right the widget can have its own background, and blocks will naturally stand out from one another. Please note the above pic comes from a quick an dirty hack to illustrate the idea so I won't share any code. Backgrounds can eventually be replaced with images with round corners or whatever. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.