Wulf2k Posted November 7, 2012 Share Posted November 7, 2012 Has anybody come across the experience values for various actions? Or even the variable type that holds experience? I've been trying to find them with Cheat Engine, but it's difficult to narrow down when the missions are so short. Link to comment Share on other sites More sharing options...
fys Posted November 7, 2012 Share Posted November 7, 2012 Roughly the XP gain explained what I’ve read in the code gibberish: Rookie: 0 Squaddie: 90Corporal: 300Sergeant: 510Lieutenant: 745 Captain: 1100Major: 1560Colonel: 2150 m_iPsiXPLevels=0m_iPsiXPLevels=50m_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 BerserkerOTS trait increases Kill XP by 25% Mission Complete: 60, 90 if soldier of lower rank hadn’t seen yet any better aliensSpecial Mission Complete: 120, 180 if soldier of lower rank hadn’t seen yet any better aliensZero Dead Soldier Bonus: 20 Resist Psi Attack: 10Successful Mindfray: 20Successful Inspiration: 30Assist Psi Inspiration: 30Successful 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 More sharing options...
Wulf2k Posted November 8, 2012 Author Share Posted November 8, 2012 Awesome. Assuming it's close to accurate at all it gives a pretty good guideline. Thanks. Link to comment Share on other sites More sharing options...
fys Posted November 8, 2012 Share Posted November 8, 2012 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 More sharing options...
Wulf2k Posted November 8, 2012 Author Share Posted November 8, 2012 (edited) 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 November 8, 2012 by Wulf2k Link to comment Share on other sites More sharing options...
fys Posted November 8, 2012 Share Posted November 8, 2012 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 More sharing options...
Wulf2k Posted November 8, 2012 Author Share Posted November 8, 2012 (edited) Mission Complete: 60, 90 if soldier of lower rank hadn’t seen yet any better aliensSpecial Mission Complete: 120, 180 if soldier of lower rank hadn’t seen yet any better aliensI 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 November 8, 2012 by Wulf2k Link to comment Share on other sites More sharing options...
Recommended Posts