Training rate and training cap

Vorpal+5

Venturing in Erebus
Joined
Mar 25, 2008
Messages
658
I'm a bit confused by the two concepts. Can I have training in a city which has a 0 training rate but have a training cap (for the said unit class). What about the reverse also? If I don't have a training cap but I have a training rate, would it means that I can get xp indefinitely?


Specific case: training cap 10 XP, but no training rate for say recon in city? Result?

Training cap 0, but training rate 0.50 for melee? Result? To which cap?

If both? Does it cumulates?
 
Cap is the experience your uints can reach through training, while rate is experience per turn (modified by some formula). No cap = infinite xp gain. The no cap situation usualy only occurs when dealing with Disciple and Arcane units.
 
Cap is the experience your uints can reach through training, while rate is experience per turn (modified by some formula). No cap = infinite xp gain. The no cap situation usualy only occurs when dealing with Disciple and Arcane units.

There is always a cap.
 
Aye, if there is no cap on the CITY, then the rate only assists those who have a cap on the UNIT, which would be Arcane/Disciple usually. Same with the cap and no rate, those who have a rate of their own have an augmented cap while in the city.
 
Would have to test it out. Or pop up the code and peek real quick, but I do not recall there being any global base training rate, so it SHOULDN'T happen (which doesn't always mean it WON'T happen of course)

The global base training rate is 1 .

From memory, xp gained per turn is:
Code:
C*(1+rate_modifiers)/current_xp

C is some constant based on game speed

Disclaimer:
Based on comments made in this forum, not introspection of code.
 
Yup, seems there is a base rate, so with a cap and no rate you do gain slowly.

Code:
            int iXPGain = (int)((10000*(1+getCasterXPRate()))/((GC.getGameSpeedInfo(GC.getGameINLINE().getGameSpeedType()).getGrowthPercent()/50)*(getExperience()+100)));
            changeExperience(std::max(1, iXPGain), -1, false, false, false);

Remember that in the DLL XP is an integer, not a float. And it is 100 times larger than what gets displayed. Thus level 2 starts at 200 XP, not 2.00
 
to prevent OOS (atleast that's what I have heard and it sounds logical) base BTS uses the same for culture, traderoutes and probably some other stuff.
 
To elaborate on the OOS theory: Supposedly different Operating Systems (*nix, XP and Vista, now Win7) have different rules for how far out they carry a float and which way they round when it does get rounded off. This can in theory eventually lead to issues with OOS problems.

But precise to this exact case: There was a TON of base code which I didn't have to touch at all if I left it as an integer while inside of the DLL. The quantity of edits required to make it into a true float were far too numerous for me to consider it a worthwhile endeavor, since using this method is not going to be noticed as not actually being a float any time soon.
 
But precise to this exact case: There was a TON of base code which I didn't have to touch at all if I left it as an integer while inside of the DLL. The quantity of edits required to make it into a true float were far too numerous for me to consider it a worthwhile endeavor, since using this method is not going to be noticed as not actually being a float any time soon.

That's actually the reason I assumed, and is a perfectly valid one. You have limited time with which to code, so if you can take a shortcut that won't really affect the player, it's perfectly reasonable. ;)
 
Back to the original problem, I have Cetratus in my capital which are gaining xp every turn but I don't see any training rate for them... though there is a training cap...

The base training rate is 1, so there is no problem. They are intended to be gaining experience.
 
Top Bottom