After using Horst Onager's achievement system in my current game, I decided to work on my own system that solves what were, to me, some shortcomings in their system. I've also looked at the other achievement systems that are available, but none of them seemed to be quite right.
The idea I came up with is to make a modular system, in the vein of the OrangeHUD – rather than a single plugin, it's a family of plugins where the arrangement in the plugin manager is part of the configuration.
Now, some people might leap in and say "But OrangeHUD predates the updated plugin manager that allows easily embedding complex data into a single plugin parameter! Why would you go back to that paradigm?"
Well… the thing is, one of the things I value is clarity of diffs. In other words, I want to be able to compare two versions of my game in source control and easily see what changed between them. But no matter how complex the structure you stuff into a plugin parameter, the plugin manager collapses it down to a single string. Even if I format plugins.js with a JSON formatter, that parameter fits on a single line – hundreds of achievements, all squashed into one line. And while the game loads the file as code, it appears that the editor loads it as JSON after discarding the first few lines, so it's not possible to format the contents of the plugin parameters. That's extremely bad for diff clarity. Thus, splitting the configuration across several plugins and multiple parameters helps to solve that.
Another shortcoming I had to solve was that, in many cases, the progress value for an achievement is directly based on something else. For example, "get one of every item" means that the progress value is equivalent to
-----
With the preamble over, here's the concept I have so far. I'll probably create at least 6 plugins in the set, possibly more.
Is there anything in particular that people might like to see? I don't plan to support rewards for achievements, but I might be convinced otherwise if it's popular enough. I do plan to support both MV and MZ.
Once I have some code that's tested and working, including a prototype of the last two on the above list, I'll likely share it for others to try out.
The idea I came up with is to make a modular system, in the vein of the OrangeHUD – rather than a single plugin, it's a family of plugins where the arrangement in the plugin manager is part of the configuration.
Now, some people might leap in and say "But OrangeHUD predates the updated plugin manager that allows easily embedding complex data into a single plugin parameter! Why would you go back to that paradigm?"
Well… the thing is, one of the things I value is clarity of diffs. In other words, I want to be able to compare two versions of my game in source control and easily see what changed between them. But no matter how complex the structure you stuff into a plugin parameter, the plugin manager collapses it down to a single string. Even if I format plugins.js with a JSON formatter, that parameter fits on a single line – hundreds of achievements, all squashed into one line. And while the game loads the file as code, it appears that the editor loads it as JSON after discarding the first few lines, so it's not possible to format the contents of the plugin parameters. That's extremely bad for diff clarity. Thus, splitting the configuration across several plugins and multiple parameters helps to solve that.
Another shortcoming I had to solve was that, in many cases, the progress value for an achievement is directly based on something else. For example, "get one of every item" means that the progress value is equivalent to
$dataItems.length. So, it would be preferable to just put that code in as the progress value, rather than putting in a number that will become outdated the moment you add another item.-----
With the preamble over, here's the concept I have so far. I'll probably create at least 6 plugins in the set, possibly more.
- SFG_AchievementSystem – the core system, essentially a "base" plugin in the vein of Yanfly's XYZCore. This is already sketched out in code, though I haven't tested it yet.
- SFG_AchievementCategory – defines one category of achievements in the system. A category might contain, say, ten to twelve achievements. The expectation would be to place multiple instances of this plugin in the plugin manager, one for each category. This is already sketched out in code, though I haven't tested it yet.
- SFG_CommonAchievements – defines one category of achievements in the system. Unlike the above plugin, which will assume achievements need to be explicitly marked as completed by a plugin command, this one will encode the actual condition for the achievement directly into the plugin manager. In other words, the achievement definition is self-sufficient. For example, with this you could create an achievement that requires you to collect 30 potions, without any coding. I haven't quite worked out the details for this though.
- SFG_SecretTracker – defines a category containing achievements that represent the act of gathering all "secrets" in an "area". I haven't fully sketched this out yet, but I have a working prototype of it in my upcoming game.
- SFG_AchievementScene – defines a scene to examine your achievement progress; supports adding it to the main menu, the title menu, or both.
- SFG_AchievementNotify – defines windows that will pop up to notify you when you unlock an achievement.
Is there anything in particular that people might like to see? I don't plan to support rewards for achievements, but I might be convinced otherwise if it's popular enough. I do plan to support both MV and MZ.
Once I have some code that's tested and working, including a prototype of the last two on the above list, I'll likely share it for others to try out.