Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
BLADERUNNER: Adding Subtitles support #1219
Attaching the external resource files for the subtitles and the optional font. These should be extracted and copied in the game's installation folder.
sev- left a comment
I love the idea and kudos for the amount of work which went into it.
I have several questions and remarks, though:
TRE is the native format for text resources that the game uses. This meant I could mostly reuse the existing implemented mechanism to access and display the text in-game. Also, by implementing access to external TRE files, it possible to easily expand this and override internal TRE files, for purposes of localization in other languages.
The FON format has similar advantages - it is native to the game, and external FON files can support localizations of the game. You can use the FON file for non-latin subtitles (I can do Greek subtitles for example) in a similar fashion that this is done for the LucasArts games (Monkey island, Full throttle).
No real purpose. Just me trying to keep my code isolated and quickly locate changes for a specific feature. This can be removed.
I agree and sorry about that. I'm not sure how I can go about squashing commits, but I'll ask for help in the IRC chat.
It's a custom algorithm. The purpose is to prioritize new line characters in the quote as split points, and if such don't exist then try to split the quote in as even parts as possible without overflowing out of the screen width. I could use wordWrap, but would it substitute this functionality?
The list of the videos is kept mainly so that I can map them to an uint ID which is then used to index their respective subtitles file. It also makes it easier to pre-load all the available subtitles at startup, and then access them from memory.
What I see is that you're not using a oneliner to read the subtitles, but have a full blown parser in TextResource::openFromStream(). I see, that you could alter this code very slightly, but get support of the plain text subtitles, which will be easier to maintain, translate, etc.
E.g. I understand the engineering beauty of your solution "I am using the game formats", but then, you anyway have to write code around it, and making the maintenance harder, thus, voiding this beauty.
I would highly recommend to switch to plaintext.
Right. Supposedly I dreamed this off. Part of my brain remembers glyph widths manipulation. This must be your word wrapping code.
Another complication which you have is that #ifdef'fed code about external font file. I recommend to simplify that, e.g. either make it run-time, or leave only one branch.
As of the tools, please, always have those as part of the distribution. The good place is devtools/bladerunner directory.
Yes, please simplify that as denoted earlier.
Yes, wordWrap is doing this at the moment, however, you mentioned that you also have algo for making strings look even, and that would require enhancing the wordWrap code. I prefer to enhance the existing code (and make it as a parameter), thatn duplicating the functionality.
I misread your code. I thought that you do have a string ID, but you have only integer one. Your code makes sense now.
I've packed all TRE resource files and the external optional font in a SUBTITLES.MIX file (now attached in my original comment above). Like peterkohaut suggested this allowed removal of all the extra code for accessing external files (text resources and font files) which also was duplicating some of the existing functionality of the engine methods.
@peterkohaut as far as the transcribing goes, I've completed one and a half passes of it. It's fairly ok, but I do want to complete the second pass which is done as I'm progressing with my let's play project (currently beginning of Act 4), double-checking and verifying the lines. Once in a while, I spot quotes where corrections or improvements are needed. There are also a few cases where I'm not entirely certain of what is actually said by the actors and those will probably need the help of someone for whom English is the native language.
The transcribed parts (in-game and movie cutscenes), as well as the fonts for the subtitles are now all packed in the SUBTITLES.MIX file, so that's all the external files anyone needs to enable subtitles.
The subtitles text is still in the game's TRE format and the fonts in the game's FON format using the BladeRunner engine's own existing classes and structures.
I do see the benefit of eventually supporting (somehow) the common .srt format and utf-8 encoding, as well as using ScummVM's own Font class (and thus the wordWrapText() method) , but I don't think I'm up for doing that in this pull request, because it seems like that would negate almost all the work I've done so far -- and moreover I failed to come up with an elegant way (that I would be happy with) to do it., whereas I'm quite happy with my implementation as is now.
If the above is a hard requirement, then probably someone else will have to do it. If it's not, then please could you review the recent state of the PR and point out the outstanding issues with it so that I could focus on resolving them?