BC46 / freelancer-hd-edition

Freelancer: HD Edition is a mod that aims to improve every aspect of the game Freelancer (2003) while keeping the look and feel as close to vanilla as possible.
https://www.moddb.com/mods/freelancer-hd-edition
168 stars 15 forks source link

Integrate FLSubs #119

Open BC46 opened 1 year ago

BC46 commented 1 year ago

Some players have requested subtitles to be added to the mod. While I personally don't think subtitles fit a game like Freelancer (maybe except for the cutscenes and cinematics), I still think it's nice to at least have the option so players can enable them if they wish.

There's a mod out there called FLSubs (GitHub) that adds English subtitles to the game. It comes with a license that allows other mods/projects to use it without any problems.

Though there are three issues (including two major ones) which should be addressed and reviewed before FLSubs can be properly integrated into Freelancer: HD Edition.

Issue 1

First of all, the subtitles mod makes use of d3d8.dll. Therefore, our DirectX-related enhancements can't be used while the subtitles are enabled, meaning players can only use them if they select the vanilla graphics API in the installer. It might be possible to combine it with DxWrapper.

Issue 2

The subtitles mod comes with a modified Freelancer.exe where the stack size has been increased to 2 MB. From my quick tests, this modification worked fine with HDE for the most part. Unfortunately it seems to cause a few conflicts with the Console plugin, where some commands can't be entered properly anymore. Consequently, the Console option may have to be disabled automatically if the subtitles are enabled.

Issue 3

FLSubs makes use of hardcoded configs for every screen resolution. These configs store the font sizes, text positions for the subtitles, etc. The issue is that there are a ton of different screen resolutions that players use to play Freelancer: HD Edition in. Since only a few default configs exist, the subtitles mod won't work properly out of the box for all the other resolutions. Creating configs manually by request doesn't seem viable either.

It might be possible to automatically create configs in the HDE installer based on the user's screen resolution (which can already be detected). This would allow us to dynamically set all the font sizes and positions in the config files. If this works properly, we can later do it in the launcher so we can support any resolution the user wants to play HDE in with subtitles.