Open Nasa62 opened 2 years ago
This is certainly interesting input, thanks for posting!
I don't think v2 existed when I was building this, and v1 I was tearing down basically blind (using just the font files themselves, no code analysis) — but working alongside @bamalf, who at the time was adapting the old Russian translation and Arsenal+ to the new version of the game, battle-testing the solution as I went. It took a few tries, but it worked. At the time that is, which was back in December, 2017.
Yeah, what I see in the screenshots seems to match your reporting, meaning this tool would not work on the current version. Which is less than ideal, yes.
However, I punched a few identifiers from your last list into the search engine and I think I found the source: it would seem that the code where this stuff is implemented is open, GPLv3, and can be found over there: http://achurch.org/SIL/ — no decompilation necessary.
Now, which version of the library a given version of the game uses has to be guessed I suppose, as the current one (if that's the code involved) looks different to me. But generally this library is likely a better backbone for modding tooling than my half-baked scripting.
Which I think would render my project at least deprecated and possibly obsolete 🤷 …when someone makes a usable tool out of that library, that is.
Yes FTL uses SIL and it's a fairly recent version but not sure if it's the latest.
Granted yeah SIL exists but I was digging through and reversing things for other reasons (trying to figure out how some of the language stuff works) and spent a while looking at FTL's font stuff and figured I'd paste this here because someone else linked me the project.
As you said SIL is GPLv3 but when it was used in FTL it wasn't.
I guess yeah it would be nice to write a tool to unpack them directly with SIL instead so we can repack the files for other languages.
Just in case it's still helpful
Also it looks like you're off by 8 bits in the character itself, "spacing before" is 8 bits later and there's "pad" there.
Texture section appears to have 2 versions supported by FTL. Texture header is: MAGIC always 4 characters
TEX\n
I think (0xa584554
)... appears big-endian maybe?Tex V2's format is:
Tex V1's format is:
There's some weird flipping of values in the assembly code so it looks like any 2 or 4 bytes value is actually stored big-endian (this is true for both the TEX & FONT headers).
This appears to be the different texture format values supported, again v1 does something weird with remapping some of these but I think these values are valid for v2
This all came from decompiling FTL in Ghidra.