Skip to content

Add extensible Achievement API#88

Draft
HayashiUme wants to merge 2 commits into
All-Of-Us-Mods:masterfrom
HayashiUme:master
Draft

Add extensible Achievement API#88
HayashiUme wants to merge 2 commits into
All-Of-Us-Mods:masterfrom
HayashiUme:master

Conversation

@HayashiUme

Copy link
Copy Markdown

Overview

Add an extensible achievement API to MiraAPI. The API provides only data logic
— no UI, no networking. The Example project demonstrates how to build title
display, RPC sync, and chat commands on top of it.

API (MiraAPI/Achievements/)

  • IAchievement — interface for defining custom achievements
  • BaseAchievement — abstract base with built-in progress tracking
  • AchievementManager — registry, progress, titles, encrypted file persistence
  • AchievementTier — rarity enum (Common → Legendary)
  • AchievementUnlockedEvent — MiraEvent fired on first unlock

Persistence

  • Stored alongside existing presets:
    Application.persistentDataPath/mira_achievement/{ModGuid}/Achievement.dat
  • Same layout as mira_presets/ — one folder per mod GUID
  • XOR encryption with a key derived from the mod GUID

Example (MiraAPI.Example/Achievements/)

  • MadKillerAchievement / FirstVictoryAchievement — sample achievements
  • /achievement <id> — equip an unlocked title in chat
  • /achievement unlock <id> — force-unlock for testing
  • AchievementTitleComponent — shows [Title] above player name
  • TitleSyncRpc — syncs equipped title across network

Scope

This is the minimal foundation. Extension ideas that consumers can build on top:

  • Achievement UI — browse all achievements, view progress bars, equip titles
  • Cloud stats — upload progress to a server for leaderboards or cross-device sync
  • Seasonal achievements — time-limited achievements that auto-expire

Notes

Extensive XML doc comments are included on all public members to fully
demonstrate the API surface. Some phrasing may be slightly off — I'm not a
native English speaker and relied on translation tools for parts of the docs.

@HayashiUme

Copy link
Copy Markdown
Author

Due to some overlap with existing APIs, it has been converted to Draft upon request. If you remain interested, you can restart and merge it into the main branch

@HayashiUme HayashiUme marked this pull request as draft June 14, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant