feat(libSceNpTrophy2,libSceNpUniversalDataSystem): unlock progressive trophies through _UpdateTrophyProgress #9562
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9562"
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?
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T02:25:10Z.
What
Progressive trophies never unlock and always report 0 progress. Titles report a progressive trophy's progress with
_UpdateTrophyProgress.maindropped that event ("trophy progress is not recorded"), and also skipped the statistic and rule a title'sudsNN.ucpships to carry it. Borderlands 4 (PPSA01494) ships this shape for 21 of its 64 trophies, and Forspoken (PPSA03984) for 23. In Borderlands 4:trophy00.ucpgives trophy 5"unlockCondition":{"udsStatId":"116","comparator":"ge","targetValue":"60","progressive":true}.stats_definition.jsondefines stat 116 as"dataType":"int32","aggregation":"max","minValue":"0","initialValue":"0".stats_extraction.jsonhas"condition":{"eventName":"_UpdateTrophyProgress","property":{"path":"$._trophy_id","comparator":"==","value":"5"}}, with"action":{"input":"$._trophy_progress","output":{"statId":116}}.On
mainthe boot log lists all three as unsupported:stat 116 has aggregation "max"; only "latest" is supported,... filters _UpdateTrophyProgress by more than its eventName; only eventName conditions are supported.The changes:
maxstatistics keep the largest value posted. They start frominitialValue, or fromminValuewithout one.StatStore::Raisedoes the compare and store under the store's lock, so two posts can't lose the larger value.int32statistics take values from 0 to 2147483647. A negativeminValuestill refuses, with its own text.eventNameplus onepropertywhosepathis a$.namepath, whosecomparatoris==and whosevalueis an unsigned integer. The rule then applies only to events whose property holds that integer. Any other comparator, a value that isn't an unsigned integer, or more condition members still skip the rule, with a message that says what is supported._UpdateTrophyProgressnow goes through the title's statistic rules like any other event. The trophy store's existing stat path then reports the progress and unlocks the trophy at its target, and the platinum with it._UnlockTrophyis unchanged: it still unlocks directly, not through itscountstatistic.sum,count,collection,eachLatest) are still skipped.max,int32and the property filter follow the rules titles ship, not a console measurement.Tested
Independent run by @Dextroid17 (comment): CachyOS, GCC 16.2.1, Release with SPIRV-Tools on. The same 8 trophy/UDS tests pass 3 of 3 on
905d880156and on it merged withmain2e22b67032. Three negative controls each fail 3 of 3: the oldEvent.cpp, dropping therule.filtercheck, and dropping the Max/Raise branch.Rebased onto
main4777caca34aseb60099724, with no conflicts;git range-diffshows the commit unchanged. The only trophy-side change onmainsince the previous base is #9433's new PS4libSceNpTrophylibrary, which uses none of the shared code this PR changes. Oneb60099724the seven tests pass 3 of 3 on Linux (Ubuntu 26.04.1, GCC 15.2, Release). The earlier rebase ontomaindce41a8947(headb21f0b7e88) passed the same 3 of 3. The results below are from the pre-rebase head.Linux (Ubuntu 26.04.1, GCC 15.2, Release), head
259922dc10ona6dcea9279: the seven trophy and UDS tests (guest_nptrophy2,np_trophy2_store,np_trophy2_package,np_uds_events,guest_np_trophy_unlocks,guest_np_trophy_data,guest_np_trophy_stats) pass 3 of 3.Windows 11 VM (WinLibs GCC 15.2.0, Release): the same seven pass 3 of 3 on this head and 3 of 3 on its merge base.
New tests:
np_trophy2_package(testStatRules,testProgressRules):maxstatistics, from theirinitialValueand never going down,int32bounds,==property filters (a matching id updates, another id or a missing or negative id doesn't), the refusal texts, andStatStore::Raiseacross a restart.guest_np_trophy_stats(RecordTrophyProgress): Borderlands 4's shape end to end throughsceNpUniversalDataSystemPostEvent. Progress 4 then 2 reports 4, the other trophy stays at 0, 3 of 3 unlocks the second trophy, 12 of 10 unlocks the first and the platinum, and the stats file keeps112 12and113 3.main's sources and this branch'sGuestNpTrophyStats.cpp(keepingmain'ssummessage, so the run reaches the new case),guest_np_trophy_statsaborts withtrophy progress was not recorded for its own trophy, aftermainlogs[trophy] ignored _UpdateTrophyProgress {"_trophy_id":1,"_trophy_progress":4} posted to context 6: trophy progress is not recorded. With this branch's sources restored it passes again.np_trophy2_packagedoesn't build againstmain, since it usesStatAggregation,StatFilterandStatStore::Raise.Real title data: I compiled
TrophyPackage.cppfrommainand from this head into a small host program and parsed the titles' owntrophy00.ucpanduds00.ucp. It counts the progressive trophies whoseudsStatIda rule feeds:main_UpdateTrophyProgress; 21 of 21lateststatistics)The other six titles I have (Ghost of Tsushima, Metal Gear Solid 4, Crimson Desert, MXGP 26, Super Meat Boy 3D, Call of Duty Black Ops 2) have no progressive trophies.
Not tested: a title posting
_UpdateTrophyProgressduring play. None of my runs got far enough to post one, and none of 658 earlier run logs contains a posted progress event. macOS.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T04:02:03Z.
Review: CHANGES_REQUESTED
The parser/store changes are backed by targeted tests for
max,int32, initial values, property filters, restart persistence and the Borderlands 4 trophy-progress path. The reported red/green and Linux/Windows runs are author-reported; hosted conventions, eligibility, intake, labels and report checks pass, while hosted product/relinker jobs are skipped. I did not run tests locally.One repository rule remains before approval: this branch is based on
6ef5a1c4, while current upstreammainisd9c99c9(after #8204). The intervening main change appears unrelated, but CONTRIBUTING requires the branch to stay current. Please rebase/merge currentmainand rerun the focused seven trophy/UDS tests on the resulting head; update the Tested section to identify that head.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T04:12:59Z.
@MarcZX10 rebased onto
maindce41a8947, with no conflicts, as headb21f0b7e88. The seven trophy and UDS tests pass 3 of 3 on it (Linux, Release), and the Tested section now names that head.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:21:23Z.
Thanks for rebasing and rerunning the seven focused tests. The specific blocker in my earlier review is resolved: you report those tests passing 3/3 on the rebased head, and hosted eligibility, labels, report, and conventions checks succeed (the product and relinker jobs are skipped). I also checked the intervening upstream changes: they do touch the same TrophyPackage/TrophyStore/TitleTrophies code, but the three-way merge is clean and there are no later main commits on these paths. The remaining repository-rule issue is freshness: this head is 1 commit ahead and 92 behind current upstream/main (merge base
dce41a894), so please update to current main and rerun the focused trophy/UDS suite before merge. I did not run the C++ tests locally; the available filesystem has no free space, so I’m treating the posted test results as author-reported. The PR’s checklist and Tested section otherwise give the title data, supported JSON shapes, negative control, and untested real-title posting limitation needed to assess the scope.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:21:25Z.
Review: DISMISSED
The prior current-main/test blocker is resolved on b21f0b7e88, and the targeted evidence is detailed. One current blocker remains: upstream main is
4777caca34, while this branch is 1 ahead/92 behind (merge basedce41a894). CONTRIBUTING requires the branch to stay current; please update it and rerun the focused seven trophy/UDS tests before merge. I did not run the tests locally because this environment's filesystem is full, so the Linux results are author-reported. Hosted eligibility, labels, report, and conventions succeed; product and relinker jobs are skipped.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T11:33:22Z.
@MarcZX10 rebased onto current
main4777caca34aseb60099724, with no conflicts.git range-diffshows the commit unchanged.The only trophy-side change on
mainsince the last base is #9433's new PS4libSceNpTrophy, which doesn't use the shared package, store or title-trophy code this PR changes. On the new head the seven trophy/UDS tests pass 3 of 3 on Linux. Tested names the head.AI-assisted: yes (Claude Code)