GR - Subsystem Upgrades

From Supreme Ruler Wiki
Jump to: navigation, search

Subsystem Upgrades are a combination of Tech Tree information, Upgrade stats information, an Picnums (mesh) information to represent upgrades in elements of a unit. Generally intended for space units in GR

Modules (SubSystems)[edit | edit source]

0 : Armour / Shielding

1 : Command (ie front section)

2 : Cargo (optional)

3 : Engines

4 : Weapons

Levels[edit | edit source]

0 (Base) / 1 / 2 / 3

Levels are optional, not all will have all levels

TechTree[edit | edit source]

Upgrades effect a Unit Class - every unit in class gets upgrade (in resv / new prod)

Using Tech Effect 500 - 755

Upgrade Levels per active unit are stored in CUnitList systemupgrade[] variable

Current maximum upgrade Levels stored in ruupgrades[player][Class/Subsystem]

  • Offset = classnum * 8 + subsystemnum
  • Supports up to 8 subsystems/modules, only 5 used at present

Upgrades triggered by research achievement

  • Each Unit Class in game supports 8 Upgrade systems (only 5 used)
  • Tech Effect increases are additive
  • We can upgrade through techs partially, ie 0.3 + 0.3 + 0.6 or through the final tech ie 0.0 + 0.0 + 1.0
  • Visual change only happens on whole numbers
  • Effect / spec improvements happen on partial upgrades, ie Interceptor Armour improvement by 0.5 will gain 50% of the spec benefit, even though a full level is not visible.
  • Improvements above 3.0 (maximum visual) are allowed
  • Examples:
    • Effect 500 would be for Infantry - Armour
    • Effect for Space Fighter, Engines would be 22*8 + 3 = 179 + 500
    • (Class 22, skip 8 elements each class, Engines is entry 3)

Affected Stats[edit | edit source]

Stored in CUpgradeComponents

class CUpgradeComponent {
    float attack;
    float defense;
    float range;
    float stealth;
    int   spottype1;   // Replacement spottype 1
    int   spottype2;   // Replacement spottype 2
    float speed;
    float cargocap;
    float crew;
    float fuelcap;
    float fueluse;
    float ammocap;
    float ammouse;
    float buildspeed;
    float weight;
    float movement;
    float carriercap;
    float initiative;
};

&& UPGRADECOMPONENT classnum

1-24 : UpgradeComponent class for each upgrade level (0 not used)

  • 5 Modules (0 to 4), 3 upgrades levels each (supporting 1/2/3)
  • 3 more modules not used (5/6/7), reserved

Each value is a modifier of the original value, similar to tech effects.

  • 0.0 would be unchanged; 0.5 would be "increase by 50%"; -0.5 would be "reduce by 50%"

Implementation:[edit | edit source]

  • See Default Picnums
  • Base Hull is always single object (submesh) - submesh # 0
  • Upgrades can ADD (cumulative) or REPLACE (previous upgrades) on Base Hull object mesh - using OptionOb flag (if set T, then replace)
  • Upgrade Level Calculation Example:
    • Faction has researched three techs with Tech Effect 679 - effect values are 0.4, 0.5, 0.7
    • Effect number 679 minus 500 (base for subsystem upgrades) = 179
    • This is in section for class number 22, Space Fighter (22*8 = 176, start of upgrade effects for class 22, eight modules per class supported)
    • This is upgrade module 3 (179-176). Per Module chart above, this is the entry for Engines.
    • Total effect value is 1.6 (0.4+0.5+0.7). This means the Upgrade Level to be used is level 1 (zero is base unit). Partial levels are ignored.
  • Unit Stat Upgrades Example:
    • Values to upgrade stats are UPGRADECOMPONENT line 3 * 3 + 1 = 10 (upgrade module 3 for engines, times 3 levels per module, plus level 1 for current Upgrade Level)
    • This will be a stats/specs upgrade using the value in the UPGRADECOMPONENT array
      • If value "speed" in the array of specs is 0.2 (20% boost), and the unit's base speed is 50, then the upgraded speed is 50 * (1.0 + 0.2) = 60
      • If value "ammouse" in the array of specs is -0.15 (15% reduction), and the unit's base ammo use is 20, then the upgraded ammo use is 20 * (1.0 - 0.15) = 17
      • Upgrade values are not cumulative - at Level 1 the unit will receive Level 1 stat adjustments, at Level 2 the unit will only receive Level 2 adjustments.
      • No Partial stat upgrades are done - if the the total upgrade tech effect is 1.6, then Level 1 stats are used. Total upgrade tech effect of 0.9 results in no stat changes (base only)
    • This will be a visual upgrade to Level 1 on the unit mesh
    • Unit Mesh Picnum will be drawn with Base Hull mesh, and with SubMesh of Meshtype 43 (first engine level upgrade - module 3 for engines, times 3 levels per module, plus 34 for base submodules Meshtype)