MV/MZ Building yet another achievement system

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 $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.
I know that SMO_Achievement is nice, but I wonder what you can improve
in yours.

while SMO is only for MV with ingame achievement editor to make, use image
to create your own look.

so I really wonder what else could be improved.

the HO achievement system does have a stacking that can increase which is unique
that isn't seen really often.

but if you make 6 plugins to use together, I wonder why you don't add it as
a single plugin for its all?
Now that my game is released, I plan to devote about maybe half a day a week to this (starting on Monday), so I'll keep posting progress. There's nothing to show yet, though.

but if you make 6 plugins to use together, I wonder why you don't add it as
a single plugin for its all?
I believe I mostly explained that though – the intent is to keep the achievements a bit more organized rather than dumping them all into one giant list.

I've mentioned that I value "clarity of diffs", so I can easily see what changed in a given commit (I use version control software for my game development). I've already rigged things up so that the plugins.js is reformatted so that every parameter is on its own line; but when that parameter is a list of 500 achievements, the line gets so long that you can't really see what actually changed in it. By splitting things up into multiple plugins, we instead have, say, 5 lists of 100 achievements (5 instances of the AchievementCategory plugin), or 10 lists of 50 achievements (10 instances of the plugin), making it easier to see what has changed.

OrangeHud used a similar system to allow the user to customize their HUD however they wanted, by adding multiple instances of plugins such as OrangeHudLine, each with different parameters. Although that predated the improved plugin manager, I believe the approach still has some value.

I'll also point out that some of the plugins might be usable independent from the achievement system. For example, the secret tracker could probably be hooked up to a different UI and used without having achievements. I haven't worked out the details yet, but perhaps the notify plugin could also be usable without achievements (making it a general "popup" plugin rather than just achievement unlocked notification).

Original thread: https://forums.rpgmakerweb.com/threads/building-yet-another-achievement-system.183405/