Sony have been releasing PS2 games on the PS4 store that are not HD remakes. They are simply ports with no changes made to the game at all. With nothing being changed to the source material, it begs the question of how can trophies be added to PS2 games? It doesn’t actually appear to be that complicated, its just a clever idea.
There are a few different ways in which this can be done, but based on what we have learned from the trophies in the GTA games, we can see that the save file appears to be how trophies are unlocked within a game. If you look at the trophy lists for the games, you will notice that all of the trophies in games are based on in game stats. With GTA Vice City, people quickly discovered that it was possible to use cheats and it would not prevent trophies from unlocking. With San Andreas, using cheats would block trophies from unlocking. If you look at the stats screen in game you will notice that San Andreas tracks how many cheats a user has used. This means the trophy system is able to check the game stats to make sure a user has not used any cheats.
If you think about it, it makes a lot of sense. Each PS2 game will have 2 main data sources, the game itself and the game save. It seems like a much easier task to tear apart and modify the game save rather than do the same for the entire game. If some sort of system was put in place that could load the save into memory and when the game wrote a game stat, it would be written to memory where the trophy system could analyze it, to determine if trophies should be unlocked or blocked.
In terms of how they insert the trophy system into the game, they likely don’t. From a software standpoint, it will make a lot more sense to put the game inside of the trophy system. To be more precise there is likely a game object within the PS4 SDK. This object includes the trophy list, PSN integration (such as “currently playing …”) and then the game itself. There are likely more items within this game object. For the PS2 games they can build this PS4 game object and then put the game inside this object. The trophy system will communicate with the game save and determine whether a trophy should be unlocked.
This is of course a theory as I do not own an SDK, but from a development perspective this is a logical way to allow for this sort of functionality. Having the trophy system as part of the game would be awkward. It makes far more sense for it to be part of the operating system and run independently.
With this method of implementing the trophy system in mind, it would then bring up the question on whether this same functionality could also be setup to work for PS1 games and any other games that did not have trophies. The answer would be yes, but with PS1 games, Sony seem to have worked out a method to emulate these. Considering the huge amount of power that consoles have compared to what the PS1 had it cant wouldn’t need to be an efficient emulator to make PS1 games work on modern consoles and as a result, unlikely that we will ever see anything like trophies added to PS1 classics.