Jump to content

Photo

Editing rank perk progression?


  • Please log in to reply
8 replies to this topic

#1
LoneHP

LoneHP

    Enthusiast

  • Members
  • PipPip
  • 134 posts

In DefaultGameCore.ini, I found the entries under XComGame.XComPerkManager that contain SoldierPerkTrees= entries that contain the lists of soldier perks at each rank.

 

Herein lies the question:

 

Is this as simple as editing these entries to change the soldier perks at each rank or does it involve having to edit art and string assets to follow suit?

 

Side question:

 

Does this also affect the other perks mentioned in this section?



#2
Krazyguy75

Krazyguy75

    Enthusiast

  • Members
  • PipPip
  • 205 posts

1. Yes, AFAIK.

 

2. What do you mean by other perks?


Edited by Krazyguy75, 20 December 2013 - 04:26 AM.


#3
LoneHP

LoneHP

    Enthusiast

  • Members
  • PipPip
  • 134 posts

1. Yes, AFAIK.

 

2. What do you mean by other perks?

 

2. the random perk list for Training Roulette.



#4
Amineri

Amineri

    Resident poster

  • Members
  • PipPipPipPipPip
  • 3,469 posts

1. Changing perks is as simple as changing the config values. You may get some weirdness if you do things like remove "ePerk_FireRocket" as the first perk for Heavies, though.

 

2. The other list of perks is the "random perks". These only apply if the SW option "Training Roulette" is enabled. Any perk in the "random perks" list can randomly be swapped for another perk from the same list (a few hard-coded exceptions exist). Perks in the soldier's tree not in the "random perks" list won't be randomized.



#5
dubiousintent

dubiousintent

    Faithful poster

  • Members
  • PipPipPipPip
  • 1,012 posts

Good question.  This info has been added to the article 'XCOM:EU Perks'.  Anyone recall when these "SoldierPerkTrees= entries" were available in the DGC.INI file?  From the beginning or just since EW?  (My recollection is we always used custom mods to make them; but I don't trust my memory these days.)

 

-Dubious-



#6
Amineri

Amineri

    Resident poster

  • Members
  • PipPipPipPipPip
  • 3,469 posts

The SoldierPerkTree DGC.ini configuration data was added with EW release. In EW this DGC.ini data is accessed through the XComPerkManager.GetPerkInTree, which handles retrieves all 5 classes (included MECs) as well as psi-tree perks. Medals and genemods are handled separately.

 

EW has a further twist to the code in the call-path now routes through a new function in XComStrategyGame.upk, XGStrategySoldier.GetPerkInClassTree. This is the function responsible for doing the mapping for randomly assigned perks.

 

FYI, the random perks are picked when the soldier has their class set, which only happens when the soldier is leveled up from rank 0 (Rookie) to rank 1 (Squaddie). All random perks are picked at that point and aren't changed, but the UI is set to not display perk choices for ranks above current.

 

-----------------------------

 

EU had all of the perk data hard-coded into the XComGame.upk in the XComPerkManager class. In EU this was further broken down into a call to 1 of 4 helper functions that implicitly stored the perk data for each class. (e.g. GetPerkInTreeSupport). 



#7
sirgzu

sirgzu

    Newbie

  • Members
  • Pip
  • 11 posts

Hi,
 
I think I've tracked down the section of code where some of the perks are hard-coded (as in sniper rank 2 will always offer snapshot or team vision) but I can't make sense of it. Or perhaps it's not the right bit of code :smile:
 
In XComGame.upk > XComPerkManager > defaultproperties:
 

RandomPerks(0)=223
RandomPerks(1)=42
RandomPerks(2)=0
RandomPerks(3)=0
RandomPerks(4)=0
RandomPerks(5)=0
RandomPerks(6)=0
RandomPerks(7)=0
RandomPerks(8)=133
RandomPerks(9)=43
RandomPerks(10)=0
RandomPerks(11)=0
RandomPerks(12)=0
RandomPerks(13)=0
RandomPerks(14)=0
RandomPerks(15)=0
RandomPerks(16)=62
RandomPerks(17)=43
RandomPerks(18)=0
RandomPerks(19)=0
RandomPerks(20)=0
RandomPerks(21)=0
RandomPerks(22)=0
RandomPerks(23)=0
RandomPerks(24)=12
RandomPerks(25)=43
RandomPerks(26)=0
RandomPerks(27)=0

There are 28 entries, that is 7 ranks * 4 classes (I don't think mecs and psi perks get randomised, or do they?)

Most of these entries are 0, which I assume means any available perk

 

The bits that I can't figure out are:

which index correspond to which class * rank

what perk or pair of perks does each value correspond to

 

Any thoughts?


Edited by sirgzu, 18 January 2014 - 04:12 AM.


#8
Amineri

Amineri

    Resident poster

  • Members
  • PipPipPipPipPip
  • 3,469 posts

RandomPerks is a config array :

private config array<config XGTacticalGameCoreNativeBase.EPerkType> RandomPerks

The values should always be overwritten by the data in the DefaultGameCore.ini. That there happen to be 28 perks in the array, and that 28 = 7*4 is just a numerical coincidence.

 

The RandomPerks array is primarily used in XComStrategyGame.upk, with only two helper/accessor function within XComPerkManager providing access to the config data:

simulated function bool IsFixedPerk(XGTacticalGameCoreNativeBase.EPerkType Perk);
simulated function XGTacticalGameCoreNativeBase.EPerkType GetRandomPerk();

What happens is that when a soldier is promoted to Squaddie, if the SW option is turned on, the code XGStrategySoldier.AssignRandomPerks is called.

 

This function scans through the regular perk array for the new class, and checks each class-defined perk to see if a random perk can be used (using IsFixedPerk). A perk is a FixedPerk if it is not in the RandomPerks array. If the perk can be random, then it selects a replacement random perk from the same array, but not allowing duplicate perks. There are also a couple of hard-coded rules (Heavies and MECs can't get Gunslinger, etc).

 

For the new Expanded Perk Tree mod I tweaked this system so that instead of the fixed 12 perk array for random perks, it creates a full 3 x 7 random perk array, but retains any zero-value (blank) perks in the original tree. This keeps the same 'shape' of the defined custom perk tree, but allows randomization as defined by the RandomPerks config array.



#9
sirgzu

sirgzu

    Newbie

  • Members
  • Pip
  • 11 posts
I see, thanks for that explanation, I didn't realise a perk was either fixed or random so I was looking for the wrong thing.
 
In the end I managed to get what I wanted just by editing the DefaultGameCore.ini:
// changed the support tree
;SoldierPerkTrees=(SoldierType=eSC_Support, Squaddie=ePerk_SmokeBomb, Corporal1=ePerk_CoveringFire, Corporal2=ePerk_Sprinter, Sergeant1=ePerk_SmokeAndMirrors, Sergeant2=ePerk_FieldMedic, Lieutenant1=ePerk_FocusedSuppression, Lieutenant2=ePerk_Revive, Captain1=ePerk_CombatDrugs, Captain2=ePerk_DenseSmoke, Major=ePerk_DeepPockets, Colonel1=ePerk_Sentinel, Colonel2=ePerk_Savior)
// to this
SoldierPerkTrees=(SoldierType=eSC_Support, Squaddie=ePerk_SmokeBomb, Corporal1=ePerk_FieldMedic, Corporal2=ePerk_SmokeAndMirrors, Sergeant1=ePerk_Revive, Sergeant2=ePerk_DenseSmoke, Lieutenant1=ePerk_Savior, Lieutenant2=ePerk_CombatDrugs, Captain1=ePerk_Sprinter, Captain2=ePerk_CoveringFire, Major=ePerk_DeepPockets, Colonel1=ePerk_Sentinel, Colonel2=ePerk_FocusedSuppression)

// and commented out these lines at the end of the file
;RandomPerks=ePerk_FieldMedic
;RandomPerks=ePerk_Revive
;RandomPerks=ePerk_Savior
Now I can use the perks roulette and still get supports with either a smoke build or a medikit build :smile:
 
It is still not as random as it should but I'll wait to see what you come up with before trying to rewrite some of the perks logic.
Thanks!

Edited by sirgzu, 18 January 2014 - 04:16 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Page loaded in: 1.145 seconds