freem wrote:Ok, so tribes have different statistics. I was not able to determine that even by reading the code. Could you show me where tribe's stats are defined, please? And eventually, how encyclopedia is generated. Just in case I feel courageous enough to contribute more than some warning fixes (no promise here, really. I only contribute to stuff depending on my humor... and depending on how people behave when I say there is a need for refactoring hehe).
Each tribe is defined in their corresponding civilization's factions.lua file; for instance, the Brising Clan is defined in the /scripts/civilizations/dwarf/factions.lua file. One of the fields available when defining a faction is "FactionUpgrade", which contains an upgrade to apply to the faction's units. In the civilization's upgrade_faction.lua file you can see the defined upgrades for the different tribes (defined with DefineUpgrade), along with their respective upgrade modifiers (defined with DefineModifier). The modifiers actually carry out the effects of the upgrade, such as changing a unit type's stat. Besides changing unit type stats, upgrade modifiers can also change one unit type into another. Some factions have faction-specific unit types, so their faction upgrades change their units accordingly; for instance, the Brising Clan's faction upgrade changes that player's dwarven Miners into Brising Miners.
Faction-specific units are defined in their respective "units" file. For example, the Brising units are defined in the /scripts/civilizations/dwarf/units_brising.lua file. Some aspects related to the units are defined in the main /scripts/civilizations/dwarf/units.lua file, however (such as the dwarven Mead Hall being able to train Brising Miners).
If a faction has a "ParentFaction" defined, but no "FactionUpgrade" of its own, then it will use the upgrade of its parent.
I've pushed a few commits improving the organization of the faction upgrades and units (previously they were in the main files of their civilization), and making it so the faction entries in the encyclopedia show the faction's color and effects (previously these elements were shown only when selecting a faction in a custom game).
The encyclopedia is generated through the /scrips/menu/encyclopedia.lua file.