Jump to content

Experience values


Wulf2k

Recommended Posts

Roughly the XP gain explained what I’ve read in the code gibberish:

 

Rookie: 0

Squaddie: 90

Corporal: 300

Sergeant: 510

Lieutenant: 745

Captain: 1100

Major: 1560

Colonel: 2150

 

m_iPsiXPLevels=0

m_iPsiXPLevels=50

m_iPsiXPLevels=120

 

Kill: 30, 60 if lower rank than Lieutenant and alien is of higher rank like Chryssalid, Sectoid Commander, Ethereal, Uber Ethereal, Elite Muton, Sectopod, or Muton Berserker

OTS trait increases Kill XP by 25%

 

Mission Complete: 60, 90 if soldier of lower rank hadn’t seen yet any better aliens

Special Mission Complete: 120, 180 if soldier of lower rank hadn’t seen yet any better aliens

Zero Dead Soldier Bonus: 20

 

Resist Psi Attack: 10

Successful Mindfray: 20

Successful Inspiration: 30

Assist Psi Inspiration: 30

Successful Psi Panic: 30

 

Better don’t quote me on that for correctness but should be better than no idea at all.

Link to comment
Share on other sites

All info is from XComGame.upk\XGTacticalGameCore

 

 

enum EGameEvent
{
   eGameEvent_Kill,
   eGameEvent_Wound,
   eGameEvent_Heal,
   eGameEvent_Turn,
   eGameEvent_MissionComplete,
   eGameEvent_SpecialMissionComplete,
   eGameEvent_ZeroDeadSoldiersBonus,
   eGameEvent_TargetResistPsiAttack,
   eGameEvent_KillMindControlEnemy,
   eGameEvent_SuccessfulMindControl,
   eGameEvent_SuccessfulMindFray,
   eGameEvent_SuccessfulInspiration,
   eGameEvent_AssistPsiInspiration,
   eGameEvent_Sight,
   eGameEvent_SuccessfulPsiPanic,
   eGameEvent_MAX
};

noexport simulated function bool IsBetterAlien(TSoldier kSoldier, int iTargetCharType, optional bool bCheckSoldierRank)
{
   local int iRank;
   local bool isLesserRank;
   local int iAlien;

   bCheckSoldierRank = true;
   iRank = kSoldier.iRank;
   iAlien = iTargetCharType;
   // End:0x66 Loop:False
   if(bCheckSoldierRank)
   {
       isLesserRank = iRank < 4;
   }
   // End:0x72
   else
   {
       isLesserRank = true;
   }
   // End:0xf9 Loop:False
   if(isLesserRank)
   {
       return iAlien == 13 || (iAlien == 9) || (iAlien == 12) || (iAlien == 19) || (iAlien == 11) || (iAlien == 16) || (iAlien == 15);
   }
   return false;
}

simulated function int GetBasicKillXP(XGUnit kUnit)
{
   local int iKillXP;
   local float fKillBonus;

   iKillXP = 30;
   // End:0x5b Loop:False
   if(kUnit.GetPlayer().m_arrOTSHistory[6] > 0)
   {
       fKillBonus = 1.25;
   }
   // End:0x6a
   else
   {
       fKillBonus = 1.00;
   }
   return int(float(iKillXP) * fKillBonus);
}

simulated function int GetBetterAlienKillXP(XGUnit kUnit)
{
   // End:0x40 Loop:False
   if(kUnit.GetPlayer().m_arrOTSHistory[6] > 0)
   {
       return 75;
   }
   return 60;
}

simulated function bool DeservesBetterAlienBonus(XGUnit kSoldier)
{
   local XGUnit kUnit;
   local XGSquad kSquad;
   local int kNumMembers, I;

   // End:0x30 Loop:False
   if(XGCharacter_Soldier(kSoldier.GetCharacter()) == none)
   {
       return false;
   }
   // End:0x89 Loop:False
   if(XGCharacter_Soldier(kSoldier.GetCharacter()).m_kSoldier.iRank > 4)
   {
       return false;
   }
   kSquad = kSoldier.GetSquad();
   kNumMembers = kSquad.GetNumMembers();
   I = 0;
   J0xe6:

   // End:0x161 Loop:True
   if(I < kNumMembers)
   {
       kUnit = kSquad.GetMemberAt(I);
       // End:0x153 Loop:False
       if(kUnit.m_bSeenBetterAlien)
       {
           return true;
       }
       ++ I;
       // This is an implied JumpToken; Continue!
       goto J0xe6;
   }
   return false;
}

simulated function int CalcXP(XGUnit kSoldier, int iEvent, XGUnit kVictim)
{
   local int iXPEarned;

   // ObjectIndex:30307 BlockSize:0
   switch(iEvent)
   {
       // End:0xfe
       case 13:
           // End:0xfb Loop:False
           if(XGCharacter_Soldier(kSoldier.GetCharacter()) != none && (IsBetterAlien(XGCharacter_Soldier(kSoldier.GetCharacter()).m_kSoldier, kVictim.GetCharacter().m_kChar.iType, false)))
           {
               kSoldier.m_bSeenBetterAlien = true;
           }
           // End:0x338
           break;
       // End:0x225
       case 0:
           // End:0x205 Loop:False
           if(XGCharacter_Soldier(kSoldier.GetCharacter()) != none && (IsBetterAlien(XGCharacter_Soldier(kSoldier.GetCharacter()).m_kSoldier, kVictim.GetCharacter().m_kChar.iType)))
           {
               iXPEarned = GetBetterAlienKillXP(kSoldier);
               kSoldier.m_bSeenBetterAlien = true;
           }
           // End:0x222
           else
           {
               iXPEarned = GetBasicKillXP(kSoldier);
           }
           // End:0x338
           break;
       // End:0x25e
       case 4:
           // End:0x24f Loop:False
           if(DeservesBetterAlienBonus(kSoldier))
           {
               iXPEarned = 90;
           }
           // End:0x25b
           else
           {
               iXPEarned = 60;
           }
           // End:0x338
           break;
       // End:0x297
       case 5:
           // End:0x288 Loop:False
           if(DeservesBetterAlienBonus(kSoldier))
           {
               iXPEarned = 180;
           }
           // End:0x294
           else
           {
               iXPEarned = 120;
           }
           // End:0x338
           break;
       // End:0x2ab
       case 6:
           iXPEarned = 20;
           // End:0x338
           break;
       // End:0x2bf
       case 7:
           iXPEarned = 10;
           // End:0x338
           break;
       // End:0x2d2
       case 8:
           iXPEarned = 0;
           // End:0x338
           break;
       // End:0x2e5
       case 9:
           iXPEarned = 0;
           // End:0x338
           break;
       // End:0x2f9
       case 10:
           iXPEarned = 20;
           // End:0x338
           break;
       // End:0x30d
       case 11:
           iXPEarned = 30;
           // End:0x338
           break;
       // End:0x321
       case 12:
           iXPEarned = 30;
           // End:0x338
           break;
       // End:0x335
       case 14:
           iXPEarned = 30;
           // End:0x338
           break;
       // End:0xffff
       default:
           return iXPEarned;
   }
}

 

Link to comment
Share on other sites

Very interesting.

 

Odd that the non-better-alien function uses a 1.25 multiplier, then the better-alien function uses a hardcoded 75.

 

also...

 

bCheckSoldierRank = true;

if(bCheckSoldierRank)

{

isLesserRank = iRank < 4;

}

else

{

isLesserRank = true;

}

 

 

I assume that was left in from some sort of testing period, but it's not exactly efficient to force a true, then check if it's true. Efficiency, people!

Edited by Wulf2k
Link to comment
Share on other sites

That's why I prefer modifying only setting file like DefaultGameCore. You can easily get lost in such code madness which you can't change and test as easily. It's still nice to know though that there is more than just getting XP for kills. :)

Maybe some hardcore coder will make some decent changes and fixes one day of the mess here and there.

Link to comment
Share on other sites

Mission Complete: 60, 90 if soldier of lower rank hadn’t seen yet any better aliens

Special Mission Complete: 120, 180 if soldier of lower rank hadn’t seen yet any better aliens

I don't see anything limiting it to the first encounter. If they've got 'seenbetteralien' as true, and they're < rank 5, they should get the XP bonus every time.

 

Edit:

 

My notes to pseudocode the XP gains:

 

 


0     eGameEvent_Kill,
If kill good alien, get better XP, set 'has seen good alien'
	If have OTS XP upgrade, return 75
	Else return 60
Else, get basic XP
	XP = 30
	if OTS XP upgrade, bonus = 1.25
	else bonus = 1
	return XP * bonus

1     eGameEvent_Wound,
Nothing

2     eGameEvent_Heal,
Nothing

3     eGameEvent_Turn,
Nothing

4     eGameEvent_MissionComplete,
If rank > 4, no bonus
If good alien seen and rank <5, bonus
if bonus, return 90
else return 60

5     eGameEvent_SpecialMissionComplete,
If rank > 4, no bonus
If good alien seen and rank <5, bonus
if bonus, return 180
else return 120

6     eGameEvent_ZeroDeadSoldiersBonus,
If no soldiers died, earn 20 xp

7     eGameEvent_TargetResistPsiAttack,
Resist Psi attack, earn 10 xp

8     eGameEvent_KillMindControlEnemy,
If killed MCd enemy, earn 0 XP

9     eGameEvent_SuccessfulMindControl,
MC gives 0 XP, probably due to max rank

10    eGameEvent_SuccessfulMindFray,
MindFray gives 20 XP

11    eGameEvent_SuccessfulInspiration,
Inspiration gives 30 XP

12    eGameEvent_AssistPsiInspiration,
AssistPsiInspiration gives 30, dunno what this is

13    eGameEvent_Sight,
Check if good Alien, set 'has seen' on soldier

14    eGameEvent_SuccessfulPsiPanic,
Gain 30 XP

15    eGameEvent_MAX
Nothing

 

 

Edited by Wulf2k
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...