Does that mean the "(base training xp)" calculation for this building is now raised to 20? And that the default for any building, if not mentioned, is 10?
No, it means that units that building applies to can train to 20 xp. The default for all buildings is 0, id est buildings don't normally allow training.
The (base training xp) I mentioned is
0.5 / ( current xp+1 ) xp per turn, or at least it was in January, the last
reference I have. (On normal speed.)
When a promotion or a building, anything says it modified training by some number, it's that number it's talking about. For instance Spell Extension I modifies training by .3 . That means that a fresh 0 xp adept with Spell Extension I gains .5*(0+1)*.3 = .15 xp per turn more than an adept without Spell Extension I.
The part about training only working up to level 4 is just my personal observation. The base value is then so small that the xp gained is negligible. .5*(10+1) = .05 , multiplied by two or three; that is Channeling I & II, some spell promotions... A mage gains .15 xp per turn, 50 turns to get another promotion. More actually, since more xp means slower gain.
Also, does this mean that the standard "<TrainXPRate>" is therefore .3 for any building for which is it not specified?
No, again it's zero. .3 is just a common value for those things that have a value.
It is called fCasterXPRate in promotions, same thing different name. Essentially it started as free xp for casters, then got appropriated for all units. It kept "caster" in the name for units, but for buildings it was named "train".
For fFreeXPCap and TrainXPCaps (same thing, units and buldings) only the greatest value is used. A unit allowed to train to 15 xp by promotion and 10 xp by building, can train to 15 xp.
TrainXPRates and fCasterXPRate add together. A unit with .4 training rate from promotion and .5 training rate from building gets (1+.4+.5)*0.5 / ( current xp+1 ) each turn. As long as it is not over all applicable fFreeXPCaps and TrainXPCaps.
Finally, not to pester you too much, but do you know where in the C++ code this is all handled? Or is it in python (I hope, then easier to mod!)
I know it is the dll, so C++ . More than that, I don't know. I avoid C++ like the plague.
---
If I was going to mod the training system, I'd start by removing all traces of the passive caster xp system. Just remove the tags from all buildings and promotions.
Then I'd add auto acquire promotions of the same type as Hero. They grant the same amount of xp each turn, making them easy to predict and thereby easier to balance. There is no need to reduce the xp gained when the unit gets more xp, each level already costs more to get.
I could then easily decide how long an Adept needs to mature. It needs 10 xp for magedom. If it should become a mage in 50 turns, it gets 10/50= .2 xp per turn. If a balanced number turns out to be 20 turns, I'd know exactly what to change and it would not have cascading changes the way the current system does.
Same thing for all other things that can train.
There are promotions prereqs for buildings, civilizations and much more.