Getting Started
Understand the core architecture, operational flow, and mental model of ACHIEVE PRO.
Table of Contents
- ποΈ Core Architecture Overview
- π§± The 4 Core Architectural Components
- β‘ Your First Unlock in 30 Seconds
ποΈ Core Architecture Overview
ACHIEVE PRO is designed around a clean, decoupled Facade & Event-Driven Architecture:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Gameplay Scripts / Triggers β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β (Calls static facade methods)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AchievementManager (Facade) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββββ βββββββββββββββββββββ
β AchievementTrackerβ β StatManager β
βββββββββββββββββββββ βββββββββββββββββββββ
β (Domain Engine) β (Rule Engine)
βΌ βΌ
βββββββββββββββββββββ βββββββββββββββββββββ
βAchievementEvents β βAchievementDatabaseβ
β (C# Event Bus) β β(ScriptableObjects)β
βββββββββββββββββββββ βββββββββββββββββββββ
β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββ
βΌ βΌ βΌ
βββββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββββ
βPopupController β βAchievementPersist.β βIPlatformAdapter β
β(Spring Physics UI)β β(AES-256 Storage) β β(Steam, GPG, EOS) β
βββββββββββββββββββββ βββββββββββββββββββββ βββββββββββββββββββββ
π§± The 4 Core Architectural Components
1. AchievementManager (Static Facade)
The primary entry point for your game. Provides high-level, zero-allocation static methods:
AchievementManager.Unlock("boss_dragon")AchievementManager.AddProgress("gold_hoarder", 50f)AchievementManager.SetStat("enemies_slain", 100f)AchievementManager.GetLoginStreak()
2. AchievementTracker (Domain Engine)
Encapsulates all progression logic, including:
- Checking if prerequisites in quest trees are satisfied.
- Calculating fractional progress and milestone tier promotions (Bronze β Silver β Gold).
- Enforcing cooldowns and repeating cycle resets.
- Dispatching reward payloads (XP, In-Game Currency, Custom Items).
3. StatManager (Rule Evaluator)
Maintains decoupled gameplay statistics (e.g. kills, score, accuracy_pct). Automatically evaluates single-stat and multi-condition CompositeRule achievements whenever any tracked statistic changes.
4. AchievementPersistence (AES-256 Storage)
Saves profile data atomically to disk with AES-256 encryption, PBKDF2 salt derivation, and HMAC-SHA256 anti-tamper checksums. Supports multiple save slots (AchievementManager.SwitchSlot("slot_2")).
β‘ Your First Unlock in 30 Seconds
Step 1: Initialize Scene with 1-Click Wizard
Open the Scene Wizard via Tools > Achievement System Pro > 1-Click Scene Wizard, pick your preferred toast anchor (e.g. Top Right), and click βGenerate Setup in Active Sceneβ.
Step 2: Trigger from Code
In any gameplay C# script, trigger an unlock with a single line:
using DecnetGames.AchievementSystemPro;
using UnityEngine;
public class PlayerCombat : MonoBehaviour
{
public void OnBossDefeated()
{
// Unlock an achievement by ID
AchievementManager.Unlock("defeat_first_boss");
}
}
When called, the engine will:
- Validate dependencies in the quest tree.
- Persist the unlock to encrypted disk storage.
- Fire
AchievementEvents.OnAchievementUnlocked. - Trigger the
PopupControllerto spawn a 2nd-order damped spring physics toast with procedural audio. - Notify the active platform bridge (Steam, Game Center, Google Play, or Editor Simulator).