dhewm / dhewm3-sdk

An SDK to create Mods for dhewm3
GNU General Public License v3.0
62 stars 27 forks source link

Doom3[CC]: Current state and what still needs to be done #12

Open DanielGibson opened 4 years ago

DanielGibson commented 4 years ago

Ok, the current state compiles and kinda works.. You can find it in this repository in the doom3cc branch

Still TODO (likely incomplete): likely only d3cclib/* needs to be modified, and the integration into the rest of the gamecode code is complete - but of course it's no problem if we need to do additional changes to the gamecode after all:

DanielGibson commented 4 years ago

I just realized I had screwed up the line endings of the files in d3cclib/ and I found some uncommitted changes I did. So I fixed the line endings and added the uncommitted stuff and I also prepared CMakeLists.txt for d3xp/ support, then I force pushed it to the doom3cc branch - sorry about that, if you had the branch checked out pulling might give you an error, in that case do:

The uncommitted changes included calling initLanguages() at some point that seemed to make sense, but I didn't test at all if language selected works now (and I'm not 100% sure how it's supposed to be used etc)

IlDucci commented 4 years ago

Okay, related to stuff that needs to be done (in my opinion):

There's other bones I'd want to pick, but I think I have to split things between "needed to get this looking proper" and "stuff that could mean rewrites/back to drawing board".

DanielGibson commented 4 years ago

An option to enable/disable SFX transcriptions/descriptions might be desirable. Like, maybe people want subtitles because they don't understand spoken English too well, but can hear the environment sounds etc just fine. (Or does this already exist?)

IlDucci commented 4 years ago

It exists already, but the system in place is one of the areas that might fall into "back into the drawing board":

The current system uses only priority values, from 0 to A (in text, converted to hexa via code). Apparently, the system just disables printing out any values that are not 0 to do the switch between subtitles only or full closed captioning.

Though, in areas where there's a high density of voice lines, mostly during the start of the invasion in MC_Undeground and MarsCity2, there might be the need to add a secondary voice value. The part where this goes "back to the drawing board" is inspired by Half-Life 2's subtitles, where the priority value and the SFX tag were two different things, if I recall correctly.

Here's a copy of the priority system's help for caption writers:

// The closed captioning system makes use of priorities to determine which sounds get captioned. // They are very important so that we make sure NPC dialog isn't cut off unexpectedly. // PRIORITY GUIDE // 0. Dialog // 1. Enemy's gun fire and noises (alert moans, pain sounds, death sounds) // 2. Explosives rattling on ground (grenade banging on the floor after an enemy threw it) // 3. Explosions // 4. Enemy's reloading gun // 5. Enemy's footsteps // 6. Doors, elevators. // 7. Player gunfire // 8. Player reloading // 9. Player footsteps // A. World sounds (Computers beeping, birds chirping, wind howling...)

In any case, once the mod's good enough to be tested, both subtitles and full CC will need to be tested and taken into account.

IlDucci commented 4 years ago

I've checked the updated code and the language selector is working again. That also reminds me of another thing that must be done: Get the "continues" substring out of the code and into a string so it's localizable. It seems to be used to detect when a sound is being played long enough by detecting if the substring's been there long enough.

EDIT: I'm attaching the current version of the mod's assets: doom3cc.zip

I just saw another reason why subtitles for the PDA menu should be enabled somehow: In order to compensate the lack of subtitles there, the original team decided to add transcriptions to the ingame emails. This causes two problems:

DanielGibson commented 4 years ago

The part where this goes "back to the drawing board" is inspired by Half-Life 2's subtitles, where the priority value and the SFX tag were two different things, if I recall correctly.

Or we make the priorities go up to F so we have 5 more for dialogue (and just move the current priorities 1, 2, ... back by 5) - for this all subtitles would have to be modified of course, no idea how much work that'd be and if it would be easy enough to do this with a script or something for everything that currently has priority 1 or higher. (Or maybe instead of 5 more for dialogue just 2 more for dialogue and 3 for something else if needed, whatever)

Thanks for uploading the current gamedata, with this everyone who's interested in helping should be able to test the mod and maybe try to fix something :) To test do the following:

IlDucci commented 4 years ago

By extending the system, I think only one or two extra values for dialogue should be enough. Changing the values in the dccs should be simple with a Search & Replace (for scripting, that's something that's out of my league).

DanielGibson commented 4 years ago

I documented in HowToIntegrateIntoMods.md how to integrate Doom3CC into (the C++ code) of other mods. I also shortly described the purpose of each step, which might help understanding the API of ccBST a bit.

IlDucci commented 4 years ago

I have found a couple of additional possible issues:

DanielGibson commented 4 years ago

Well, every caption that uses the timecode feature seems to display the captions earlier than they should (maybe a 1/10th of a second?

I debugged another issue and it turned out that between gamecode starting a sound and OpenAL actually being told to play it there can be a delay from up to about 100 milliseconds. However, the delay isn't fixed, sometimes it's just 1ms, sometimes it's 100, often in between.. (https://github.com/dhewm/dhewm3/issues/141#issuecomment-636620498 has the details)

IlDucci commented 4 years ago

Very interesting. Is OpenAL also used in the original EXE for the game? Because I just went there to check and the desync is, indeed, still existing. Just to rule out if it's an original game "bug".

DanielGibson commented 4 years ago

OpenAL support in the original game was optional. However, this bug also exists in the other sound backends (that have been removed in dhewm3).

DanielGibson commented 4 years ago

Can you check if the delays get better with https://github.com/dhewm/dhewm3/pull/296 (and if you notice any other new sound issues)?

IlDucci commented 4 years ago

I did just a quick check on timings (Loaded the first level, checked the synchronization of the first part of the cutscene, then on the video displayed on the kiosk and then on the Marine Command Report) and they don't seem to have changed their desync. Haven't played enough to hear any sound issues.

DanielGibson commented 4 years ago

So the sound still plays about 0.1s after the subtitle is shown? Could be OpenAL itself adds an additional delay..

Thanks for testing! :)

IlDucci commented 4 years ago

I'm not sure if the sound plays 0.1s after the subtitle is shown or if any subtitles that use the timecode feature (a.k.a.: more than one subtitle per audio file) are the ones that have the delay in between subtitles.

Before I said this was a problem of timecode audios, but now I have the feeling that a subtitle box starts and ends at the same time as the audio playback, but any timings have this delay I'm talking about. I'm not sure if I can explain this properly, but the issue might be within the timecode feature, rather than just the subtitle drawing feature.

IlDucci commented 4 years ago

doom3cc.zip Here's the latest version of the mod's assets, which include accurate timings for English and Spanish voices, just so anyone can feel them out.

palmerj commented 2 years ago

I'm having trouble setting the mod into fullscreen on MacOS when I load from base. I have:

seta r_customHeight "1200" seta r_customWidth "1600" seta r_fullscreen "1" seta r_mode "-1"

1200 x 1600 is supported in window mode

But it resets r_mode to 3 and r_fullscreen to 0 and then kicks me out to windowed 640x480. Any ideas?

Would be good to have a GUI function to set fullscreen.

IlDucci commented 2 years ago

You should make a new thread for this bug. Also, there is no programmer around here that could help solve bugfixes or the like. I am still around here, but I need a programmer to get this mod working again.

palmerj commented 2 years ago

OK thanks. Issue raised here https://github.com/dhewm/dhewm3-sdk/issues/25

eljina33 commented 1 year ago

Can you bring subtitle support to bfg?

eljina33 commented 1 year ago

bfa mode allows it I tried to do it but failed