Skip to content

tmpFile

Andre Leiradella edited this page Sep 30, 2018 · 12 revisions

RetroArch started supporting RetroAchievements (https://retroachievements.org/) on October 2015 and since then it has become an important feature of the official libretro front-end, bringing achievements for retro games on almost all platforms supported by it.

Since the RetroArch implementation of RetroAchievements feature is a rewrite of the code used in their official emulators, the feature had some issues in RetroArch that were not present in those emulators. Thanks to the help of many coders from both projects, the issues had been almost entirely fixed and new features, such as leaderboard support, were added to RetroArch.

To finally put an end to these issues, and to avoid duplicate work in maintaining and expanding code that test the achievements on the two platforms, the functionality was rewritten again from scratch, and adopted by both RetroAchievements and RetroArch. With the 1.7.5 release, RetroArch is proud to announce 100% compatibility with RetroAchievements achievements and leaderboards.

More than 100% compatibility, the new code paves the way for a much-anticipated RetroAchievements feature: the ability to code achievements using the Lua scripting language.

The old expression-based way of coding achievements has served the community well, but as requests to support more complex platforms such as the PSX started to pile up it was clear that the expressions wouldn't be able to, hm, express the complexity necessary to watch the emulated memory for the values necessary to award achievements to the players. If before important values had fixed locations in the emulated memory, we now need to chase pointers that are dynamically allocated until we arrive at those values.

To make it possible to express such complexity, RetroAchievements decided to adopt a scripting language and enable achievements coders to write tests using it. With an interface to read values from emulated memory Lua programs can do anything, from chasing pointers to scanning the emulated memory for the necessary values.

Some other options were considered, including developing an in-house scripting language, but after some consideration it was clear that Lua would bring many benefits over the alternatives, like small size, great speed, easy to embed into another application, rich documentation, and continued maintenance.

However, some platforms supported by RetroArch may not be able to run Lua, either because there's not enough CPU or RAM available, or because the increase in the executable size will exceed the space available on these platforms. The libretro team will be working on this, and disabling Lua achievements on a per-platform basis depending on the results.

While this may sound like a drawback, we're confident that most if not all platforms that currently support achievements will be able to run Lua code. The few, if any, that aren't able to run Lua code, are likely not powerful enough to run emulate the systems where Lua is necessary to write achievements anyway.

Note that other changes are still necessary before Lua achievements become a reality. Including support now allows us to validate tolerance on those platforms where there are concerns.

rcheevos

rc_client

Integration guide

client

user

game

processing

rc_client_raintegration

Integration guide

rc_runtime

rhash

rapi

common

user

runtime

info

Clone this wiki locally