Hidden Potential "Formulations"

Post Reply
Zyxpsilon
Posts: 274
Joined: Fri Jan 20, 2017 1:26 am

Hidden Potential "Formulations"

Post by Zyxpsilon »

As v1.3 is fast approaching.. the very last adjustments i'd like to be ready for is the NCE&HP calculations.

Basicly, i'd much prefer relatively greater range in a few places while removing the extreme Low HP (3!-duh) & Mobility consistantly being stuck at 15 and VERY rarely be given 16 or more.
Sooooo.. i went into the XComLW_Toolbox.INI file to edit some test-phase values like this;

Code: Select all

;These are the max allowed deltas for each stat type
+STAT_CAPS=(Stat=eStat_Offense, Min=-5, Max=15)		;-10,10
+STAT_CAPS=(Stat=eStat_Defense, Min=-5, Max=15)		;-10,10
+STAT_CAPS=(Stat=eStat_Dodge, Min=-10, Max=20)		;-15,15
+STAT_CAPS=(Stat=eStat_Will, Min=-5, Max=25)		;-15,15
+STAT_CAPS=(Stat=eStat_Hacking, Min=0, Max=20)		;-4,15
+STAT_CAPS=(Stat=eStat_HP, Min=0, Max=4)			;-1,3
+STAT_CAPS=(Stat=eStat_Mobility, Min=0, Max=5)		;-2,3
+STAT_CAPS=(Stat=eStat_PsiOffense, Min=-10, Max=25)	;-18,18
Not sure if there are other tricky calculations being done anywhere else (excluding STATS_SWAPS that seems likely to have some impacts via Up/Down limits of various types). For example...

Code: Select all

+STAT_SWAPS=(StatUp=eStat_HP,		StatUp_Amount=1,	StatDown=eStat_Mobility,	StatDown_Amount=1, Weight=2.0f)
I guess the whole mystery stands into a weird (but necessary) min-max global variable(_s) from which each stats battle for attention & by what kind of priority order (Weight_float ?). HP vs MOB in the example above -- meaning if HP goes up by one then MOB **must** go down by one. And - so - on.

Anybody would like to shed some light on these issues for me, please?
LordYanaek
Posts: 940
Joined: Mon Jan 23, 2017 1:34 pm

Re: Hidden Potential "Formulations"

Post by LordYanaek »

I spent some time figuring those on my own and i think you already understood how it works.
Swap is actually the most important part of the system and not some secondary stuff.

The entire system works like a classical RPG point buy system where every soldier have 478 points to spend except for the fact it's randomized around the basic stats (those you'd get without NCE) so rather than start from zero and build everything, the algorithm "chooses" a stat to increase and one to reduce.
Not every stat is worth the same amount of points and how much each is worth is controlled by the swap section. Min and Max are simply that, upper and lower bounds. I added this on UFOpedia some time ago after studying the various swaps to determine the "value" of each stat.
Not Created Equally works by swapping stats and will never produce really bad or good rookies. A rookie with high aim might have low defense or health as a result. For the purpose of those modifications some stats are worth more "points" than others. Dodge, Will, Hacking and Psi Offense are all worth 1 point; Defense is worth 1.5 points; Offense is worth 3 points; Health and Mobility are worth 12 points. The total of "points" a soldier has on all of his stats is 478. This information can be used to determine the psi offense of rookies prior to building the Psi Lab in order to save high psi offense troopers as future psi operatives.
The reason you rarely see high health and mobility soldiers (especially combined with good aim) is that those are the most "costly" stats and can't be compensated directly by the "low cost" stats like Dodge and Will. HP and Mobility can be swapped for each other but the only other swap available for those is 4 Aim for 1 HP/Mobility.
Swaps work both ways so even thought a line says

Code: Select all

+STAT_SWAPS=(StatUp=eStat_Offense,	StatUp_Amount=4,	StatDown=eStat_Mobility,	StatDown_Amount=1, Weight=1.5f)
You can actually raise Mobility by reducing Aim (Offense).

This part

Code: Select all

;The dice that are rolled and summed to compute the number of stat swaps applied for initial randomization
.NUM_STAT_SWAPS=4
.NUM_STAT_SWAPS=4
.NUM_STAT_SWAPS=4
.NUM_STAT_SWAPS=4
.NUM_STAT_SWAPS=4
seem to imply that the game will roll 5d4 and sum them for a total of 5-20 swaps with those probabilities (thanks to anydice)

Code: Select all

 # |   %
 5 |  0,1
 6 |  0,5
 7 |  1,5
 8 |  3,4
 9 |  6,3
10 |  9,9
11 | 13,2
12 | 15,1
13 | 15,1
14 | 13,2
15 |  9,9
16 |  6,3
17 |  3,4
18 |  1,5
19 |  0,5
20 |  0,1
Which swap exactly will be applied is determined by the Weight factor of each line so HP↔Mobility is the most likely swap.

In order to get high Aim, HP and Mobility you would have to roll +HP-Mobility then +Mobility-4Aim at least twice then several +Aim-Somethingelse which is pretty unlikely to occur.
Zyxpsilon
Posts: 274
Joined: Fri Jan 20, 2017 1:26 am

Re: Hidden Potential "Formulations"

Post by Zyxpsilon »

Gotcha.. perfectly explained in thorough details -- thanks a lot! :)
Tuhalu
Posts: 433
Joined: Wed Feb 01, 2017 9:02 pm

Re: Hidden Potential "Formulations"

Post by Tuhalu »

It seems like one element is missing from that explanation. If any stat swap would increase or decrease a number outside the acceptable range, that swap is ignored and another one taken instead (or until it fails 1000 times, which seems unlikely). This ensures that you only get full value swaps and the numbers never wind up outside the acceptable range.
Zyxpsilon
Posts: 274
Joined: Fri Jan 20, 2017 1:26 am

Re: Hidden Potential "Formulations"

Post by Zyxpsilon »

The "Acceptable Range" is exactly what i want more control over if possible (even if i must change or add some STATS_SWAP instructions).. so that when the 478 global pool gets reliably distributed between whatever -- there could be sligthly higher variations for specific types like Dodge/HP/Mobility (etc).

While LordYanaek has given me good hints on the major principles involved, i feel the pre-compiled UC Script has some hard-coded data gaps which simply prevent us to fiddle further with a few targeted types, precisely.

Anyway.. the actual numbers i've inserted into the custom "STATS_CAP" above seem to be okay'ish for now. I may continue testing some of the SWAP stuff to see if these might give the intended output in special cases.
LordYanaek
Posts: 940
Joined: Mon Jan 23, 2017 1:34 pm

Re: Hidden Potential "Formulations"

Post by LordYanaek »

The issue with the values you set (i only carefully read them now) is that since you prevent a lot of stats from dropping too far, the algorithm will have a hard time actually doing swaps to bring stats to the (higher) maximum values you set.

You're actually allowing the "recovery" of 52.5 points by stat drops but you're "asking" the algorithm to add up to 280.5 to various stats. Even more important the maximum of +15 aim would require 60 points and you can only recover 32.5 from other stats. The algorithm will never give you more than +8 aim because it can't free enough points to go above this, and this will only ever occur if all the swaps it does are +aim-something.
+5 Mobility also requires 60 points so you will never see it. You can get +4 which would eat 48 points of the 52.5 available if every other stat gets dumped almost to the maximum but that's it.

The default settings could free up to 143 points and use up to 190 allowing much more variations. Your settings severely limit the available swaps by lack of ability to reduce stats.
Zyxpsilon
Posts: 274
Joined: Fri Jan 20, 2017 1:26 am

Re: Hidden Potential "Formulations"

Post by Zyxpsilon »

I would surely have to fine-tune a few key Deltas until a reasonable (that would FIT the pre-determined limits.. in a sense) goal can be reached.
The trick is to setup an exact range for everything & then, drop the required (or optimal) MIN-MAX structure in a way (by altered SWAPS if need be) that can truly get sharp contrast between any (or most) of my target results.

Vanilla/CreatedEqually (On Rookie - pulled from UFOPedia) ==
65/AIM .. 0/DEF .. 5/DODGE .. 25/WILL .. 5/HACK .. 4/HP .. 15/MOB .. 20/PSI

Preferably & after whatever NCE shuffling steps ==

AIM.. 60/80 (with -5/15) (Get Lasers, hurry ... yet we --MUST-- use ballistic for awhile)
DEF.. -5/15 (with -5/15) (Somewhat reducing the weird being-shot-through-cover effects as often as possible)
DODGE.. 0/10 (with -5/5) (There *are* some very good PCS solutions to enhance/fix this already!)
WILL.. 15/45 (with -10/20) (Risks of being Mind-Controlled by Sectoid redefined)
HACK.. 0/15 (with -5/10) (Still a tough case of GREMLIN-II or bust)
HP.. 4/8 (with 0/4) (The major stat that concerns me the most for MANY gameplay reasons)
MOB.. 14/19 (with -1/4 or less) (The other VERY important factor in my quest!!)
PSI.. 10/45 (with -10/25) (Gifted or not)

The only logic i seem to skip (or misunderstand) is the formulaic stackups for key elements & how to achieve various conditions.
khomotso
Posts: 11
Joined: Sun Apr 30, 2017 2:46 am

Re: Hidden Potential "Formulations"

Post by khomotso »

This might be a naive question, but isn't this running around the point in a rather overcomplicated way? I mean, the OP's goal, as I understand it, is to bump up the median values (he talks about shifting mins and maxes, but seems to increase many of them the same amount in the same direction, so I still interpret this as raising the median by that amount). So it seems to me that it would be easier to look at how to raise the baseline character stats -- before NCE is even engaged, that is -- and this would achieve the same result as trying to tweak NCE as the OP suggests, without the extra algorithmic fussiness.

From these lines in the XComLW_Toolbox.ini:

Code: Select all

; Character template names eligible for Not Created Equally (in addition to soldiers)
+ExtraCharacterTemplatesToRandomize=Rebel
+ExtraCharacterTemplatesToRandomize=FacelessRebel
... I get the clue that default values are established in character templates. And it looks to me like those templates are established in XComGameData_CharacterStats.ini, to wit:

Code: Select all

[Soldier X2CharacterTemplate]
CharacterBaseStats[eStat_HP]=4
CharacterBaseStats[eStat_Will]=25
CharacterBaseStats[eStat_Dodge]=5
CharacterBaseStats[eStat_UtilityItems]=3
CharacterBaseStats[eStat_Mobility]=15
CharacterBaseStats[eStat_PsiOffense]=20
The default soldier template from the LW2 version of this config file (there are other template overrides for the various difficulty levels, so you'll want to watch those, too) doesn't include some values of interest (e.g. offense, defense and hacking), but from looking for relevant variables in other templates, you can easily identify their labels and add appropriate values, for example:

Code: Select all

[Soldier X2CharacterTemplate]
CharacterBaseStats[eStat_HP]=4
CharacterBaseStats[eStat_Will]=25
CharacterBaseStats[eStat_Dodge]=5
CharacterBaseStats[eStat_UtilityItems]=3
CharacterBaseStats[eStat_Mobility]=15
CharacterBaseStats[eStat_PsiOffense]=20
CharacterBaseStats[eStat_Offense]=65
CharacterBaseStats[eStat_Defense]=0
CharacterBaseStats[eStat_Hacking]=5
If you want to fine-tune the different weightings you can still tweak further with the toolbox swaps, but to a first order tweaking the baseline values here would seem to address the OP's concerns. Or is there something else I'm not understanding?
Zyxpsilon
Posts: 274
Joined: Fri Jan 20, 2017 1:26 am

Re: Hidden Potential "Formulations"

Post by Zyxpsilon »

Well.. the whole controversial situations are directly related to the opinion(s) we have on the actual meaning of NOT CREATED EQUALLY (or even HIDDEN POTENTIAL.. btw!) & how the coding mechanics apply such formulations and in what variable ranges.

Ultimately, i want as much control as possible over the final outcomes within the current state of instructions as defined by LW2.. with a twist that MIN-MAX (Delta) scaling should be more customizable & flexible.

I think the conditional "Points per type" system is where the meat of alterations could be done to fit my goals.. but sadly, the *478* rule isn't really exposed to us (unless i skipped a key element when i dug into the UC scripts involved). Thus why my initial target steps were concentrated at the STATS_CAPS values.. both for clarity & easiness to implement.

But i'm still open for pre-calculated suggestions or any other rational plan from anyone watching this thread.. except touching the basic templates for more reasons than most people would guess about. :geek:

PS; If interested.. i'd recommend having a look at the XC2-Vanilla mod equivalent of "SWR NCEqual" by Mertius & witness how complex its mathematics are.
Zyxpsilon
Posts: 274
Joined: Fri Jan 20, 2017 1:26 am

Re: Hidden Potential "Formulations"

Post by Zyxpsilon »

Sooooo.. here's what my next attempt should use as values...

PS; HP&MOB=12pts .. AIM=3 .. DEF=1.5 .. DODGE+WILL+HACK+PSI=1

((65)) AIM.. 53/73 (with -12/8)
((_0)) DEF.. -8/10 (with -8/10)
((_5)) DODGE.. -7/13 (with -12/8)
((25)) WILL.. 10/40 (with -15/15)
((_5)) HACK.. 0/15 (with -5/10)
((_4)) HP.. 4/7 (with 0/3)
((15)) MOB.. 14/19 (with -1/4)
((20)) PSI.. 14/37 (with -6/17)

Let each of the wacky dices fall where they might!! :lol:
Aussiefoal
Terra Invicta Beta Tester
Posts: 3
Joined: Sun Feb 07, 2016 3:35 pm

Re: Hidden Potential "Formulations"

Post by Aussiefoal »

Ha, finally somebody who likes the idea of a wider variety of soldiers when you start and level up!

And, did it play out as intended? I am really interested in your approach.
Since LW-EU I have tried to broaden the range. Meaning to have really crappy rookies -->sorry mate, your world ain't going to be a military one - and guys who represent the elite which is going to give those otherwordly fuckers a warm welcome.

Sadly I have no talent for modding/coding at all and my only solution was to add a few lines with generell randomization by leveling up. If hte dices play your way on each levelup, there can be some really awesome MSGT but also the other way around.
prokolyo
Posts: 59
Joined: Thu Nov 15, 2018 6:29 am

Re: Hidden Potential "Formulations"

Post by prokolyo »

Very curious if there is a mod out there, or any other way to achieve having "better" and "worse" rookies. So that instead of having only rookies with the 478 initial total points, we have for example say 450-point rookies and 525-point rookies, etc.
Post Reply