As the developer of a tool to edit CUF fonts I was wondering if a CA developer might be able to answer a few questions I have.
On the CUF file format
Quite a few of the CUF “properties” in the first table are poorly understood by me and the one other person I've encountered on the Internet who I know has been looking into this format as well. He/she goes by the handle of just on the TWC. That discussion is over at the TWC, starting with this post to be precise. Below is a summary of what just and I so far found out (it's a few forum posts collated into one, so “I” or “me” might refer to either myself or to just). Could you please clarify what these properties refer to, or correct our misunderstanding of the format where appropriate?
Summary of what we do (not) know so far:
ETW expanded on the CUF file format seen in M2TW by introducing kerning tables at the end of the file format. Does/will Shogun expand/change the format any further?
Empire extension (kerning), as discovered by just on the TWC:
Tooltip text width
Most description/message text in Medieval II/Kingdoms are rendered in relatively straightforward “block” of text with a static width. This allows us to fix text layout in advance which is very useful for supporting proper indentation based around tabs (not in terms of number of spaces but in terms of pixels, creating an effect similar to that of word processors), as well as prevent/circumvent issues with how Medieval II/Kingdoms text layout algorithms seem to dislike some of our characters.
However, the big exception is tooltips which appear to vary in size depending on context without a clear maximum width limit, so descriptions cannot be made to force a single width for rendering purposes (e.g. to support indentation for a quote in trait description).
Could you suggest another way to predict in advance the dimensions of tooltips? (I can know width of individual glyphs or strings in advance, but right now I do not know how to calculate tooltip dimensions from that.)
Support for more complex descriptions/formatting
From my observation how the engine handles the combination of CUF and strings.bin files, I gathered that it must be possible to support more than plain text in a description.
Currently this is done by using otherwise unused slots in the CUF files to provide multiple glyphs for the same character (in different styles) and compiling the strings.bin files from XML ourselves.
This got me wondering: will CA be moving towards more complex descriptions like these?
Will CA keep the strings.bin format?
Regarding the strings.bin format
(Not questions just some thoughts.)
In testing the CUF tool on some data generated by the game from early Europa Barbarorum II builds, I've seen some “corrupted” strings.bin files: the length field would be bogus (far too long instead of something sensible).
I understand the purpose of the strings.bin format: a cached parse result with fast lookup using length prefixes, instead of having to reparse the original data file on each run. But the format allows no good mechanism for error detection, other than reaching the end of the file unexpectedly or finding more data than expected. For instance a broken length prefix essentially means that the rest of the entire file is corrupted, unless by some lucky chance the corrupted section happens to “end” at a valid length prefix.
Also I once changed one of the shorts (character or length prefix, I can't recall which) into a NULL and the particular item transformed itself into a super fast marquee during runtime. The game (Medieval II) didn't crash; it rendered the UI just fine except for that particular item it simply appeared to cycle through a lot of glyphs/text/strings, too fast to read.
Bookmarks