EA Forums - Banner

How your Offense Level is calculated

Prev13
EE_Elephterion
1220 posts Envision Developer
edited August 2018
Level Calculation
For calculating the Offense Level of your army, the value of every unit is considered and transferred into an arbitrary score. That score is based on the level, its Army Point Cost and a magic number that acts as a modifier to balance powerful units against weaker units. That score then gets calculated against a theoretical army score on a given level to find out how close you are to your army’s hypothetical power potential of that level.

Unit Score
First, the individual score of every of your fielded units is calculated.
8ur31w5zy00o.png
All Unit Scores add up to the final Player Army Score

Offense Level Modifiers
The strongest units of a faction have a magic number they bring into the formula. This ensures that, due to their power, these units are also weighted heavier in the calculation of the Offense Level.

GDI Offense Level Modifiers:
  • Commando: 2,6
  • Mammoth: 2,6
  • Juggernaut: 1,5
  • Kodiak: 2,6
Nod Offense Level Modifiers:
  • Confessor: 1,5
  • Commando: 2,4
  • Avatar: 1,5
  • Specter: 2,6
  • Salamander: 2,6
Any unit not listed can be assumed to have an OLM of 0 (in words: Zero)

Theoretical Army Score
For calculating the Final Army level another value is needed, the value of an theoretical army using all available army points and has all units at its available max level. This does not take the magical numbers of the OLM into account.
c6a88xujk8j7.png
Army Score Fraction
Before the Final Army Level, a Fraction is calculated based on the Player Army Score compared against the Theoretical Army Score of a given level.
l065v1bk396m.png
The game calculates the Theoretical Army Score from level 1 to 200 (just in case) and then checks the Player Army Score against that array of values. The TAS that is the next lower value to the PAS is then chosen as the Theoretical Army Score for the calculation. Both are subtracted with the TAS that is one level below the TAS corresponding to the PAS.

Final Army Level
Ultimately the Final Army Level is calculated with the formula below and rounded to two digits after the comma.
dmlxsa19j3tq.png
If the TAS and PAS are identical, this value will return 1, which will result in an even Offense Level equal to the Command Center level, as intended.
In some rare cases the Offense level may exceed the CC level. That is when fielding only endgame units with an OLM greater than 0 (see list) in a low-level army; like 6x level 10 Salamanders at a level 10 CC.

Naturally, the mix of units is what ultimately decides the effectiveness of your army in combat, not the raw Offense Level alone. The strongest units won't be worth their repair costs if they are not used effectively.

Envision Entertainment Community Liaison
Post edited by EE_Elephterion on

Replies

  • Recently i was asked if I could go into some detail about how the game estimates the level of your Offense army and so here it is, a little guide on the magic behind the curtain.
    If there are other aspects of the game you'd like to know more let me know and I'll see what I can reveal to you.
    Envision Entertainment Community Liaison
  • Soixie
    392 posts Member
    The code is actually much more simple, as it's simply a weighted average based on cost size plus some "magic fairy dust". Since I didn't need the magic dust at the time I never reversed parsed it, thanks for making me want to to do that now.
  • Hi! could you explain the same thing about a player score. How it is calculated. Which base units worth how much. Thanks
  • Player score is determined by building units within the base, and building defense and offensive units.

    Points provided within a base is the following;

    Levels 1-12 are hard coded, starting after level 12 the formula = ROUNDDOWN (S*1.2^(New level - 1),0)

    Where "S" is a strength

    CONSTRUCTION YARD / DEFENSE HQ / COMMAND CENTER / FACTORY / AIRFIELD / BARRACKS / DEFENSE FACILITY: S = 4
    POWER PLANT: S = 3
    REFINERY / Accumulator / Harvester / Silo: S = 2

    Point values awarded for building a CC for example;
    Level - Points awarded for increasing to
    Increasing CC from level 27 to 28 for example, grants you 317 points
    1 - 20
    2 - 4
    3 - 3
    4 - 4
    5 - 4
    6 - 5
    7 - 6
    8 - 8
    9 - 9
    10 - 11
    11 - 14
    12 - 17
    13 - 20
    14 - 24
    15 - 29
    16 - 35
    17 - 42
    18 - 51
    19 - 61
    20 - 73
    21 - 88
    22 - 106
    23 - 127
    24 - 153
    25 - 184
    26 - 220
    27 - 264
    28 - 317
    29 - 381
    30 - 457
    31 - 549
    32 - 659
    33 - 791
    34 - 949
    35 - 1,139
    36 - 1,367
    37 - 1,640
    38 - 1,968
    39 - 2,362
    40 - 2,835
    41 - 3,402
    42 - 4,082
    43 - 4,899
    44 - 5,879
    45 - 7,054
    46 - 8,465
    47 - 10,159
    48 - 12,190
    49 - 14,629
    50 - 17,554
    51 - 21,065
    52 - 25,278
    53 - 30,334
    54 - 36,401
    55 - 43,682
    56 - 52,418
    57 - 62,902
    58 - 75,482
    59 - 90,579
    60 - 108,695
    61 - 130,434
    62 - 156,520
    63 - 187,825
    64 - 225,390
    65 - 270,468


    For defensive units, levels 1-13 are hard coded, after which the formula is

    =CORE_VALUE * 1.2^(New Level - 12)

    I don't remember how I calculated core value originally, but it's similar to "strength value" in the prior formula

    Barb Wire / Wall = 2.4519276232704
    Missile Squad / Zone Trooper = 4.087
    MG Nest / Guardian / Predator / Pitbull / Sniper Team = 8.172
    "Artillery" = 24.525

    Point values awarded for building an Artillery defensive unit for example;
    Level - Points awarded for increasing to
    Increasing ART from level 27 to 28 for example, grants you 453 points
    1 - 19
    2 - 4
    3 - 5
    4 - 6
    5 - 7
    6 - 8
    7 - 10
    8 - 11
    9 - 15
    10 - 17
    11 - 20
    12 - 24.525
    13 - 29
    14 - 35
    15 - 42
    16 - 51
    17 - 61
    18 - 73
    19 - 88
    20 - 105
    21 - 127
    22 - 152
    23 - 182
    24 - 219
    25 - 262
    26 - 315
    27 - 378
    28 - 453
    29 - 544
    30 - 653
    31 - 784
    32 - 940
    33 - 1,128
    34 - 1,354
    35 - 1,625
    36 - 1,950
    37 - 2,340
    38 - 2,808
    39 - 3,369
    40 - 4,043
    41 - 4,851
    42 - 5,822
    43 - 6,986
    44 - 8,383
    45 - 10,060
    46 - 12,072
    47 - 14,486
    48 - 17,383
    49 - 20,860
    50 - 25,032
    51 - 30,038
    52 - 36,046
    53 - 43,255
    54 - 51,906
    55 - 62,288
    56 - 74,745
    57 - 89,694
    58 - 107,633
    59 - 129,160
    60 - 154,992
    61 - 185,990
    62 - 223,188
    63 - 267,826
    64 - 321,391
    65 - 385,669

    The same formula for defense is used for offense

    =CORE_VALUE * 1.2^(New Level - 12)

    Core value for Mammoth / Firehawk / Orca / Kodiak = 8.172


    1 - -
    2 - 10
    3 - 11
    4 - 14
    5 - 17
    6 - 20
    7 - 24
    8 - 29
    9 - 34
    10 - 42
    11 - 49
    12 - 8.172
    13 - 10
    14 - 12
    15 - 14
    16 - 17
    17 - 20
    18 - 24
    19 - 29
    20 - 35
    21 - 42
    22 - 51
    23 - 61
    24 - 73
    25 - 87
    26 - 105
    27 - 126
    28 - 151
    29 - 181
    30 - 218
    31 - 261
    32 - 313
    33 - 376
    34 - 451
    35 - 541
    36 - 650
    37 - 780
    38 - 935
    39 - 1,123
    40 - 1,347
    41 - 1,617
    42 - 1,940
    43 - 2,328
    44 - 2,793
    45 - 3,352
    46 - 4,022
    47 - 4,827
    48 - 5,792
    49 - 6,951
    50 - 8,341
    51 - 10,009
    52 - 12,011
    53 - 14,413
    54 - 17,296
    55 - 20,755
    56 - 24,906
    57 - 29,887
    58 - 35,865
    59 - 43,037
    60 - 51,645
    61 - 61,974
    62 - 74,369
    63 - 89,243
    64 - 107,091
    65 - 128,509


    *** Note; formula is same for all worlds. Strengths and Core_Values might be different for your world (go test) and I did not extrapolate all buildings and all units for both factions.
  • Wow! This is EXACTLY what I wanted! Thank you so much!
  • These two I could figure out more or less, and you can just do log of total crystals spent and get a very good guesstimate. The big puzzle to me was always how you calculate the level of a base based on the number and levels of buildings, could you clarify this as well, please?
  • Soixie
    392 posts Member
    edited September 2018
    I've never tried to calc base level, but when I took a look this morning, straight weighted average does not work.

    7 primary buildings
    7 accumulators
    27 power plants

    Base level was off by ~1.5

    I'll keep tinkering with it however, the core formula for which the entire game engine is based on is simply X * Y ^ Z where;
    X = arbitrary value
    Y = 1.1, 1.2 or 1.32
    Z = Level
  • How about the formula for how the results of a battle are calculated?
  • How about the formula for how the results of a battle are calculated?

    The TACS script is public, simply open and read it for battle calcs.
  • "Recently i was asked if I could go into some detail about how the game estimates the level of your Offense army and so here it is, a little guide on the magic behind the curtain.
    If there are other aspects of the game you'd like to know more let me know and I'll see what I can reveal to you."

    I for one would like a precise description of how the fortress level is calculated. Previously we were given two completely different versions by Rhiordd and by another one of the developers at that time. One said it was a simple calculation based on the top 10 individual player offense levels, while another claimed it was based on the average offense levels of the top 10 alliances.
    I have spent quite a bit of time helping other following alliances get their fortress badges and for the most part it seems the fortress level rises too quickly to the maximum level of 95. Without previous badgewinners on that world helping out it could take years for many of the following alliances to have enough maximum sized offenses to defeat the fortress on their own.
  • Rovsau
    8 posts New member
    Can you explain the algorithm for relocation landings?
  • How about a formula for defensive units. No one can use artillery
  • Rovsau wrote: »
    Can you explain the algorithm for relocation landings?

    Sector Relocation = X, Y where;

    Cx, Cy = Center of world.

    f(x) = average (X1 + X2 + X3 + ... + Xn)
    f(y) = average (Y1 + Y2 + Y3 + ... + Yn)

    f(d) = SQRT [ (Cx - f(x)) ^2 + (Cy - f(y)) ^2 ] + 40

    Relocation to;
    North = Cx, Cy - f(d)
    Northeast = Cx + SQRT [ f(d)^2 / 2 ] , Cy - SQRT [ f(d)^2 / 2 ]
    East = Cx + f(d), Cy
    Southeast = Cx + SQRT [ f(d)^2 / 2 ] , Cy + SQRT [ f(d)^2 / 2 ]
    South = Cx, Cy + f(d)
    Southwest = Cx - SQRT [ f(d)^2 / 2 ] , Cy + SQRT [ f(d)^2 / 2 ]
    West = Cx - f(d), Cy
    Northwest = Cx - SQRT [ f(d)^2 / 2 ] , Cy - SQRT [ f(d)^2 / 2 ]



    EXAMPLE:
    Player LON LAT
    Base 1 482 559
    Base 2 488 560
    Base 3 487 563
    Base 4 477 552
    Base 5 524 611
    Base 6 498 573
    Base 7 502 570
    Base 8 477 572
    Base 9 501 641
    Base 10 556 622
    Base 11 478 644
    Base 12 489 563
    Base 13 502 572
    Base 14 502 577
    Base 15 484 561
    Base 16 483 571
    Base 17 503 597
    Base 18 498 623
    Base 19 502 574
    Base 20 476 542
    Base 21 498 636
    Base 22 498 601
    Base 23 483 569
    Base 24 505 583
    Base 25 484 554
    Base 26 470 664
    Base 27 469 656


    f(x) = 493.19
    f(y) = 589.26

    Cx, Cy = 500,500 for this world, many worlds are different size maps

    Relocation options;

    N 500 370
    NE 592 408
    E 630 500
    SE 592 592
    S 500 630 [Not possible - player in example is already in south sector]
    SW 408 592
    W 370 500
    NW 408 408

  • How about a formula for defensive units. No one can use artillery

    Completely irrelevant as absolutely no bonus' are used to calculate defense level, it's straight weighted average.

    With 200 max possible points, simply multiply unit size (5, 10, 30) by level, then divide by total defense size.

    I personally generally use a mixture of size 5 and 10 units, but always upgrade a full level at a time.

    If you had 20 size 10 units, you'd simply add up all the levels and divide by 20. If you have a mix, multiply each individual unit by it's size (5, 10 etc) then divide by 200.



  • Rovsau
    8 posts New member
    Soixie, that's amazing. Thanks!
  • Is there a similar method in calculating defense point? Also if the level value surpasses the comm center/def center does it disable certain units if the units are at or below the centers?
  • EE_Elephterion
    1220 posts Envision Developer
    edited March 5
    Is there a similar method in calculating defense point? Also if the level value surpasses the comm center/def center does it disable certain units if the units are at or below the centers?

    Defense points, as in the points needed to place units? They are not calculated but from a table. so each level of the Def HQ provides a fixed set amount of points up to a max of 300.
    Also if the level value surpasses the comm center/def center does it disable certain units if the units are at or below the centers?
    I'm not quite sure what you mean, is the unit's level surpassing that of the HQ or even to/lower then the level? It can't be both at the same time after all.
    Units are only deactivated if they are above the level of their HQ (defense or offense respectively).
    The other facilities are providing the repair functionality, the penalty for exceeding them in level is in decreased efficiency.
    Post edited by EE_Elephterion on
    Envision Entertainment Community Liaison
  • Unit Score
    First, the individual score of every of your fielded units is calculated.
    8ur31w5zy00o.png
    All Unit Scores add up to the final Player Army Score

    Offense Level Modifiers
    The strongest units of a faction have a magic number they bring into the formula. This ensures that, due to their power, these units are also weighted heavier in the calculation of the Offense Level.

    GDI Offense Level Modifiers:
    • Commando: 2,6
    • Mammoth: 2,6
    • Juggernaut: 1,5
    • Kodiak: 2,6
    Nod Offense Level Modifiers:
    • Confessor: 1,5
    • Commando: 2,4
    • Avatar: 1,5
    • Specter: 2,6
    • Salamander: 2,6
    Any unit not listed can be assumed to have an OLM of 0 (in words: Zero)

    Theoretical Army Score
    For calculating the Final Army level another value is needed, the value of an theoretical army using all available army points and has all units at its available max level. This does not take the magical numbers of the OLM into account.
    c6a88xujk8j7.png
    Army Score Fraction
    Before the Final Army Level, a Fraction is calculated based on the Player Army Score compared against the Theoretical Army Score of a given level.
    l065v1bk396m.png
    The game calculates the Theoretical Army Score from level 1 to 200 (just in case) and then checks the Player Army Score against that array of values. The TAS that is the next lower value to the PAS is then chosen as the Theoretical Army Score for the calculation. Both are subtracted with the TAS that is one level below the TAS corresponding to the PAS.

    In some rare cases the Offense level may exceed the CC level. That is when fielding only endgame units with an OLM greater than 0 (see list) in a low-level army; like 6x level 10 Salamanders at a level 10 CC.
    What I meant is, in calculating the offense level, is there a similar method in calculating the defense level? Like likes say, the 3 artillery units, do they have an offense level modifier? There must have been a misunderstanding
  • EE_Elephterion
    1220 posts Envision Developer
    No, to quote Sioxie who already answered that just a few entries above^^
    Soixie wrote: »
    How about a formula for defensive units. No one can use artillery

    Completely irrelevant as absolutely no bonus' are used to calculate defense level, it's straight weighted average.
    Envision Entertainment Community Liaison
  • Also, when it comes to forgotten defense points, do they follow a different set of rules? Whenever I use Cncopt on a forgotten installation (bases/outposts/camps), they usually either have higher or lower than the limit.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!