Subtitles for long voice lines end too soon.

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Xeotroid
Posts: 436
Joined: Sat Jun 23, 2012 7:44 am
Graphics Processor: nVidia with Vulkan support
Location: Czech Rep.

Subtitles for long voice lines end too soon.

Post by Xeotroid »

Communicator voice lines that are long have their subtitles disappear before the sound ends. Since short voice lines have their subtitles wait a while after they're done, I presume the subs have a fixed predefined timer length instead of checking the sound file length? Game version g4.2pre-257-g8ea46320c.

Video example:


In attachment there's a test map, it has one long voice file whose subtitles disappear too soon and a short one whose subtitles stay for a while. The latter's obviously not a problem, but it can be useful for checking both extremes.
Attachments
long_subs_test.pk3
(1.18 KiB) Downloaded 41 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Subtitles for long voice lines end too soon.

Post by Graf Zahl »

The problem here is that sound and subtitles are handled independently of each other so without some deeper changes applying the length of the sound is not that simple.
User avatar
Xeotroid
Posts: 436
Joined: Sat Jun 23, 2012 7:44 am
Graphics Processor: nVidia with Vulkan support
Location: Czech Rep.

Re: Subtitles for long voice lines end too soon.

Post by Xeotroid »

Would it be possible to pass a length value to the subtitles manually? Here's all of the communicator sound files with their lengths:

Code: Select all

VOC1 14.00
VOC2 12.93
VOC3 6.48
VOC4 6.48
VOC5 4.64
VOC6 4.74
VOC7 6.37
VOC8 3.58
VOC9 4.69
VOC10 5.61
VOC11 5.52
VOC12 4.04
VOC13 9.08
VOC14 5.81
VOC15 6.97
VOC16 4.60
VOC17 2.30
VOC18 3.56
VOC19 5.78
VOC20 6.14
VOC21 4.35
VOC22 3.16
VOC23 5.80
VOC24 2.22
VOC25 8.13
VOC26 11.04
VOC27 8.23
VOC28 6.97
VOC29 3.93
VOC30 3.25
VOC31 3.33
VOC32 10.15
VOC33 3.76
VOC34 6.76
VOC35 3.45
VOC36 3.55
VOC37 4.31
VOC38 9.81
VOC39 3.62
VOC40 4.10
VOC41 5.23
VOC42 6.24
VOC43 4.50
VOC44 9.17
VOC45 4.81
VOC46 7.62
VOC47 5.16
VOC48 3.28
VOC49 3.42
VOC50 7.11
VOC51 4.08
VOC52 3.82
VOC53 4.44
VOC54 3.91
VOC55 3.32
VOC56 9.66
VOC57 5.28
VOC58 3.78
VOC59 6.11
VOC60 2.92
VOC61 4.98
VOC62 5.18
VOC63 3.93
VOC64 2.43
VOC65 3.87
VOC66 3.69
VOC67 3.05
VOC68 3.83
VOC69 4.83
VOC70 3.62
VOC71 2.88
VOC72 5.68
VOC73 4.25
VOC74 5.52
VOC75 8.25
VOC76 7.13
VOC77 6.13
VOC78 7.33
VOC79 8.22
VOC80 5.34
VOC81 4.73
VOC82 2.89
VOC83 6.78
VOC84 6.44
VOC85 5.67
VOC86 4.27
VOC87 6.49
VOC88 6.74
VOC89 10.51
VOC90 4.29
VOC91 4.71
VOC92 3.76
VOC93 4.73
VOC94 4.62
VOC95 4.70
VOC96 2.99
VOC97 9.15
VOC98 6.84
VOC99 7.97
VOC100 3.46
VOC101 2.84
VOC102 5.14
VOC103 5.27
VOC104 7.34
VOC105 7.84
VOC106 8.70
VOC120 7.00
VOC121 5.06
VOC122 15.74
VOC128 13.79
VOC129 13.71
VOC130 18.92
VOC200 2.29
VOC201 3.28
VOC202 3.15
VOC203 3.53
VOC204 3.29
VOC205 2.95
VOC206 2.91
VOC207 1.81
VOC208 2.49
VOC209 2.78
VOC210 2.25
VOC211 2.62
VOC212 2.73
VOC213 3.00
VOC214 3.49
VOC215 1.71
VOC216 2.47
VOC217 3.54
VOC218 2.21
VOC219 3.20
VOC220 3.27
VOC221 2.14
VOC222 2.53
VOC223 3.14
VOC224 3.89
VOC225 3.45
VOC226 7.24
VOC227 5.71
VOC228 1.54
VOC229 2.94
VOC230 3.72
VOC231 12.25
VOC232 4.43
VOC233 9.46
VOC234 9.43
VOC235 2.59
VOC236 5.70
VOC237 7.79
I'm not sure where this should be stored or how to precisely use it, I just thought of this brute force solution if getting sound file lengths automatically is a pain in the ass. The subtitles are only used for Strife, anyway. If a value for a given sound exists, use it (and maybe add a second or two), and if it doesn't, use the default timer.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Subtitles for long voice lines end too soon.

Post by Graf Zahl »

Xeotroid wrote:The subtitles are only used for Strife, anyway.
No, the subtitles can be used for any mod that plays log sounds. It's implemented as a generic engine feature
User avatar
Xeotroid
Posts: 436
Joined: Sat Jun 23, 2012 7:44 am
Graphics Processor: nVidia with Vulkan support
Location: Czech Rep.

Re: Subtitles for long voice lines end too soon.

Post by Xeotroid »

Yeah, and I guess having to write a script to list their voice files' length isn't too appealing for a modder to do just because of subtitles. Still, it's better than nothing, right? No custom length = default length.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Subtitles for long voice lines end too soon.

Post by _mental_ »

Made pull request for this feature.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Subtitles for long voice lines end too soon.

Post by Graf Zahl »

So far, so good, that's where I was already. There's just one minor issue here: S_GetMSLength calls the sound backend to retrieve the length, which has a few implications that need to be addressed.

1. Change the NullSoundRenderer's implementation to return a value more usable here - it's currently 250 for any sound.
2. On other backends this loads the sound into the backend and uses its query function to retrieve the length. For something as infrequently called as the log stuff this isn't a big issue but it may have to be addressed at some point in time.
User avatar
Rachael
Posts: 13542
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Subtitles for long voice lines end too soon.

Post by Rachael »

Slightly offtopic, but was S_GetMSLength exposed to ZScript at any point recently? Unless I am misremembering something. I have some pretty major concerns about allowing that, if the sound backend can give different values like that.

If that can be routed to its own function that processes the sound and gives a static value based on the sound itself and not the backend being used, then that would avert my concern.
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Subtitles for long voice lines end too soon.

Post by _mental_ »

Graf Zahl wrote:1. Change the NullSoundRenderer's implementation to return a value more usable here - it's currently 250 for any sound.
I would rather turn synchronization off in this case. In other words, duration will be always set to 7 seconds.
Graf Zahl wrote:2. On other backends this loads the sound into the backend and uses its query function to retrieve the length. For something as infrequently called as the log stuff this isn't a big issue but it may have to be addressed at some point in time.
I assume that the requested sound will be played soon, or it’s already playing.
New variant of the scripted function can be added that takes duration in seconds instead of sound id.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49066
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Subtitles for long voice lines end too soon.

Post by Graf Zahl »

Added, but I changed it so that the subtitles always last at least 7 seconds.
Post Reply

Return to “Closed Bugs [GZDoom]”