Configuring Combinations Under Set Bonuses: Rule Decomposition and Scoring Models
This article explains how to evaluate team or loadout configurations when multiple combinable effects, set bonuses, and exclusive modifiers are involved. It breaks down the three core stacking rules (additive, threshold-triggered, and exclusive), introduces a scoring model that weights effects by scenario, and provides a complete Python framework for aggregating member effects, scoring teams, applying role constraints, and running sensitivity analysis to ensure decisions remain stable under weight perturbations. The code is reusable for any similar multi-dimensional selection problem.
Why Configuration Choices Often Lead to Analysis Paralysis
Many systems offer a large number of combinable options. Take team configuration as an example: each member can equip different gear, gear forms sets, and each set grants additional effects. The more options there are, the higher the cost of comparing them one by one. A common approach is to pick based on gut feeling, which often results in poor synergy between effects or noticeably weaker performance in certain scenarios.
The underlying problem is ranking multi-dimensional benefits under finite constraints. If the benefits can be decomposed into a computable model, the decision becomes much clearer. This article uses team configuration as an example to show how to build such a model and provides a code framework that you can adapt and reuse directly.
Three Rules for Decomposing Combination Effects
Before analyzing set-based bonuses, you must first determine how they stack. They generally fall into one of three categories:
- Additive stacking: Each effect is added directly, and the benefit grows linearly with the count.
- Threshold triggering: An effect only activates when the number of pieces from the same set reaches a specified threshold.
- Exclusive replacement: Only one effect from the same category can apply. When multiple sources exist, the maximum value is taken, not the sum.
| Rule Type | Typical Characteristic | Modeling Focus | Code Corresponding |
|---|---|---|---|
| Additive | Values are added directly | Sum each item | aggregate with sum |
| Threshold | Benefit only appears when item count is met | Count pieces first, then call set_bonus |
set_bonus |
| Exclusive | Only one effect from a category applies | Take the maximum value | aggregate with max |
Ignoring threshold and exclusive rules is the most common source of evaluation errors. Directly summing all values will overestimate configurations that require a certain number of pieces to activate bonuses, and it will also overestimate configurations where the same type of effect appears multiple times.
Consider a three-person team to illustrate the difference between the two rules. Suppose the “Gale” set grants +10 attack speed when three pieces are equipped. Member A has +5 attack speed as an additive effect. Members B and C have critical rates of 8 and 6 respectively, and critical rate is an exclusive effect.
rule = SetRule("Gale", threshold=3, bonus={"attack_speed": 10})team = [Member("A", "dps", {"attack_speed": 5}, ["Gale"]),Member("B", "dps", {"crit_rate": 8}, ["Gale"]),Member("C", "support", {"crit_rate": 6}, ["Gale"]),]print(dict(aggregate(team, [rule], exclusive={"crit_rate"})))# {'attack_speed': 15, 'crit_rate': 8}
Attack speed is 15 because the additive effect and the threshold bonus are summed. Critical rate is 8, not 14, because the exclusive effect keeps only the maximum value. A simple sum would overestimate both values.
Translating the Configuration Problem into a Scoring Model
The overall value of the whole team can be expressed as:
Score(team) = Σs (scenario_weight_s × Σ_e scenario_priority{s,e} × effect_value_e(team))
Where:
- Scenario: e.g., “fast-paced combat” vs. “long-duration sustained consumption”. Different scenarios have different demands on effects.
- Scenario weight: Reflects the frequency or importance of the scenario in practice.
- Scenario priority: Reflects the value of a given effect within that scenario.
- Effect value: Derived by aggregating all members’ effects in the team. The aggregation rule is: independent effects are summed, threshold bonuses are added after counting pieces, and exclusive effects take the maximum.
The following code provides a reusable implementation framework. The data is for illustration only; actual values should be filled in based on the corresponding scenario documentation or experimental results.
from collections import Counter, defaultdictfrom dataclasses import dataclassfrom itertools import combinations@dataclassclass Member:name: strrole: str # role: dps / support / tankeffects: dict # effect name -> value, treated as additivesets: list # names of sets this member's gear belongs toavailable: bool = True # whether this member is obtainable@dataclassclass SetRule:name: strthreshold: int # number of pieces requiredbonus: dict # additional effects when threshold is met@dataclassclass Scenario:name: strweight: float # scenario weightpriorities: dict # effect name -> priority in this scenariodef set_bonus(pieces, threshold, bonus_effects):"""Return bonus effects only if pieces >= threshold, otherwise empty dict."""return bonus_effects if pieces >= threshold else {}def aggregate(team, set_rules, exclusive):"""Aggregate team effects. Effects in the exclusive set take max, others are summed."""values = defaultdict(list)for m in team:for effect, value in m.effects.items():values[effect].append(value)piece_count = Counter(s for m in team for s in m.sets)for rule in set_rules:bonus = set_bonus(piece_count[rule.name], rule.threshold, rule.bonus)for effect, value in bonus.items():values[effect].append(value)return {e: max(vs) if e in exclusive else sum(vs) for e, vs in values.items()}def score_team(team, scenarios, set_rules, exclusive):totals = aggregate(team, set_rules, exclusive)return sum(sc.weight * sc.priorities.get(effect, 0) * valuefor sc in scenariosfor effect, value in totals.items())def role_ok(team, role_limits):"""role_limits: role -> (min, max). Roles not listed are unrestricted."""count = Counter(m.role for m in team)return all(lo <= count[role] <= hi for role, (lo, hi) in role_limits.items())def best_teams(pool, size, scenarios, set_rules, exclusive, role_limits, top_n=3):"""Enumerate available members and return the top_n highest-scoring teams."""candidates = [m for m in pool if m.available]ranked = []for team in combinations(candidates, size):if role_ok(team, role_limits):ranked.append((score_team(team, scenarios, set_rules, exclusive),tuple(m.name for m in team)))ranked.sort(key=lambda item: item[0], reverse=True)return ranked[:top_n]
The enumeration complexity is C(n, k), where n is the number of available members and k is the team size. This is acceptable when the candidate pool is small. For larger pools, you can use a greedy method to assign initial scores to each member and then enumerate combinations over the top-ranked members. Regardless of the method, always keep the top_n results instead of only the first place. If the top candidates are very close in score, the conclusion is not robust and should be interpreted together with sensitivity analysis.
Scenario‑Based Role Fit
The same member can have very different value in different scenarios. Evaluations should be performed per scenario rather than relying on a single aggregated number.
- Fast‑paced scenarios: Short‑burst damage and immediate response are more important. Members with effects concentrated in the early phase have higher value; configurations that provide immediate returns are preferred.
- Sustained scenarios: Endurance and stability matter more. Continuous buffs and damage mitigation decide late‑game performance; protective or sustained configurations are preferred.
- Support members: Amplify overall team value by providing group‑wide buffs. Their personal damage may be low, so the evaluation must include the team‑level aggregated effects.
aggregatecombines all members’ effects at the team level, so support buffs automatically enter the scoring. - Tank members: Contribute to overall survivability through protective bonus effects. Their direct damage contribution is limited, so they suit teams that need stability over time.
Role composition must be constrained separately. For example, a four‑person team might require 1‑2 DPS, 1 support, and 1‑2 tanks:
role_limits = {"dps": (1, 2), "support": (1, 1), "tank": (1, 2)}
role_ok filters out teams that do not satisfy these limits during enumeration, so the ranking never includes lineups with missing roles.
A member performing well in a fast‑paced scenario is not necessarily the best choice in a sustained scenario. The two scenarios should be modeled separately and then weighted according to actual usage ratios.
Handling Data Gaps and Acquisition Constraints
In real decisions, data is often incomplete and acquisition conditions vary. Keep the following points in mind.
- Mark options with restricted availability separately. Members with
available=Falseare excluded from ranking but are listed separately with a note such as “requires fulfillment of acquisition conditions”. This way the reader sees the recommended results and also knows which strong options were excluded. - Do not fill missing data with guesses. If a value cannot be confirmed, mark it as unknown, skip it during aggregation, and document the affected members and effects in the analysis. When a priority is missing,
priorities.getreturns 0 by default, meaning that effect is not scored in that scenario. This assumption must be documented in the report. - Perform sensitivity analysis. Perturb the scenario weights slightly and observe whether the optimal configuration changes. If the conclusion remains stable, the recommendation is reliable. If it flips frequently, more experimental data is needed.
def is_stable(pool, size, scenarios, set_rules, exclusive, role_limits, delta=0.1):"""Check if the top team remains unchanged when each scenario weight varies by ±delta."""base = best_teams(pool, size, scenarios, set_rules, exclusive, role_limits, top_n=1)if not base:return Falsebest_names = base[0][1]for i in range(len(scenarios)):for sign in (1, -1):perturbed = [Scenario(s.name, s.weight * (1 + sign * delta) if j == i else s.weight, s.priorities)for j, s in enumerate(scenarios)]top = best_teams(pool, size, perturbed, set_rules, exclusive, role_limits, top_n=1)if not top or top[0][1] != best_names:return Falsereturn True
Practical Checklist
- First identify the threshold piece count and exclusive effects for each set, then decide whether to sum or take the maximum.
- Assign a weight to each scenario and document the rationale for the weight.
- For each member, record the role, availability, and data source, and set role count limits.
- Run enumeration or heuristic search, keeping the top several results for comparison.
- Perform sensitivity analysis to verify the stability of the conclusion.
- Recalculate whenever data is updated to avoid using outdated conclusions.
Common Pitfalls
- Looking only at single‑value performance and ignoring combination bonuses: A single item may look great but fail to be optimal in a full setup. This is handled by the threshold and exclusive logic in
aggregate. - Treating scenario weights as fixed constants: Weights should be updated periodically based on actual usage. The weight perturbation check in
is_stableaddresses this. - Ignoring availability: Recommending a configuration that is currently unobtainable makes the decision useless. The
availablefield filters such members and lists them separately. - Ignoring role composition: Sorting only by effect values may produce a team full of DPS slots. The
role_okfunction enforces the required role counts. - Using too few samples to set weights: Insufficient data leads to overfitting and non‑reproducible conclusions. If the weight basis is weak, expand experimental data first, then adjust weights.
