Iceco
Warlord
- Joined
- Oct 27, 2010
- Messages
- 188

Garrison Training (v. 4)
---- by Iceco
Units garrisoned in a city with a Sparring Grounds (new building) built in it have a chance of gaining experience.
The chance depends on:
- Unit's Combat Type: Melee units have the highest chance, then mounts, archers and eventually siege engines.
* Naval and aerial combat units can not garrison in a city.
* Unknown Combat Types, as those modded-in by others, are defaulted to use the same chance as that of mounted units. - Player's Era: The chance increases as you reach a new eras.
- Game Speed: The slower the game speed, the lower the chance. (I.e. on Marathon you have less chance than on Standard.)
- Player's Unit Count: The more units (including workers etc.) you have, the less chance for experience gain.
* The influence of this factor is diminished for AI players, as the AI favours (and needs) a higher quantity of troops to measure up to human adversaries.
Rationale
This mod is created to give passive civs a fighting chance against those geared towards conquest, who gain massive amounts of XP through battle and generally have a tech and quantity advantage as well.
Explanation of factors in calculation:
- The less a unit otherwise would benefit from being garrisoned or otherwise stationed in the city, the more it is rewarded for this passive behaviour.
- In later eras, the game generally picks up speed, there's less time left to benefit from it, the Armory and Military Academy are introduced and the Unit Count (point 4) goes up.
- With slower pace, production and tech advance slows down too and there are more turn to benefit from it.
- The more units a player has, the more military oriented he is and the less he needs compensation against (other) militarily strong players.
I first brought up this idea here.
Version history
Spoiler :
v. 4 (21 Mar 2011)
- Multiplayer is now supported
- Fixed +1XP per turn replaced by % chance, based on several factors
* Effect no longer limited to melee units
* Cap of 60XP removed - Mutual exclusivity with Armory removed
- Changes to Flavor of Sparring Grounds
- Bugfix: correctly set dependency on Sparring Grounds (was -still- on Barracks)
- Addition of the Sparring Grounds building (mutually exclusive with Armory)
- Can't gain XP when a unit already has 60XP or more
- First complete version
Alpaca and Gedemon for their documentation on and examples of Lua coding, the Lua tutorial on the Civ 5 wiki and the code of his City States UU mod respectively.
MouseyPounds and SamBC for helping me during development, solving the things I had problems with here.
Again SamBC and now Spatzimaus for their feedback here.
If you want to incorporate this mod in yours, please let me know and give credit.