Refresh Plugins in Active Save File

Hi, I'm working on developing a game and frequently tinker with the plugins. Maybe I'm just missing something obvious, but something I've struggled with is that when I make changes to certain plugins or add new ones, the changes or additions don't take effect unless I start a new game.

The problem is that I will have a test game that might be a few hours in, then I end up having to start over. Kind of stunts my game's development since it gets hard for me to get too far in before some kind of tweak means I need to scrap all of my prior progress on my test game.

Is there any way to get my Plug-ins to "refresh" into a live save with updates? If there isn't, how do people deal with this?
Hmm. What I do is save the game, close out of RPG Maker, and reopen it and the changes save perfectly fine,
Tried that, and doesn't work. What is interesting is that if I do a Test Battle, it will work. But, if I re-load the save with the old plugin settings, it goes back to the old (bad) way of doing things.
when you make changes, existed savefiles doesn't work, even if you add new ones to it.
if you developt a game and make changes to the plugin, it kinda force t ostart a new game,
if only maps are changed or added, you can event a way to update the savefile.

otherwise, it doesn't work.
when you make changes, existed savefiles doesn't work, even if you add new ones to it.
if you developt a game and make changes to the plugin, it kinda force t ostart a new game,
if only maps are changed or added, you can event a way to update the savefile.

otherwise, it doesn't work.

I was afraid that was the answer. So, as a practical matter, what do people do in this situation? Just create an event with a ton of switch and variable updates, level up their characters, give equipment and gold? That sounds like a LOT of work.
it depends how the game is developted, if you make for exsamples maps
(even if they are empty) you can block the path to those maps, when there is a story,
the old savefile might still work, if the items already exist as well, but if you add 1 new item
that is needed for that map, the old savefile doesn't work.

it might work, but if they obtain the item, the game crash.
so you need to know how to develop it, but a new game is always saver as well,
unless you know exacly what you are doing.

but changing plugins mostly require new game, there is nothing we can do really D:
first of, for balancing you'll have to start from scratch a dozen times - so get comfortable with new game early ;-)

OK, funny comments aside - that is exactly why everyone with some experience tells you to get your game mechanics and plugins finished early in development, because there is no way around this problem.

If a plugin needs to store its data, it has no choice but to add them into the savefile - and that makes the current savefile incompatible to older savefiles. And about 80% of all plugins (and that is 100% of the more complex plugins) need to save their new data, only very simple plugins don't need data.

An the same goes into the other direction - loading a savefile that is older than the currently added plugin means that the plugin is now missing data. Playing on will result in the "undefined" or "is not a function" erros as soon as that data is needed.

And no, there is no way around that. Theoretically a plugin writer could add a complex test to check for missing data and compensate that, but absolutely no plugin writer I know of does this - for a lot of them that is simply beyond their knowledge to do, and even if they know how to do that it will be a lot of work for almost nothing as most people are already working around this problem by only changing plugins early in development.

EDIT:
what some people do is to add a cheat item early in the game that let's them skip to current work areas when starting a new game. There is noway to do balancing work that way, but you can test. And that is how those "cheat codes" end up in professional games - because even those companies have no choice but to work that way.
I was afraid that was the answer. Ok, so sounds like that's just how this goes. Well, definitely appreciate it and thanks.
@EastsideTrouble I added an edit above while you were posting, that might help
Thanks. I did something like that. An in-game lever that is pulled in game that turns on a ton of switches, gives variables, awards experience, gold, etc. It's a hell of a lot of work though.
It's a hell of a lot of work though.
That is not exactly what I meant.
Most don't try to replicate anything of a regular playthrough - that is why I said that you can't do balancing work that way.

Most people make it a combination of powerup and teleport to selective maps they want to test, ignoring any other works or previous quests.
Usually it's a chest containing an item, and that item calls a common event with a show choices to either power up the player (like +10 levels each time selected) and teleport to selected maps (or a general cheat map with teleports to most other maps).

That way you have everything at the player no matter where you are (instead of a lever on a map that you might have trouble getting back to) and can jump through the maps without playing - unless you want to test a quest.
If you really need dozens of switches turned to just play in a later map, then something is very strange with your game mechanics and developing principles.
There's a couple of different things that can be done in this situation. None of them are what you're looking for, but this is all you have, I'm afraid.

  1. Stop test playing your game until you've decided on all plugins that you will be using.
  2. Stop adding more plugins mid-way through development.
  3. Create a 'debug room' or something similar that allows a test player to quickly jump to specific parts of the game that need testing, including level gains, thrown switches, changed variables, changed equipment, party member adds, etc.
Unfortunately, most plugins rely on aliasing information on creation to objects like battlers or items when the database is initialized. When a save file is saved, those objects are snapshotted in their current form. When the game is loaded up after installing a new plugin, those values are properly added to the objects they expect, but then the save file is loaded and those values are reverted to a state prior to when the plugin was installed.

Example: If I have a plugin that adds a friendship value to all actors, when the database is initialized, I define Game_Actor.prototype.actorFriendShip and then assign default values to it for each actor in the database. When the plugin later calls a function to read these values, they exist, and are returned properly. If I then load a save file that was saved before the plugin was added, those values haven't been initialized yet, so when the plugin makes an attempt to read values that should definitely exist, it fails, and causes a crash error, or other unexpected results.

Technically, some plugins might be capable of detecting that this has occurred, and re-initialize the default values instead of crashing, and additionally, plugins that don't do this automatically might be able to be patched to do so.

But patching every plugin in this way is time consuming, and possibly costly. And the lower cost, easier alternative is to just not do that.

I don't want to come off as being preachy about this, but before beginning development you should have a pretty good idea what plugins you will use. Adding more in the middle of development should be a rare occurrence, and therefore it shouldn't be as much of a setback as programming failsafes to make older save games work during development.
I totally agree with everything @ramza said.

One more option you might have is to note what new plugins you have added, then add an event to your map (or a common event) that will call a script command to do the initialization that the plugin would have done on starting a new game. Load your saved game, trigger this event, save your game.

However, what that script command needs to be will likely be different for each plugin, so it's really only an option if you can understand javascript.

I noticed you said they work when you do battle test. Many plugins will not (especially battle plugins) because they load their additional data when a new game is started, and a battle test does not start a new game in the same way (it uses different functions to load the database).
There's a couple of different things that can be done in this situation. None of them are what you're looking for, but this is all you have, I'm afraid.

  1. Stop test playing your game until you've decided on all plugins that you will be using.
  2. Stop adding more plugins mid-way through development.
  3. Create a 'debug room' or something similar that allows a test player to quickly jump to specific parts of the game that need testing, including level gains, thrown switches, changed variables, changed equipment, party member adds, etc.
Unfortunately, most plugins rely on aliasing information on creation to objects like battlers or items when the database is initialized. When a save file is saved, those objects are snapshotted in their current form. When the game is loaded up after installing a new plugin, those values are properly added to the objects they expect, but then the save file is loaded and those values are reverted to a state prior to when the plugin was installed.

Example: If I have a plugin that adds a friendship value to all actors, when the database is initialized, I define Game_Actor.prototype.actorFriendShip and then assign default values to it for each actor in the database. When the plugin later calls a function to read these values, they exist, and are returned properly. If I then load a save file that was saved before the plugin was added, those values haven't been initialized yet, so when the plugin makes an attempt to read values that should definitely exist, it fails, and causes a crash error, or other unexpected results.

Technically, some plugins might be capable of detecting that this has occurred, and re-initialize the default values instead of crashing, and additionally, plugins that don't do this automatically might be able to be patched to do so.

But patching every plugin in this way is time consuming, and possibly costly. And the lower cost, easier alternative is to just not do that.

I don't want to come off as being preachy about this, but before beginning development you should have a pretty good idea what plugins you will use. Adding more in the middle of development should be a rare occurrence, and therefore it shouldn't be as much of a setback as programming failsafes to make older save games work during development.

If that's what it is, that's what it is. Part of the issue is that I've been working on it for years on and off, and new things will come out and even though I didn't know it existed yesterday, then I have to have it (your dual wield plugin was responsible for one such restart and totally worth it!).

If that's how this works, that's fine. I'm kind of self taught, so just so long as there isn't some answer out there that more sophisticated people were using which I wasn't aware of. Thanks again! (And thanks for the dual wield plugin!)
The reason why this happens with certain plugins and not with others is because how the plugin works. If the coder needs to create a variable or object that is created when initializing the game (anything inside $gameActors, $gameParty, etc.), then those objects will only be created when you make a new game (because that's when actors are initialized). On the other hand, when an object isn't tied to a system that gets its data from savefiles (example: anything in the database) it gets 'updated' automatically because they never get saved; the game loads up their json files every time you start the game.

So unless you are a coder, there's nothing to be done. If you're a coder, you could check what variables aren't initialized and initialize them yourself. It's a hassle though, especially if you gotta go through another's coder's code.

@EastsideTrouble You started two threads about the same issue. I've merged your two threads together. Please avoid opening multiple different threads to address the same issue. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/refresh-plugins-in-active-save-file.120974/