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

  1. 🧠 Why Composite Rules?
  2. ⚙️ Supported Logical & Comparison Operators
    1. Logical Operators (LogicalOperator)
    2. Comparison Operators (ComparisonOperator)
  3. 💻 Code Example: Updating Game Stats

🧠 Why Composite Rules?

Many AAA achievements require multiple game statistics to be satisfied simultaneously:

  • Example: Slay 100 Bosses AND complete run in under 120 seconds AND take 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!

Copyright © 2026 DecNet Games. Built for Unity Game Developers.

This site uses Just the Docs, a documentation theme for Jekyll.