I will post exact formulas once it is implemented.
So, I added some more options.
Per soldier type you can now define the training caps (attribute "trainingStatCaps").
Before this change, the caps were by default 100. Yes, not the max stat cap, but flat 100. After the change, they are by default equal to max stat caps... and can be overridden by modders, e.g. like this:
- type: STR_SOLDIER_S
costBuy: 20000
costSalary: 5000
trainingStatCaps:
tu: 100
stamina: 200
health: 60
bravery: 0
reactions: 0
firing: 120
throwing: 75
strength: 120
psiStrength: 0
psiSkill: 0
melee: 200
minStats:
tu: 60
stamina: 30
health: 40
bravery: 10
reactions: 40
firing: 40
throwing: 30
strength: 10
psiStrength: 25
psiSkill: 0
melee: 30
maxStats:
tu: 80
stamina: 80
health: 60
bravery: 70
reactions: 70
firing: 70
throwing: 60
strength: 50
psiStrength: 60
psiSkill: 10
melee: 90
statCaps:
tu: 100
stamina: 140
health: 90
bravery: 100
reactions: 100
firing: 120
throwing: 90
strength: 80
psiStrength: 60
psiSkill: 40
melee: 140
armor: STR_ADVENTURER_OUTFIT_UC
armorForAvatar: STR_BARBARIAN_RAGS_UC
avatarOffsetX: 66
avatarOffsetY: 43
standHeight: 22
kneelHeight: 14
femaleFrequency: 50
soldierNames:
- delete
- SoldierName/Pirate.nam
deathMale: [41, 42, 43]
deathFemale: [44, 45, 46]
Examples:
1. stat cap for Stamina=140 and trainingCap=140... stamina will increase (gradually slower) all the way up to 140
2. stat cap for Stamina=140 and trainingCap=200... stamina will increase (gradually slower, but quicker than in example 1) all the way up to 140... NOT to 200!
3. stat cap for Stamina=140 and trainingCap=90... stamina will increase (gradually slower, and slower than in examples 1 and 2) all the way up to 90 only... NOT to 140!
The speed by which it increases is determined by the difference between current soldier stat and by the training cap... see formula below.
Basically if soldier has stat=70 and training cap=140, chance is 50% to increase.
void Soldier::trainPhys(int customTrainingFactor)
{
UnitStats caps1 = _rules->getStatCaps();
UnitStats caps2 = _rules->getTrainingStatCaps();
https:// no P.T. for the wounded
if (_recovery == 0)
{
if(_currentStats.firing < caps1.firing && RNG::generate(0, caps2.firing) > _currentStats.firing && RNG::percent(customTrainingFactor))
_currentStats.firing++;
if(_currentStats.health < caps1.health && RNG::generate(0, caps2.health) > _currentStats.health && RNG::percent(customTrainingFactor))
_currentStats.health++;
if(_currentStats.melee < caps1.melee && RNG::generate(0, caps2.melee) > _currentStats.melee && RNG::percent(customTrainingFactor))
_currentStats.melee++;
if(_currentStats.throwing < caps1.throwing && RNG::generate(0, caps2.throwing) > _currentStats.throwing && RNG::percent(customTrainingFactor))
_currentStats.throwing++;
if(_currentStats.strength < caps1.strength && RNG::generate(0, caps2.strength) > _currentStats.strength && RNG::percent(customTrainingFactor))
_currentStats.strength++;
if(_currentStats.tu < caps1.tu && RNG::generate(0, caps2.tu) > _currentStats.tu && RNG::percent(customTrainingFactor))
_currentStats.tu++;
if(_currentStats.stamina < caps1.stamina && RNG::generate(0, caps2.stamina) > _currentStats.stamina && RNG::percent(customTrainingFactor))
_currentStats.stamina++;
}
}
So to recap:
a/ by default soldiers can max out their stats in training now (before they could only go until 100)
b/ this cap is moddable... still cannot go over the normal max stat cap, but can go below
c/ speed of training (per stat) can be increased/decreased by increasing/decreasing the training caps... note that decreasing will also act as stat limit, increasing will not act as limit... you can set it for example to 999999 if you want to train/improve each day
d/ the speed of training decreases gradually, depending on current soldier stat and training cap... modders can also decrease it by flat percentage (with an already existing option "customTrainingFactor" described in previous posts)
Decreasing speed is already possible, I just promised Meridian to leave it alone till he has his dream team trained
Also I think price + capacity is limiting enough in Piratez. And I don't personally care if someone reaches cap or not, 90+ is good enough for me (at this point, progress during mission becomes much faster than training anyway; and training is easy to perform if your stats are already high, eg. you will Firing fast if you want to, since you will score many hits).
The dream team is trained
Feel free to rebalance the caps and the speed as you like.