Multi-Condition Composite Rule Engine
Evaluate complex multi-stat achievements combining AND, OR, NOT, and N_OF_M logic without writing custom evaluation loops.
Table of Contents
- 🧠 Why Composite Rules?
- ⚙️ Supported Logical & Comparison Operators
- 💻 Code Example: Updating Game Stats
🧠 Why Composite Rules?
Many AAA achievements require multiple game statistics to be satisfied simultaneously:
- Example: Slay 100 Bosses
ANDcomplete run in under 120 secondsANDtake zero damage.
Instead of writing bespoke monitoring coroutines, define a CompositeRule directly inside the achievement!
⚙️ Supported Logical & Comparison Operators
Logical Operators (LogicalOperator)
AND— All conditions must evaluate to true.OR— At least one condition must evaluate to true.NOT— None of the conditions can evaluate to true.N_OF_M— Exactly $N$ out of $M$ conditions must evaluate to true.
Comparison Operators (ComparisonOperator)
GreaterThan($>$)GreaterThanOrEqual($\ge$)LessThan($<$)LessThanOrEqual($\le$)Equal($==$)NotEqual(!=)BetweenInclusive($A \le x \le B$)
💻 Code Example: Updating Game Stats
The game simply feeds raw stats into StatManager. The engine automatically computes fractional progress and triggers the unlock when the rule is satisfied:
using DecnetGames.AchievementSystemPro;
// Update individual stats anywhere in gameplay
AchievementManager.SetStat("bosses_slain", 100f);
AchievementManager.SetStat("clear_time_seconds", 95f);
AchievementManager.SetStat("damage_taken", 0f);
// StatManager automatically checks all composite rules and triggers unlock!