The algorithm calculates a bonus score for each member based on their performance in Clan War Leagues. The key components considered in the score calculation are stars earned, attacks used, destruction percentage, donations, and the relative Town Hall level. Additionally, the algorithm accounts for alt accounts and calculates an extra bonus based on their performance.
M
: List of members in the clan.A
: List of attacks used by a member.T_s
: Total Stars per player.T_a
: Total Attacks per player.T_d
: Total Destruction Percentage per player.T_h
: List of Average Relative TH per War.W_s
: Weight for stars.W_a
: Weight for attacks.W_d
: Weight for destruction percentage.W_don
: Weight for donations up to a threshold.W_don_extra
: Extra weight for donations beyond the threshold.W_th
: Town Hall differential multiplier.W_alt
: Alt account weight.P_alt_max
: Maximum extra percentage from alt accounts.D_thresh
: Default donations threshold.E_don_max
: Maximum extra donations percentage.E_don_thresh
: Extra donations threshold.m
from M
where m
's list of attacks A
is empty.m
in M
:S_base = (s / T_s) * W_s + (a / T_a) * W_a + (d / T_d) * W_d
s
, a
, and d
represent the stars earned, attacks used, and destruction percentage for m
, respectively.d <= D_thresh
: S_don = (d / D_thresh) * W_don
S_don_base = W_don
.d_extra = d - D_thresh
.P_don_extra = S_don_base + min(E_don_max, W_don_extra * (d_extra / E_don_thresh))
.S_don = P_don_extra
.M_th = 0
.A_i
in m
's attacks, adjust M_th
based on TH differential for that war.M_th
by averaging over the number of attacks: M_th = M_th / a
.M_th
to adjust the score: S_final = S_base * (1 + M_th)
.m
in M
who is not an alt and has alt accounts:a
: P_alt = sum(a_score * W_alt)
.P_alt
to P_alt_max
.m
's score: S_final = S_final + P_alt
.M
in descending order by S_final
to determine the bonus allocation order.M
reflects the final scores, providing a ranking of members based on their performance metrics and adjustments. This ranking helps in distributing the CWL bonuses to top performers.