Author Topic: [Solved] All people are different (randomize alien stats)  (Read 2366 times)

Offline Kato

  • Captain
  • ***
  • Posts: 51
  • ASHU is coming
    • View Profile
[Solved] All people are different (randomize alien stats)
« on: August 31, 2020, 04:50:06 am »
This is possibility to vary enemy stats. In OG the aliens were clones, and this explains the same stats all members of each rank have. But in mods our opponents are often not clones, each of them supposed to have his own personal strengths and weaknesses. Some are dexterous and some are clumsy. Some are strong and some are weak.

Let classic Sectoid Leader be the example, but this guy also have mana to show how it works.

Code: [Select]
    stats:
      tu: 54
      stamina: 90
      health: 30
      bravery: 80
      reactions: 63
      firing: 52
      throwing: 58
      strength: 30
      psiStrength: 50
      psiSkill: 50
      melee: 76
      mana: 100

Here we need 3 modifiers:

1 - statsSpreading
Is maximum percentage modifier (int) for tu, stamina, health, reactions, firing, throwing, melee, strength & mana. Default 0, max 50. If set above 50 - it counts as 50. This modifier can be positive or negative - randomly. Also, each stat gets its own random-generated modifier, but not above threshold that we set.
Let's have statsSpreading: 30
When this unit spawning, its stats are modified by rng:
tu +10%
stamina: -20%
health: +7%
reactions: +15%
firing: +30%
throwing: -28%
strength: +1%
melee: +13%
mana: -14%
And on the battlefield we meet Sectoid Leader with following stats:
Code: [Select]
      tu: 59
      stamina: 72
      health: 32
      reactions: 72
      firing: 68
      throwing: 42
      strength: 30
      melee: 86
      mana: 86

If there another Sectoid Leader spawned - he gets his own modifiers and may be very different from the 1st one. E.g. Leader#1 is sniper with firing+30% while Leader#2 is grunt with health+30% but shooting not very good. And so on.

2 - psiSpreading
Is maximum flat modifier (int) for psiStrength & psiSkill. Default 0, max inf. This modifier is always positive.
Let's have psiSpreading: 18
It means this unit can spawn with random bonuses from 1 up to 18 for psi stats. Speaking of our Leader:
Code: [Select]
      psiStrength: 63
      psiSkill: 55
or
Code: [Select]
      psiStrength: 59
      psiSkill: 65

3 - braverySpreading
Is boolean. Default false. If true - bravery can get -20, -10, +0, +10 or +20, but not below 10.

First statGrowthMultipliers are applied - then this spreading algorhytms.
« Last Edit: February 12, 2023, 10:33:27 am by Meridian »

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile
Re: [SUGGESTION] All people are different
« Reply #1 on: August 31, 2020, 10:15:57 am »
All this is already possible with scripts.

Offline Kato

  • Captain
  • ***
  • Posts: 51
  • ASHU is coming
    • View Profile
Re: [SUGGESTION] All people are different
« Reply #2 on: August 31, 2020, 02:20:35 pm »
If only there be a tutorial for dummies >_<

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile