According to information provided by you, I am now able to parse TEMPLATES.BIN properly, and compute DATA.R16 image entry indexes for unit art, building art, projectile art, animation art etc. Here I made a helper program that parses all the values (DATA.R16 image entry indexes are usually those 4-digit numbers) :
Sedondly, I discovered the logic how the game determines the version of building or unit (for example Harkonnen get Harkonnen-style buildings, only Emperor gets Emperor-type Construction yard and Heavy Factory, only Smugglers get Smugglers-type Starport, Sandworm gets Atreides-style buildings etc). I can precalculate the unit/building versions, and here are the results (they should match the real game behavior): unit_side_versions.txt building_side_versions.txt
@lovalmidas thank you very much for providing all the information you discovered, which pushed me way forward!