trophy: support int64 and aggregated UDS stats (Prince of Persia: The Lost Crown) #1732
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1732
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1732/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Alexey-Izilianov on GitHub · 2026-10-19 19:49 UTC · original
Alexey-Izilianov:trophy-uds-aggregation→main· +438 −99 · 4 files · 1 commits · closed without mergingFixes #1705.
Game: Prince of Persia: The Lost Crown (PPSA10067)
Problem: the game reaches gameplay and posts UDS events, but no trophy is ever unlocked:
Two causes:
NpUniversalDataSystemEventPropertyObjectSetInt64dropped the value, soint64event properties never reached the trophy code.LoadUdsRulesaccepted only unsignedlateststats. None of this game's 59 stat definitions match. For example, trophy 0030 "Deadly Trap" usesUpdateNbSpikesKills→$.newValue→ stat 113 (int64, aggregationmax,ge 5, progressive). The package also usescountstats.Change:
UdsIntegergainsint64_t, andSetInt64stores the value.int32/uint32/int64/uint64data types and thelatest/max/min/sum/countaggregations.sumandcountsaturate at the type range.minValue/maxValueare still skipped, as before.countrules need noinputproperty. Events without integer properties are now evaluated so they can be counted.statValues. Older files without this key load as before.FindUdsTrophiesbecomesApplyUdsEvent.ge/gt) now report the real stat progress inNpTrophy2Data, instead of 0 until unlocked.Testing:
trophy_system_testshas a newTestAggregatedStatscase. It replays the "Deadly Trap" definition from the issue (int64 max, ge 5), pluscount, signedsumwith negative input and saturation,minwithle, persistence, and resume after reload.@coderabbitai[bot] on GitHub · 2026-10-19 19:52 UTC · original · edited 2026-10-31 08:35 UTC
No actionable comments were generated in the recent review.
ℹ️ Recent review info
⚙️ Run configuration
acf72b9f-a819-4170-b42e-e394b213b54c📥 Commits
Reviewing files that changed from the base of the PR and between
0cad4672e9and aa065bfd8f5caca856de36fbc96530c4af36f569.📒 Files selected for processing: 4
src/common/trophies.cppsrc/common/trophies.hsrc/libs/libTrophy.cpptests/TrophySystemTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Walkthrough
UDS trophy rules now support signed and unsigned 32- and 64-bit integers, five aggregation modes, and persisted stat values. Events update stats for pending trophies and can unlock trophies when their comparisons are satisfied. The trophy library reports stored progress and saves changed stats. The int64 event-property setter now stores its value. Tests cover rule matching, aggregation, progress, unlocks, and persistence.
Suggested reviewers:
pipe530Change: Bug fix · Severity of issue fixed: Medium
Merge Risk:
Minimal · up to
aa065No actionable issue remains from this review; the change is mergeable after normal checks.
Pre-merge checks:
4
#1705requires support for the game's UDS rules and persistence of a trophy when its condition is met.LoadUdsRulesnow accepts the required integer types and aggregations, includingint64/`…#1705. The modified runtime code supports UDS event properties, rule loading, aggregation, unlock persistence, and progressive status. The added tests cover these behavio…Full details: Linked Issues check
Explanation
Issue
#1705requires support for the game's UDS rules and persistence of a trophy when its condition is met.LoadUdsRulesnow accepts the required integer types and aggregations, includingint64/maxandcount.SetInt64now stores event values.ApplyUdsEventaggregates matching events, evaluates trophy conditions, persistsstatValues, and reports progressive progress.TestAggregatedStatscovers the issue's stat 113 example and count rules.Full details: Out of Scope Changes check
Explanation
The changes stay within issue
#1705. The modified runtime code supports UDS event properties, rule loading, aggregation, unlock persistence, and progressive status. The added tests cover these behaviors. No unrelated product area or unrelated feature is changed.Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
@theantipopau on GitHub · 2026-10-20 00:44 UTC · original · approved these changes
Reviewed the full diff. Correctness notes:
Maps exactly onto #1705's trophy 0030 example (UpdateNbSpikesKills, int64 stat 113, max, ge 5). CI builds are currently blocked repo-wide by the main-branch VR link break (#1741 fixes it); worth re-running checks here once that merges.
@Nmzik on GitHub · 2026-11-04 06:23 UTC · original
Credited
Pull request closed