Jump to content

Soldier Stat Randomization


Amineri

Recommended Posts

Recently I've been working on a new method for randomizing soldier stats.

 

While vanilla game includes the second wave option Not Created Equal, this option suffers from a few defects in my mind:

  • It confuses the idea of soldiers being "not equal" with "not identical". With the option on, some soldiers are better than others, but without it all soldiers are identical.
  • It allows "cherry picking" of the best soldiers, which overall makes the game slightly easier, in constrast to most of the other SW options.

 

My original concept was to create a system by which soldier stats could be randomized so that not all soldiers were identical, but in which all such randomized soldiers were roughly equivalent (soldiers would be "equal but not identical").

 

The initial design was a form of point-buying system. Each stat would cost a certain number of points, and each soldier would have a fixed number of points to spend. I decided also to expand the stats that are randomized to include hp and defense (in addition to the NCE varied stats of Aim, Will and Mobility).

 

The points were to be :

  • 6 points / 1 HP (+/- 2 HP)
  • 4 points / 1 Mobility (+/- 3 Mob)
  • 1 point / 1 Aim (+/- 10 Aim)
  • 1 point / 1 Defense (+/- 10 Defense)
  • 1 point / 2 Will (+/- 20 Will)

Unfortunately a straightforward implementation of a points buy system in XGFacility_Barrack RandomizeStats and RollForStat ran into troubles due to lack of local variables, and my attempts to 'borrow' locals from other function consistently caused crashing.

 

So intead of randomly picking stats one at a time and spending the points, I instead switched to a system bulk-purchasing each stat, but altering the expected result conditioned on the previous rolls.

 

I start each soldier with 54 points to spend (if NCE is enabled, instead the soldier get a randomized number of points). I then purchase stats in the following order:

  1. Mobility... 6 rolls with a 50% * (remainingPoints / 54) chance of success on each
  2. HP ... 4 rolls with a 50% * (remainingPoints / 42) chance of success on each
  3. Aim ... 2 rolls of 0-10 * (remainingPoints / 30), with each roll capped at 10
  4. Defense .. 2 rolls of 0-10 * (remainingPoints / 20), with each roll capped at 10
  5. Will .. +2 will for each left over point, capped at +40

Using this system (and without NCE), I started a new game and recorded the stats of the 23 soldiers that did not level up. I set the base stats of a soldier to 8 Mobility, 2 HP, 55 Aim, -10 Defense, and 20 Will, so that the average stats would be 11 Mobility, 4 HP, 65 Aim, 0 Defense, and 40 Will. Here are the randomized stats of the 23 soldiers :

Mob    HP    Aim   Def   Will
10     6     63    +0    28
11     4     58    -2    58
10     4     64    +1    48
10     3     66    -5    60
13     3     62    -3    48
11     5     60    -4    46
12     4     66    +4    22
13     3     66    -4    42
9      6     62    -1    40
11     4     63    +10   24
13     5     61    -4    28
14     3     67    -2    28
11     5     66    -1    28
10     3     67    +3    50
10     3     68    +0    54
11     3     69    -7    58
11     4     71    -5    38
10     3     71    +8    32
9      5     71    -3    38
11     5     59    +3    34
11     6     56    +2    30
10     4     67    +5    34
11     5     56    +0    46

I computed the average values for each stat in order to identify any biasing (particular for Will), and the averages were :

Mobility : 10.96 (theoretical 11)

HP : 4.17 (theoretical 4)

Aim : 64.3 (theoretical 65)

Defense : -0.22 (theoretical 0)

Will : 39.7 (theoretical 40)

 

In this sample the observed HP was a bit high (0.17 * 6 = 1.02 point), while the observed other stats were low to balance it out (0.04 * 4 + 0.7 + 0.22 + 0.15 = 1.23), so the average points were biased down by 0.21 points (out of 54). This is because sample 4 capped the Will at 60, discarding some points (only 50 out of 54 points were spent). This biased the average points down by 4 / 23 = 0.17, with the remaining 0.04 due to round-off error.

 

While all of the stats vary quite a bit :

Mobility from 9 to 14

HP from 3 to 6

Aim from 56 to 71

Defense from -7 to +10

Will from 22 to 60

 

There aren't any "super-soldiers" that stand out to me, but neither are there useless soldiers.

 

I'm still tinkering a bit with the algorithm, but will post up hex code changes once it stabilizes. Any feedback or thoughts on the above stat distributions is welcome :smile:

Edited by Amineri
Link to comment
Share on other sites

IMO, classes and stat randomization are mutually exclusive. In the OG there were no classes, but all the soldiers had different stats and could use any weapon/equipment, so players did manually what the new XCOM does automatically: they looked through soldiers and assigned a "roles" to each one. XCOM Util helped very much to automate that job by adding marker strings to soldier names. Now we have a class system and any randomization is done within a class, so you can get a good sniper or a bad sniper, but you can't make a bad sniper to be a heavy.

 

I think, even with the weighting system it will still be a bad soldier vs a good soldier. Bads soldiers will be dismissed and good will contribute to an army of superhumans. But, if it would be possible to get rid of the classes completely, random stats would make sense. It would mean the return of micromanagement, but some people still like it (I certainly don't :smile: ).

 

Or player should at least have an ability to pick a class manually, based on soldiers stats or his needs. If player could make use of all the soldiers he gets, it would make randomization more interesting. Especially, if rookies were expensive, so one couldn't afford to recruit a dozens of rookies and keep only 2-3 with the best stats.

Edited by wghost81
Link to comment
Share on other sites

Could you replace it with a system that requires you 'train' your soldiers? If they have bad stats you stick them in strength training for mobility, or rifle training to improve aim or something. It would work like the psi lab. The type of training a soldier gets could either be set when put into training or class locked. They can only be trained to some max increase, and each time you train them the cost (in meld or cash or whatever) goes up. I have no idea if it's practical code wise, as I know the UE can be tricky to mode, but it seems like a good solution in that if you want super soldiers you have to work to get them. This would entirely replace the way NCE and HP work now so they would become defunct perhaps freeing up some coding space?

 

It could be further hindered by making it so soldiers in rest can't train.

Edited by hambil
Link to comment
Share on other sites

I like the idea and the work that you have done. I possibly would want a "little" modification to what you have above. Instead of the base 54 for everyone, I would randomize that from 52-56 with 54 being the average.

 

This way you can get a little more of a swing on the stats.

 

The cost of soldiers can be increased so that it is hard to "dismiss" a soldier because of the loss of funds.

 

I tend to find use for all of my soldiers. Those that have poor stats still can contribute to the team (as red shirts...) and some of these soldiers can graduate to the regular squad based on luck and performance.

 

Great work!

Link to comment
Share on other sites

IMO, classes and stat randomization are mutually exclusive. In the OG there were no classes, but all the soldiers had different stats and could use any weapon/equipment, so players did manually what the new XCOM does automatically: they looked through soldiers and assigned a "roles" to each one. XCOM Util helped very much to automate that job by adding marker strings to soldier names. Now we have a class system and any randomization is done within a class, so you can get a good sniper or a bad sniper, but you can't make a bad sniper to be a heavy.

 

I think, even with the weighting system it will still be a bad soldier vs a good soldier. Bads soldiers will be dismissed and good will contribute to an army of superhumans. But, if it would be possible to get rid of the classes completely, random stats would make sense. It would mean the return of micromanagement, but some people still like it (I certainly don't :smile: ).

 

Or player should at least have an ability to pick a class manually, based on soldiers stats or his needs. If player could make use of all the soldiers he gets, it would make randomization more interesting. Especially, if rookies were expensive, so one couldn't afford to recruit a dozens of rookies and keep only 2-3 with the best stats.

 

From what I've read, about 6-8 months before release the classes weren't in the game. It was one of the design contributions that Ananda Gupta made after joining the project. I believe that the reasoning was the the perks were mostly assigned to weapons and gear, and feedback was that the playtesters were more attached to the gear than the soldiers, which wasn't ideal.

 

That said, with only the basic 4 classes, and no player input into the process, I could definitely see a bit of frustration with particular stat combinations, such as having low aim on a sniper or low mobility on an assault. For Long War with the ability to select 1 of 2 subclasses it makes a bit more sense. A low aim scout-sniper can be made into a scout, and a low mobility soldier can be made into an infantry instead of an assault.

 

I'm curious though about the "good soldier" vs "bad soldier" sorting. Which of the above soldiers would you consider "good" and which are "bad"?

 

 

Could you replace it with a system that requires you 'train' your soldiers? If they have bad stats you stick them in strength training for mobility, or rifle training to improve aim or something. It would work like the psi lab. The type of training a soldier gets could either be set when put into training or class locked. They can only be trained to some max increase, and each time you train them the cost (in meld or cash or whatever) goes up. I have no idea if it's practical code wise, as I know the UE can be tricky to mode, but it seems like a good solution in that if you want super soldiers you have to work to get them. This would entirely replace the way NCE and HP work now so they would become defunct perhaps freeing up some coding space?

 

It could be further hindered by making it so soldiers in rest can't train.

 

It might be possible, but would involve a fair bit of work. Reworking the perk tree interface to support the new psionics training system involved upwards of 50 changes to the upks, so it wasn't a trivial task at all.

 

X-COM Apocalypse had a similar system by which your soldier stats could improve either directly through battle experience or via training in a dedicated facility (http://www.ufopaedia.org/index.php?title=Training_(Apocalypse)). However we can't exactly duplicate such a system, nor would I want to.

 

I feel like there's a fine balance in giving the player "too much control" vs "not enough control". If the player doesn't have enough controls, then she is at the mercy of the RNG, and the game doesn't allow enough meaningful decisions, which is fairly obvious a mistake. On the flip side giving the player too many controls leads to situations where the player doesn't have to be innovative in response to randomized events, and leads to each game developing in the same manner, which hurts replayability.

 

One option that occurs to me is to reduce the auto-generated stats and tie some stat increases to the level-up perks instead, convolving perk selection with stat training to a degree. This could be a good way to help balance out different perks, since balancing them based just on the ability can be a bit tricky.

Link to comment
Share on other sites

I'm curious though about the "good soldier" vs "bad soldier" sorting. Which of the above soldiers would you consider "good" and which are "bad"?

Those are rookies. Low mobility/aim rookies will be "bad" by themselves, as they would be hard to level up. And when they will receive a random class, their usefulness will depend on that class. Low mobility is bad for all classes, IMO. Except, may be heavy rocketeer. :smile: Other stats are class dependent. HP/Defense/Will has little meaning for squadsight snipers, aim matters less for heavies and assaults with shotguns, etc. Point is, classes are assigned randomly, so you can't make your highest aim soldier a sniper and your highest HP soldier an assault, for example. If you could, it would be more fun, IMO.

 

Classes or no classes, every player eventually end up with certain "archetypes" he likes. There wasn't actually more variety in classless in OG than in new XCOM: there were scouts, snipers, stationary rocketeers :smile:, psionics... new XCOM classes pretty much cover this. I miss only scouts, as battle scanners on squadsight snipers aren't that useful and snapshot sniper isn't actually a scout equivalent.

 

IMO, random stats are more appropriate for RPG-like systems. If you could assign stat points manually on level up and choose a perks from a whole list, based on certain skill requirements, it would make more sense. At least to me. :smile:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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