Looking to learn about plugin design/architecture

Hi there. I'm completely new to RPG Maker, and I'm trying to learn more about customizing game behavior beyond what the UI lets me do. I've already checked out Archeia's plugin creation tutorial, but I'm looking for something a bit higher level.

I know programming well enough, but not *game* programming specifically, and I'd find it really useful if there were resources that break down the design and architecture of some of the existing code and writing plugins.

For example, I'm looking to play around with customizing the battle system, so I'm looking at how the Scene_Battle class invokes the BattleManager class which itself coordinates updates of $gameParty and $gameTroop, and attempting to trace the logic flow is getting complex. Are there any resources that break down and explain how these are structured? Or ones designed to help someone understand how to extend or implement new battle mechanics?

I suppose I can buy plugins that overhaul the battle system and study those alongside the built-in code, but it would certainly make this easier on me if there were resources more friendly than just reading a bunch of raw code and taking notes!

I've moved this thread to Learning Javascript. Thank you.


I don't know of any specific tutorials about the code structure for MV/MZ (and to be honest, it's also very similar to the VXA code). I personally just learned it by following some old VX coding tutorials on youtube back in the days, but I never looked for a modern MV/MZ equivalent. It's unfortunate that the documentation is so lacking for RPG Maker.

Looking at third party plugins is a popular way people that already know to code learn the engine's structure. There are plenty of free to use plugins, so you don't need to pay to buy some plugins. You can look in the Plugin section of this forum and scroll through the multiple pages and download plugins you're interested in.

Just my two cents, but if you're going to highly modify the game's systems (like heroes, parameters, how skill works, etc.), coding a battle system from scratch is also an option. In fact that's what I always do, I find it faster and less tedious than trying to modify existing code.

There are probably some tutorials out there though, and I'm sure other members of the community can point you toward those.

Also, welcome to the RPG Maker community!
Thanks! Coding my own battle system is definitely something I'm going to want to do at some point here, I'm just at a bit of a loss for now on how to make it integrate with the rest of the game systems, to hook into the event loop, that sort of thing.

If there are any tutorials out there that touch on these things (or even particularly well commented/documented plugins) I'd certainly appreciate the links from anyone who knows of them.
@Trihan has a thread called Jump Into JavaScript that goes through the default engine files, describing the functions and their flow a bit:

My understanding is it's not quite complete, but it might be kind of what you're looking for? It's also referencing the MV files, but the majority of the code is the same.

Otherwise, my honest suggestion is to just read the code. Find a part you're looking for and do searches to follow the function calls to see where they go/come from.

And if you have a more specific question, let us know.
I'm going to do the next instalment of that when I get home, I think.

Original thread: https://forums.rpgmakerweb.com/threads/looking-to-learn-about-plugin-design-architecture.157367/