Part of Europa Barbarorum is the unique look of the UI for various culture groups. If you have modded UI for RTW or M2TW you will be familiar with the following workflow:
- Change some TGA files to suit your look
- Run the game
- Rinse and repeat.
However in M2TW the second step now “does more”. It used to be that the UI was whatever you defined in some TGA files, but M2TW introduces a new file format with the SD file extension.
This format contains all meta data about UI: what TGA files it consists of, what “sprites” (buttons) are defined on which TGA file and where. This meta data is largely defined in code inside another new type of file with the file extension .SD.XML. Since it is a simple XML format you can edit this code with any simple texteditor. All in all it is a lot more flexible than the old RTW approach where the position and the names of the TGA files were pretty much hardcoded.
Unfortunately in M2TW the “does more” part is also accompanied by “has more bugs”. In particular the game engine is supposed to automatically update SD files when the source code in the SD.XML files has changed. This mostly works, except for the strategy.sd file in which case the engine will fail to cooperate in this scheme unless you pollute the “vanilla” M2TW files outside of your mod directory.
Additionally, if you make mistakes in your SD.XML source code the engine wil most helpfully display a corrupted UI at best, or a garbled mess at worst. Try as you might, but you will not find any error message about your SD.XML code in the logs, hence why typical forum advice discussing errors in SD.XML code boils down to: “when you hit an error: start over”.
Of course the team working on Europa Barbarorum II is not infallible and, so, we did manage to mess things up. Since we are loathe to start over (it took us long enough to begin with!), and since we were looking to generate the files when possible on our Linux server for the purpose of building installers automatically anyway, I decided this was a good opportunity to kill two birds with one stone and wrote a tool to solve this problem.
The new SD tool provides the basics of converting SD.XML source code into an SD file. Additionally it provides for validation of the code: it checks if sprite declarations do not refer to bogus names for instance, and if the sprite can possibly fit on the page as it is declared. (For instance the tool will reject code
attempting to fit a sprite 516 pixels below the top of a 512×512 page.)
Today the Europa Barbarorum team releases the SD tool to the wider modding community in the hope that they might find it useful. For information about where to download and how to use it, please refer to this thread: https://forums.totalwar.org/vb/showt...he-SD-mod-tool.
Finally the work on the tool has been sped up considerably by the fact that there is a much older tool by alpaca which attempted to tackle the basic problem of generating SD files through reading custom formatted text files. His work ensured that I had a handy reference guide to writing files in the SD format.
Regards,
Bookmarks