Difference between revisions of "Talk:Experience"

From UFOpaedia
Jump to navigation Jump to search
(okie doke)
 
(38 intermediate revisions by 11 users not shown)
Line 1: Line 1:
EtherealC, thanks for pointing out that mistake in the Secondary - CMs table. I did the calculations in a spreadsheet, but then typed the table by hand, since it was such an irregular table. Clearly I copied that "6" wrong... I had a whole lot of numbers in my head. :P
+
Just some thoughts I want to jot down before I forget them, based off a discussion I read on one of the forums:
  
I did a linear equation for this CMs table, instead of using the actual stairstep function shown on my other page... the reasoning being that, because you can't say someone will always get the average as they perform combats and "advance through" a step, smoothing it seemed a better idea... it better approximates what you'd see, on average (you might take one step fast, another slow).
+
* Kills. Just to be clear, it needs to be emphasised that kills do not count towards stat increases. Was this mentioned or has it been mentioned elsewhere?
  
That said, I just tried making the linear equation again to double-check "what was I thinking" when I put that 6, and found to my dismay that I am not reproducing the same numbers with my linear equation. E.g. I get 2.5 for TUs R_min (50), not 2.2 (and 3.5 for STR R_Min, as you said). I can't remember what I was thinking but I can recall there was some reason it made sense to not be right at the average with the linear equation. But now I can't remember it. So unless/until I do, the table should be re-done using a straight-forward linear equation (or even stairsteps).
+
* Similarly, kill attribution. When do you get the kill counter incremented. Grenades (thrown and unthrown), volatile battlescape element (i.e. gas tank), secondary explosion from cyberdisc, or volatile battlescape element set off by cyberdisc explosion. Probably by reactions and active attacks too. Don't remember if we ever quantified all the methods that'll increment the kill counter.  
  
Unfortunately I don't have the time right now to reconstruct my work to the point of putting the combat mission counts on top of the linear equation again... wouldn't you know it, it looks like this is one of the few things that I didn't packrat away. So for the time being I've just made that comment there. Maybe I'll get back to it some day, or anybody else can take a shot.
+
- [[User:NKF|NKF]]
  
As for your comment about "probably only 10 Bravery experience points are needed for an increase", here's how the data looked:
+
:Tested the secondary explosion from oil drums, found within my X-COM base hanger. Waited til that last snakeman soldier roamed around weaponlessly, and then smacked the barrel infront of him him. Boom, and Tatsuo Iwahara graduates to a squaddie after this base defense with 1 kills in 3 missions, via a unarmed snakeman using a barrel for cover. Can someone confirm my test?
  
    AC    Min    Ave +/- SDs  Max      N
+
:Hmm, but is only just off one barrel exploding. I don't know if things change, if you say, line up barrels across the screen and fry the poor sectoid at the other end. --[[User:Vagabond|Vagabond]] 01:53, 15 March 2007 (PDT)
    0    0    0.00  0.00    0    2004
 
    1    0    1.00  3.02    10    100
 
    2    0    0.90  2.88    10    100
 
    3    0    2.91  4.55    10    179
 
    4    0    4.47  4.99    10    150
 
    5    0    4.97  5.01   10    185
 
    6    0    5.13  5.01    10    150
 
    7    0    6.80  4.68    10    150
 
    8    0    6.80  4.68    10    150
 
    9    0    8.53   3.55    10    150
 
    10    0    8.92  3.12    10    249
 
    11    10    10.00  0.00    10    250
 
    12    10    10.00  0.00    10      50
 
    13    10    10.00  0.00    10      85
 
    30    10    10.00  0.00    10    133
 
    90    10    10.00  0.00    10    129
 
  250    10    10.00  0.00    10      50
 
  
Where AC is the "action" count (or experience count) value hacked into the Unitref.dat counter for Bravery (UR[85]), and Minimum, Average +/- Std. Dev. (sample), and Maximum are shown, together with the number of times tested. (The Ns are often nice round numbers because I would e.g. hack 10 soldiers in a savegame, then end that combat 15 times.) Don't be confused by the average; that is, you only get a 10 (or not), so the ave+SDs is actually a weighted average, as it were, of how often you get 10 or not for a given UR[85]. (That's why the SDs are huge and pretty much =5 in the middle.)
+
::I'm not positive, but I think the rule is "whoever takes the action gets the kill", i.e., the last soldier to take any sort of action which results in an enemy death gets credited. I infer this from how Proximity Grenades work: credit for the kill goes to whoever ''sets off'' the grenade. I suspect this'll be borne out for "chain reaction" kills and the like. Alien-on-alien kills probably don't apply (Cyberdisc explosions probably do), and grenade kills are already known to go to the last soldier who threw it.--[[User:Ethereal Cereal|Ethereal Cereal]] 02:54, 15 March 2007 (PDT)
  
The average ''kind of'' goes from 1 at AC=1 to 9 at AC=10, and then is always 10, for AC=11 and anything higher. As you can see, it is not smooth and odd at the ends (AC=1 practically equals AC=2, and AC=10 might've been expected to be equal or very close to 10, but it wasn't, etc.). Anyway, that's how the data was. Don't ask me why they chose 11 for experience counters and especially this, but they did. As you can see, I zeroed in around that 10/11 border with a bit of additional testing, but it held up.
 
  
Since Bravery is a pretty boring statistic all in all, I didn't do anything more with it except to make that simplified statement on the other page. But if somebody wants to stash this data or comments on it somewhere, go for it.
+
:Might also want to double check that the guy credited with the kill is '''not''' the first soldier in the list just to make sure it's not like dropping a grenade. --[[User:Pi Masta|Pi Masta]] 14:42, 15 March 2007 (PDT)
  
For the record: The above was for varying values of Bravery, as long as they were less than 100. (Which is actually stored as an "inverted" single-digit value which equals a x0 value - see Unitref and Soldier.dat - but nevermind that.) As for other primary stats, I found that the current Bravery value (0 to 90) had no effect on the increase, as long as it was below the cap of 100 (data not shown).
+
----
 +
 
 +
Hi folks, I've been off playing other games a long time (even caused a new wiki to be made for a game, plus of course contributed to many), but still love X-COM - and the many great folks on this wiki.
 +
 
 +
NKF, the fact that kills don't matter to Experience per se has been long cited at [[Firing_Accuracy#Improvement]]. The Experience page says to see each skill page, to see exactly how to trigger it. Apologies if you asked before I revised the pages - correlating History timestamps takes time. And also, apologies if it's now well understood. But if you or others would like to repeat it on Experience or elsewhere to hammer the point home, please do.
 +
 
 +
I, for one, don't remember too much being posted about attribution of secondary kills. It sounds like something to be explored. The exact same could be said for the Kill counter. I can't recall anything at all being said about any nuances of it. But then my memory is famously retarded. One interesting thing is that both [[UNITREF.DAT]] and [[SOLDIER.DAT]] have a two-byte field for it, so the programmers really pulled out the stops - they thought players might deliberately / well have a favorite soldier get hundreds of kills (>255).
 +
 
 +
Ethereal, don't forget the Prox Mine is an exception to the rule for every other weapon. In a sense, if you die from it, you get experience from dying, laugh. FWIW it was a real surprise, discovering how it worked. I wonder if the programmers screwed it up.
 +
 
 +
- [[User:MikeTheRed|MikeTheRed]] 20:57, 5 October 2007 (PDT)
 +
:I can confirm the programmers did screw up. The proxmines are treated as a special case, and contrary to grenades, the programmers forgot to set the current unit (i.e. the one that gets the credits) before generating the explosion. The fix I made in my patcher just sets the current unit (quantity2 field from obpos) and voila. [[User:Seb76|Seb76]] 12:45, 7 August 2008 (PDT)
 +
 
 +
P.S. The details that some of us wikians are getting into these days, can sometimes can really benefit from savegame postings where the first person took the time and care to set everything up, and then test it. Please folks, don't hesitate to post zipped savegames you used for testing!
 +
 
 +
-----
 +
 
 +
NKF, am I missing something, or where did Brunpal's comments finally wind up? I can't seem to find them not removed on any of the three pages. I am posting this here so he'll see it if he's tracking pages he posted to.
 +
 
 +
Brunpal, I made a start on your good question as the third part of [[Talk:Incendiary]]. I would have emailed you, but you aren't allowing email.
 +
 
 +
Good Xcomming, and thanks for your good question. As NKF said, no need to post in multiple places. It can be helpful to have a contact listed. :) - [[User:MikeTheRed|MikeTheRed]] 20:08, 1 August 2008 (PDT)
 +
 
 +
:Brunpal's comments remain on [[Talk:Experience Training]], MRT.  [[User:Arrow Quivershaft|Arrow Quivershaft]] 20:35, 1 August 2008 (PDT)
 +
::The discussion ended up on [[Talk:Experience_Training#Fire_and_Gaining_Experience]]. That page is the only spot my questions remain. Ya sorry about the multiple posts. All the pages had 8+ months since an update. I expected it would be months before someone would stumble onto one of the pages for a reply.--[[User:Brunpal|Brunpal]] 20:41, 1 August 2008 (PDT)
  
You can delete all this after reading, if you like.
 
  
---[[User:MikeTheRed|MikeTheRed]] 16:30, 17 May 2006 (PDT)
 
 
----
 
----
 +
I dont see it mentioned but the cap for TU's was different in UFO 1.0. According to the 1.2 readme that patch set the 80 limit. --[[User:BladeFireLight|BladeFireLight]] 21:49, 13 January 2010 (EST)
 +
 +
: It didn't have any caps as far as I remember. That's why a lot of players who were on 1.0 had soldiers crippled when their stats went past 255 and wrapped back around thanks to the high bits vanishing into the ether. -[[User:NKF|NKF]] 04:32, 14 January 2010 (EST)
 +
 +
== Experience Code ==
 +
 +
This how stats improvements updated after mission end:
 +
  function randmod(int a)
 +
  {
 +
    return Rand() % (a+1);
 +
  }
 +
  function StatImprove4(int exp_score)
 +
  {
 +
    if (exp_score<=0) return 0;
 +
    if (exp_score<=2) return 1;
 +
    if (exp_score<=5) return 2;
 +
    if (exp_score<=10) return 3;
 +
    return 4;
 +
  }
 +
  function StatImproveRND(int exp_score)
 +
  {
 +
    int v=StatImprove4(exp_score);
 +
    return v/2 + randmod(v);
 +
  }
 +
 +
main calculations done after battle:
 +
 +
  if (UnitRef->PsiSkill_experience>0 ||
 +
      UnitRef->Bravery_experience>0 ||
 +
      UnitRef->FireAccuracy_experience>0 ||
 +
      UnitRef->MeleeAccuracy_experience>0 ||
 +
      UnitRef->Reactions_experience>0)
 +
  {
 +
    if (!Soldier->Rank) Soldier->Rank = 1;
 +
    int v;
 +
    v = 80 - Soldier->BaseTUs - Soldier->ImproveTUs;
 +
    if (v > 0) Soldier->ImproveTUs += randmod(v/10 + 2);
 +
    v = 60 - Soldier->BaseHPs - Soldier->ImproveHPs;
 +
    if (v > 0) Soldier->ImproveHPs += randmod(v/10 + 2);
 +
    v = 70 - Soldier->BaseStrength - Soldier->ImproveStrength;
 +
    if (v > 0) Soldier->ImproveStrength += randmod(v/10 + 2);
 +
    v = 100 - Soldier->BaseEnergy - Soldier->ImproveEnergy;
 +
    if (v > 0) Soldier->ImproveEnergy += randmod(v/10 + 2);
 +
  }
 +
 +
  if ( Soldier->ImproveReactions + Soldier->BaseReactions < 100 )
 +
    Soldier->ImproveReactions += StatImproveRND(UnitRef->Reactions_experience);
 +
  if ( Soldier->ImproveFireAccuracy + Soldier->BaseFireAccuracy < 120 )
 +
    Soldier->ImproveFireAccuracy += StatImproveRND(UnitRef->FireAccuracy_experience);
 +
  if ( Soldier->ImproveMeleeAccuracy + Soldier->BaseMeleeAccuracy < 120 )
 +
    Soldier->ImproveMeleeAccuracy += StatImproveRND(UnitRef->MeleeAccuracy_experience);
 +
  if ( Soldier->ImproveThrowAccuracy + Soldier->BaseThrowAccuracy < 120 )
 +
    Soldier->ImproveThrowAccuracy += StatImproveRND(UnitRef->ThrowAccuracy_experience);
 +
  if ( Soldier->ImprovePsiSkill + Soldier->BasePsiSkill < 100 )
 +
    Soldier->ImprovePsiSkill += StatImproveRND(UnitRef->PsiSkill_experience);
 +
  if ( Soldier->BaseBravery - Soldier->ImproveBravery > 1 )
 +
    if ( UnitRef->Bravery_experience>randmod(10) ) ++Soldier->ImproveBravery;
 +
  if ( UnitRef->CurHPs < UnitRef->BaseHPs ) //wounded
 +
  {
 +
    int v = UnitRef->BaseHPs - UnitRef->CurHPs;
 +
    Soldier->Wound_Recovery_Days = v / 2 + randmod(v);
 +
  }
 +
 +
--[[User:Volutar|Volutar]] 11:17, 13 March 2011 (EDT)
 +
 +
Each solder being in psi-training received some skill progress each month. The formula is:
 +
 +
  if (Soldier->InPsiLab)
 +
  {
 +
    if (Soldier->PsiSkill > 50)
 +
      Soldier->PsiSkill_Monthly_Improve = randmod(2) + 1;
 +
    else if (Soldier->PsiSkill > 16)
 +
      Soldier->PsiSkill_Monthly_Improve = randmod(7) + 5;
 +
    else
 +
      Soldier->PsiSkill_Monthly_Improve = randmod(8) + 16;
 +
    Soldier->PsiSkill += Soldier->PsiSkill_MonthImprove;
 +
  }
 +
  else
 +
    Soldier->PsiSkill_Monthly_Improve = 0;
 +
 +
As we clearly see there is no cap for montly PsiSkill improvement. After reaching level of 100 (with missions or montly) this skill will continue to grow 1..3 each month. And it doesn't matter if soldier started training at month start or 1 minute before month end :).
 +
 +
--[[User:Volutar|Volutar]] 11:23, 14 March 2011 (EDT)
 +
 +
:Hi Volutar, I have been away. I did the testing on the page, and definitely found you needed 11 actions for max improvement, across hundreds of tests. Please say more: What version were you using? (CE, DOS, etc.) I tested in DOS 1.4. Where is the code, and what tool did you use to decode? Have you actually tested? It's ok to say No - your code is still greatly appreciated. I wish I had it back then! But X-COM has many instances of rounding affecting results.
 +
 +
:(Does anyone else know where the code is and how to decode?)
 +
 +
:Thanks -[[User:MikeTheRed|MikeTheRed]] 18:26, 5 August 2012 (EDT)
 +
 +
::K, here's a [[Media:X-ComNoobsWith10or11inExpCounters.zip|savegame]] that has 14 soldiers, all with 50 for Firing, Reactions, Throwing, and Psy in SOLDIER.DAT. (You will have to quit the combat to see this.) Also, the first 7 have 10 for their number of Kills and for all four Experience Counters (ECs), the second 7 have 11 for the same values in UNITREF.DAT. You can tell if you're seeing the max primary actions if there are increases of 5 and 6s, but no 1s, for the soldiers. But if you see 1s and no 5s and 6s, you're not seeing the max experience roll. Quit the combat and see what you get with the first 7 versus the second 7.
 +
 +
::So, in DOS X-COM, it still takes 11 ECs. (Should I add, oh ye of little faith? heh) Can someone check CE so we can know whether it's different, or there's something more than the code shown here?
 +
 +
::Thanks -[[User:MikeTheRed|MikeTheRed]] 00:09, 1 September 2012 (EDT)
 +
 +
::: First of all - sorry for late response. Originally I was inspecting CE version, bought in "steam". I was thinking these formulas in DOS/CE are the same. I haven't tested them, I just have not time for these trials, but I have strong knowledge about this code (I also re-checked it few times). Code was decoded with IDA - in the function at .text:004471B0 named "Updates_After_Mission_End". And I don't know what in the world can prevent them from working the way I've described :).(.--[[User:Volutar|Volutar]] 23:16, 2 September 2012 (EDT)
 +
 +
::::A fencepost problem perhaps? [[User:NKF|NKF]]
 +
::::: I've revised StatImprove4 function.. I've shown slightly incorrect border values.
 +
Code snippet:
 +
  exp = cur_unitref->MeleeAccuracy_exp_cnt;
 +
  if ( exp )
 +
  {
 +
    if ( exp <= 10u )
 +
    {
 +
      if ( exp <= 5u )
 +
        val = ( exp > 2u) + 1;
 +
      else
 +
        val = 3;
 +
    }
 +
    else
 +
    {
 +
      val = 4;
 +
    }
 +
    soldier_addr->ImproveMeleeAcc += val / 2 + xc_RandMod(val);
 +
  }
 +
 +
So 10 EC is level 3 and 11 EC is level 4 of improvement.
 +
 +
lvl  EC    improve range
 +
1:  1..2  0..1
 +
2:  3..5  1..3
 +
3:  6..10  1..4
 +
4:  11..  2..6
 +
 +
--[[User:Volutar|Volutar]] 02:25, 3 September 2012 (EDT)
 +
 +
:Great, thanks Volutar... I knew I'd seen 11 be the value tons of times. Testing is good and de-coding is great, but what's really best, is both. :)
 +
 +
: Are you just using [http://www.hex-rays.com/products/ida/support/download.shtml IDA 5.0 Freeware] or does it need any other plugin or whatever? FWIW we really should have some entries on the [[Game_editors]] page concerning decoders to get, and maybe a little primer on using them (on its own separate page).
 +
 +
:Thanks again! -[[User:MikeTheRed|MikeTheRed]] 11:23, 12 September 2012 (EDT)
 +
 +
:P.S. The number 11 may seem an odd value to use, but it was also chosen for the [[Talk:Bravery|Bravery]] experience counter, which works differently. (See the top and bottom of that talk page.) So I think it was deliberate (but don't ask me why). I vaguely recall that 11 was singled out somewhere else in the game, too.
 +
 +
== "Putting it all together" ==
 +
 +
It says that in the endgame where money is not an issue and you just want supersoldiers, then it's mostly important to pick recruits who are not anomalously low in any stat. I don't think this is very accurate; your first two priorities would be the two stats that '''can't''' be improved - Psi-Strength and the lesser-known Energy Recharge (which is based on a rookie's initial TU). So you'd select for soldiers without anomalously low stats only after selecting for high Psi-Strength and high TU (because Psi-Strength can't be improved at all, and while TU can be improved the derived Energy Recharge '''cannot''').
  
I much prefer leaving discussions undeleted -- they often let you know more about the thinking that went into an edit.  The bravery data you input above is just what's needed to ward off "why 11 and not 10?" questions, for instance.  Yeah, I know you can find them in the history -- but discussion pages don't need tidying like article pages do, IMO.
+
Am I missing something or should I edit this? [[User:Magic9mushroom|Magic9mushroom]] ([[User talk:Magic9mushroom|talk]]) 05:21, 13 August 2014 (EDT)
  
Anyhow, thanks for the data, I'm convinced.  Good luck cleaning up the CMs table. :-P
+
: Edit away. I think the only reason to look for reasonably good stats, or more specifically good primary stats, is to save time with the stat grinding. Apart from TUs for the energy recharge, it shouldn't matter too much for some of the secondary stats thanks to the range adjustments. [[User:NKF|NKF]] ([[User talk:NKF|talk]]) 05:42, 13 August 2014 (EDT)

Latest revision as of 09:42, 13 August 2014

Just some thoughts I want to jot down before I forget them, based off a discussion I read on one of the forums:

  • Kills. Just to be clear, it needs to be emphasised that kills do not count towards stat increases. Was this mentioned or has it been mentioned elsewhere?
  • Similarly, kill attribution. When do you get the kill counter incremented. Grenades (thrown and unthrown), volatile battlescape element (i.e. gas tank), secondary explosion from cyberdisc, or volatile battlescape element set off by cyberdisc explosion. Probably by reactions and active attacks too. Don't remember if we ever quantified all the methods that'll increment the kill counter.

- NKF

Tested the secondary explosion from oil drums, found within my X-COM base hanger. Waited til that last snakeman soldier roamed around weaponlessly, and then smacked the barrel infront of him him. Boom, and Tatsuo Iwahara graduates to a squaddie after this base defense with 1 kills in 3 missions, via a unarmed snakeman using a barrel for cover. Can someone confirm my test?
Hmm, but is only just off one barrel exploding. I don't know if things change, if you say, line up barrels across the screen and fry the poor sectoid at the other end. --Vagabond 01:53, 15 March 2007 (PDT)
I'm not positive, but I think the rule is "whoever takes the action gets the kill", i.e., the last soldier to take any sort of action which results in an enemy death gets credited. I infer this from how Proximity Grenades work: credit for the kill goes to whoever sets off the grenade. I suspect this'll be borne out for "chain reaction" kills and the like. Alien-on-alien kills probably don't apply (Cyberdisc explosions probably do), and grenade kills are already known to go to the last soldier who threw it.--Ethereal Cereal 02:54, 15 March 2007 (PDT)


Might also want to double check that the guy credited with the kill is not the first soldier in the list just to make sure it's not like dropping a grenade. --Pi Masta 14:42, 15 March 2007 (PDT)

Hi folks, I've been off playing other games a long time (even caused a new wiki to be made for a game, plus of course contributed to many), but still love X-COM - and the many great folks on this wiki.

NKF, the fact that kills don't matter to Experience per se has been long cited at Firing_Accuracy#Improvement. The Experience page says to see each skill page, to see exactly how to trigger it. Apologies if you asked before I revised the pages - correlating History timestamps takes time. And also, apologies if it's now well understood. But if you or others would like to repeat it on Experience or elsewhere to hammer the point home, please do.

I, for one, don't remember too much being posted about attribution of secondary kills. It sounds like something to be explored. The exact same could be said for the Kill counter. I can't recall anything at all being said about any nuances of it. But then my memory is famously retarded. One interesting thing is that both UNITREF.DAT and SOLDIER.DAT have a two-byte field for it, so the programmers really pulled out the stops - they thought players might deliberately / well have a favorite soldier get hundreds of kills (>255).

Ethereal, don't forget the Prox Mine is an exception to the rule for every other weapon. In a sense, if you die from it, you get experience from dying, laugh. FWIW it was a real surprise, discovering how it worked. I wonder if the programmers screwed it up.

- MikeTheRed 20:57, 5 October 2007 (PDT)

I can confirm the programmers did screw up. The proxmines are treated as a special case, and contrary to grenades, the programmers forgot to set the current unit (i.e. the one that gets the credits) before generating the explosion. The fix I made in my patcher just sets the current unit (quantity2 field from obpos) and voila. Seb76 12:45, 7 August 2008 (PDT)

P.S. The details that some of us wikians are getting into these days, can sometimes can really benefit from savegame postings where the first person took the time and care to set everything up, and then test it. Please folks, don't hesitate to post zipped savegames you used for testing!


NKF, am I missing something, or where did Brunpal's comments finally wind up? I can't seem to find them not removed on any of the three pages. I am posting this here so he'll see it if he's tracking pages he posted to.

Brunpal, I made a start on your good question as the third part of Talk:Incendiary. I would have emailed you, but you aren't allowing email.

Good Xcomming, and thanks for your good question. As NKF said, no need to post in multiple places. It can be helpful to have a contact listed. :) - MikeTheRed 20:08, 1 August 2008 (PDT)

Brunpal's comments remain on Talk:Experience Training, MRT. Arrow Quivershaft 20:35, 1 August 2008 (PDT)
The discussion ended up on Talk:Experience_Training#Fire_and_Gaining_Experience. That page is the only spot my questions remain. Ya sorry about the multiple posts. All the pages had 8+ months since an update. I expected it would be months before someone would stumble onto one of the pages for a reply.--Brunpal 20:41, 1 August 2008 (PDT)



I dont see it mentioned but the cap for TU's was different in UFO 1.0. According to the 1.2 readme that patch set the 80 limit. --BladeFireLight 21:49, 13 January 2010 (EST)

It didn't have any caps as far as I remember. That's why a lot of players who were on 1.0 had soldiers crippled when their stats went past 255 and wrapped back around thanks to the high bits vanishing into the ether. -NKF 04:32, 14 January 2010 (EST)

Experience Code

This how stats improvements updated after mission end:

 function randmod(int a)
 {
   return Rand() % (a+1);
 }
 function StatImprove4(int exp_score)
 {
   if (exp_score<=0) return 0;
   if (exp_score<=2) return 1;
   if (exp_score<=5) return 2;
   if (exp_score<=10) return 3;
   return 4;
 }
 function StatImproveRND(int exp_score)
 {
   int v=StatImprove4(exp_score);
   return v/2 + randmod(v);
 }

main calculations done after battle:

 if (UnitRef->PsiSkill_experience>0 ||
     UnitRef->Bravery_experience>0 ||
     UnitRef->FireAccuracy_experience>0 ||
     UnitRef->MeleeAccuracy_experience>0 ||
     UnitRef->Reactions_experience>0)
 {
   if (!Soldier->Rank) Soldier->Rank = 1;
   int v;
   v = 80 - Soldier->BaseTUs - Soldier->ImproveTUs;
   if (v > 0) Soldier->ImproveTUs += randmod(v/10 + 2);
   v = 60 - Soldier->BaseHPs - Soldier->ImproveHPs;
   if (v > 0) Soldier->ImproveHPs += randmod(v/10 + 2);
   v = 70 - Soldier->BaseStrength - Soldier->ImproveStrength;
   if (v > 0) Soldier->ImproveStrength += randmod(v/10 + 2);
   v = 100 - Soldier->BaseEnergy - Soldier->ImproveEnergy;
   if (v > 0) Soldier->ImproveEnergy += randmod(v/10 + 2);
 } 
 if ( Soldier->ImproveReactions + Soldier->BaseReactions < 100 )
   Soldier->ImproveReactions += StatImproveRND(UnitRef->Reactions_experience);
 if ( Soldier->ImproveFireAccuracy + Soldier->BaseFireAccuracy < 120 )
   Soldier->ImproveFireAccuracy += StatImproveRND(UnitRef->FireAccuracy_experience);
 if ( Soldier->ImproveMeleeAccuracy + Soldier->BaseMeleeAccuracy < 120 )
   Soldier->ImproveMeleeAccuracy += StatImproveRND(UnitRef->MeleeAccuracy_experience);
 if ( Soldier->ImproveThrowAccuracy + Soldier->BaseThrowAccuracy < 120 )
   Soldier->ImproveThrowAccuracy += StatImproveRND(UnitRef->ThrowAccuracy_experience);
 if ( Soldier->ImprovePsiSkill + Soldier->BasePsiSkill < 100 )
   Soldier->ImprovePsiSkill += StatImproveRND(UnitRef->PsiSkill_experience);
 if ( Soldier->BaseBravery - Soldier->ImproveBravery > 1 )
   if ( UnitRef->Bravery_experience>randmod(10) ) ++Soldier->ImproveBravery;
 if ( UnitRef->CurHPs < UnitRef->BaseHPs ) //wounded
 {
   int v = UnitRef->BaseHPs - UnitRef->CurHPs;
   Soldier->Wound_Recovery_Days = v / 2 + randmod(v);
 }

--Volutar 11:17, 13 March 2011 (EDT)

Each solder being in psi-training received some skill progress each month. The formula is:

 if (Soldier->InPsiLab)
 {
   if (Soldier->PsiSkill > 50)
     Soldier->PsiSkill_Monthly_Improve = randmod(2) + 1;
   else if (Soldier->PsiSkill > 16)
     Soldier->PsiSkill_Monthly_Improve = randmod(7) + 5;
   else
     Soldier->PsiSkill_Monthly_Improve = randmod(8) + 16;
   Soldier->PsiSkill += Soldier->PsiSkill_MonthImprove;
 }
 else
   Soldier->PsiSkill_Monthly_Improve = 0;

As we clearly see there is no cap for montly PsiSkill improvement. After reaching level of 100 (with missions or montly) this skill will continue to grow 1..3 each month. And it doesn't matter if soldier started training at month start or 1 minute before month end :).

--Volutar 11:23, 14 March 2011 (EDT)

Hi Volutar, I have been away. I did the testing on the page, and definitely found you needed 11 actions for max improvement, across hundreds of tests. Please say more: What version were you using? (CE, DOS, etc.) I tested in DOS 1.4. Where is the code, and what tool did you use to decode? Have you actually tested? It's ok to say No - your code is still greatly appreciated. I wish I had it back then! But X-COM has many instances of rounding affecting results.
(Does anyone else know where the code is and how to decode?)
Thanks -MikeTheRed 18:26, 5 August 2012 (EDT)
K, here's a savegame that has 14 soldiers, all with 50 for Firing, Reactions, Throwing, and Psy in SOLDIER.DAT. (You will have to quit the combat to see this.) Also, the first 7 have 10 for their number of Kills and for all four Experience Counters (ECs), the second 7 have 11 for the same values in UNITREF.DAT. You can tell if you're seeing the max primary actions if there are increases of 5 and 6s, but no 1s, for the soldiers. But if you see 1s and no 5s and 6s, you're not seeing the max experience roll. Quit the combat and see what you get with the first 7 versus the second 7.
So, in DOS X-COM, it still takes 11 ECs. (Should I add, oh ye of little faith? heh) Can someone check CE so we can know whether it's different, or there's something more than the code shown here?
Thanks -MikeTheRed 00:09, 1 September 2012 (EDT)
First of all - sorry for late response. Originally I was inspecting CE version, bought in "steam". I was thinking these formulas in DOS/CE are the same. I haven't tested them, I just have not time for these trials, but I have strong knowledge about this code (I also re-checked it few times). Code was decoded with IDA - in the function at .text:004471B0 named "Updates_After_Mission_End". And I don't know what in the world can prevent them from working the way I've described :).(.--Volutar 23:16, 2 September 2012 (EDT)
A fencepost problem perhaps? NKF
I've revised StatImprove4 function.. I've shown slightly incorrect border values.

Code snippet:

 exp = cur_unitref->MeleeAccuracy_exp_cnt;
 if ( exp )
  {
   if ( exp <= 10u )
    {
     if ( exp <= 5u )
       val = ( exp > 2u) + 1;
     else
       val = 3;
    }
   else
    {
     val = 4;
    }
   soldier_addr->ImproveMeleeAcc += val / 2 + xc_RandMod(val);
  }

So 10 EC is level 3 and 11 EC is level 4 of improvement.

lvl  EC     improve range
1:  1..2   0..1
2:  3..5   1..3
3:  6..10  1..4
4:  11..   2..6

--Volutar 02:25, 3 September 2012 (EDT)

Great, thanks Volutar... I knew I'd seen 11 be the value tons of times. Testing is good and de-coding is great, but what's really best, is both. :)
Are you just using IDA 5.0 Freeware or does it need any other plugin or whatever? FWIW we really should have some entries on the Game_editors page concerning decoders to get, and maybe a little primer on using them (on its own separate page).
Thanks again! -MikeTheRed 11:23, 12 September 2012 (EDT)
P.S. The number 11 may seem an odd value to use, but it was also chosen for the Bravery experience counter, which works differently. (See the top and bottom of that talk page.) So I think it was deliberate (but don't ask me why). I vaguely recall that 11 was singled out somewhere else in the game, too.

"Putting it all together"

It says that in the endgame where money is not an issue and you just want supersoldiers, then it's mostly important to pick recruits who are not anomalously low in any stat. I don't think this is very accurate; your first two priorities would be the two stats that can't be improved - Psi-Strength and the lesser-known Energy Recharge (which is based on a rookie's initial TU). So you'd select for soldiers without anomalously low stats only after selecting for high Psi-Strength and high TU (because Psi-Strength can't be improved at all, and while TU can be improved the derived Energy Recharge cannot).

Am I missing something or should I edit this? Magic9mushroom (talk) 05:21, 13 August 2014 (EDT)

Edit away. I think the only reason to look for reasonably good stats, or more specifically good primary stats, is to save time with the stat grinding. Apart from TUs for the energy recharge, it shouldn't matter too much for some of the secondary stats thanks to the range adjustments. NKF (talk) 05:42, 13 August 2014 (EDT)