VXAce Things that worked suddenly don't

I feel just about ready to give up, with the game about 90% done. Little things started not working - a light event that works on five maps doesn't work on three others. A save game file that doesn't show up to be loaded, but can't be deleted. Enemies that are set to appear halfway, and didn't have time to appear in battle, appear after it's done and the battle has no end. Formulas that used to be evaluated just fine suddenly can't be and crash the game. Has anyone experienced anything like this? I am far from an expert, but it seems like maybe something got corrupted along the way and now errors started cropping up. What can I do? Would starting a new project and copying assets and maps and databases help? It would take ages, but I am desperate :LZSteary:
When you say they started not working, what changed between the time things worked and now don't?
Did you install new scripts? Do you always make sure you start a new game instead of loading old savefiles after you've changed scripts?

A save game file that doesn't show up to be loaded, but can't be deleted.
What do you mean can't be deleted? If your savefile can't be loaded, it usually is because it was using a different set of scripts or database objects so the data is incompatible with your current project. You can always delete manually your savefiles.

Formulas that used to be evaluated just fine suddenly can't be and crash the game.
Which formulas? Only damage formulas? What errors are displayed? Either the formula changed mid-game (which is usually be very bad), or it was already invalid in its context.

Enemies that are set to appear halfway, and didn't have time to appear in battle, appear after it's done and the battle has no end.
That is probably a script issue, whichever script is messing with battles is probably not calling the events properly.



How consistent are your issues? Always the case for specific map/events/troops?
You should always keep multiple backups of your stable project builds. It’s one of the most important habits in game development. Projects can break for all kinds of reasons...even something as simple as a laptop going to sleep mid write can cause file issues. so having clean restore points is the safest long term failsafe.

Before assuming corruption, though, it’s worth doing a structured debug pass. Use F9 during playtesting to inspect your switches and variables midgame, and take notes on what’s behaving correctly and what isn’t. A lot of problems that look like corruption are actually logic issues, event states carrying over from old saves, or plugins not cleaning up properly.

True project corruption in RPG Maker usually means the project won’t load at all, or specific data files fail to parse. If you can still open the editor and run a playtest, then the underlying data is most likely intact. In those cases, debugging your events, plugins, and save files is usually more productive than immediately starting a full port.

Porting to a new project can help if all else fails, but it’s a last resort because of the time involved. I’d only go that route after confirming the issues aren’t coming from switches, variables, plugin order, or old save data.
@Timtrack

That's the thing, I really didn't change much between when things were fine and the sudden glitches. I'm now doing a playthrough to iron things out, making adjustments to enemies, adding a dialogue here and there, nothing major. No new scripts added (except your turn count addon).

The lighting issue happened some time ago, but I thought it was because I used an old save, so I started this playthrough and when I reached that point, it still wasn't working. It's an event which shows a picture that has a light circle around the player and the rest is darker, the picture moving with the player. In the later maps the picture doesn't move with the player, and this also happened when I transferred the player from there to the earlier map. I changed the picture number in the later maps (in the earlier ones it was show picture 1, in the later changed to show picture 2, everything else being the same) and that solved it, but I'm baffled as to why it was a problem (picture 1 always got erased when leaving the dark map).

The save file was a normal save I made, but later it wasn't visible in the loading/saving screen, but was in the Saves directory. When I tried deleting it from the Saves, it said it can't be deleted because it's not there any more. I ended up copying everything except Saves somewhere else and worked on from there.

The formula was in the note window, through Hime's Formula Effects script, and it was supposed to put the actor's ID in a variable. This worked just fine before (and does in a previous backup), but suddenly it can't be evaluated.

About the halfway appear enemies, I thought, too, that it was a script problem (NeonBlack's Victory screen, which has given me some grief before). I tried Yanfly's Victory Aftermath and the same thing happened; however, I did it from an old save, so that might be it (I was frustrated and wasn't thinking straight). I should try from a new one. This issue did not happen always, though, I had a run of 15 battles ending correctly and the 16th got stuck when the enemies appeared. And there's another battle with halfway enemies, which didn't have this issue at all (albeit that one wasn't tested so many times).


@Ludovinsky

That's really good general advice. I mostly do what you suggest.

I do have tons of backups, but it's hard to say which one is the last one without these issues. I was making many small adjustments to many events during this last playthrough and I'm not sure if trying to find all of them wouldn't be more time consuming than just copying everything.

As I said above, there weren't any major changes done to the project. When the problem is with an event, I do check whether the associated switches and variables are what they should be (like with the light event, which should update player's position through variables and move the picture accordingly - the variables were getting updated, but the picture wasn't moving).


I think I'll take a couple of days to cool off and then try again that battle issue with Yanfly's script and a fresh save. But if new weird crashes appear, it's good to know that putting it all in a new project might help. Making this game has been a bright spot in this effed up world and I don't want to lose that.
As you said I'm far from an expert so take these with a grain of salt...
picture 1 always got erased when leaving the dark map
There is a script for fixing a bug about pictures that don't dispose properly, does the issue only popup far into the save game or closer to the start? Picture Bug Fix by Mithran < likely irrelevant but goes to show the engine isn't perfect.
The save file was a normal save I made, but later it wasn't visible in the loading/saving screen, but was in the Saves directory. When I tried deleting it from the Saves, it said it can't be deleted because it's not there any more.
Is it possible you already deleted the save file, so that it didn't show up ingame. I've had instances where on my PC I delete something but during the process the display doesn't quite update properly, so it was deleted but its still there visually and can't be deleted again since its no longer there. Simply refreshing usually fixes that though so probably not this.
and it was supposed to put the actor's ID in a variable.
Simply printing the variable then the actor ID then the variable again after running your code usually points out whats going wrong here.
The save file was a normal save I made, but later it wasn't visible in the loading/saving screen, but was in the Saves directory. When I tried deleting it from the Saves, it said it can't be deleted because it's not there any more. I ended up copying everything except Saves somewhere else and worked on from there.

That sounds an awful lot like what Zahawk already mentioned, but I'd add something else there. Run chkdisk to fix any possible errors that might have caused it not to flag that missing file as zeros (free space).
@Zahawk

The picture thing happens in later saves, so maybe it is that. I'll try the fix you linked, thanks.

To be honest, I don't remember any more what exactly happened with the save - either it disappeared from the loading screen without me deleting it, or it couldn't be loaded and I did delete it manually. I only noticed that it's still there when I wanted to move the saves somewhere else temporarily when I was making a new build for my partner to test and that file couldn't be moved (or deleted). This is the message it gives me when I try to delete it:

broken save.jpg



The crash with the variable gave me an error message saying Hime's script couldn't evaluate actor_ID (which it had no problems evaluating before). If it happens again, I'll try what you suggest.


@kyonides

Incidentally, I ran chkdsk yesterday because my system is doing weird things too (but I guess Windows and weird go hand in hand, especially after updates), but it claimed everything is fine.


Thank you both for your input, I really appreciate it.
The crash with the variable gave me an error message saying Hime's script couldn't evaluate actor_ID (which it had no problems evaluating before). If it happens again, I'll try what you suggest.
Just in case, can you provide the exact formula you were trying to evaluate and in which context?
I ask because by default, actor_ID does not exists. (ref to Hime's formula effect here if anyone wants to see how it works) So unless you have another script adding this (you can check this by doing CTRL+SHIFT+F in the script editor), then the command will fail.

Note that damage formula do not crash even with invalid commands because the default code will prevent errors and return 0.

If you want to get the actor id and store it into a variable, you should do in Hime's formula:
Code:
v[1] = a.id if a.actor?
or
Code:
v[1] = b.id if b.actor?

Additionally, since Hime's script creates an object before all scripts are loaded (a Game_Interpreter here), I suggest you put the script as low as possible in your load order (and above main) to ensure compatibility with scripts modifying the interpreter (I don't believe this will fix your formula issue though).

About the halfway appear enemies, I thought, too, that it was a script problem (NeonBlack's Victory screen, which has given me some grief before). I tried Yanfly's Victory Aftermath and the same thing happened; however, I did it from an old save, so that might be it (I was frustrated and wasn't thinking straight). I should try from a new one. This issue did not happen always, though, I had a run of 15 battles ending correctly and the 16th got stuck when the enemies appeared. And there's another battle with halfway enemies, which didn't have this issue at all (albeit that one wasn't tested so many times).
If your problem persists even on a new save, then this might be other scripts dealing with battle effects/events that create this issue (or a setup not made correctly), the aftermath window is supposed to display after the end of battle was initiated, if some events are still called after, then another script might be the reason behind this.
The formula used is v[1]=b.actor_id (it's an enemy skill and I need the variable in a troop event). I'm not sure where I found that (and why I didn't use b.id), but I never had a crash because of it before. I might replace it with what you wrote, if you think it's not proper. The script is quite high in my script order, so I can move it lower.

I also use Hime's Post battle events, which can conflict with victory screen scripts, but she provides a fix which I used. Also, I had a post battle event in the problematic battle, but removed it, and it still didn't end and instead the enemies appeared. Some time ago I had a problem with actor actions still happening below the victory screen and then the battle not ending. Roninator2 helped me with that and it seemed to be working fine.

I'm making a list of things I'll try when I muster up the courage to work on the game again. Right now I'm traumatised by all those issues showing up one after another in a short span of time :LZSteary: I really hope I won't have to make a new project.

I'll let you all know the results.
The formula used is v[1]=b.actor_id (it's an enemy skill and I need the variable in a troop event). I'm not sure where I found that (and why I didn't use b.id), but I never had a crash because of it before. I might replace it with what you wrote, if you think it's not proper. The script is quite high in my script order, so I can move it lower.
b.actor_id is not valid without a script adding this property, maybe you've removed the script that allowed you to use this line? In any case, b.id will work in vanilla rpg maker as long as b is an actor

I'm making a list of things I'll try when I muster up the courage to work on the game again. Right now I'm traumatised by all those issues showing up one after another in a short span of time :LZSteary: I really hope I won't have to make a new project.
It's okay, I'm sure it can be fixed, take your time ~
Once you've rested, you can try to analyse when your issues arise and ask for help on them.
You can also send your Scripts.rvdata2 for people to check your scripts and their order. A demo might also help for some specific problems once you've identified them.
Well, I calmed down and tried to look at the issues again without the mindset that something fundamental is wrong. I haven't tried the picture fix yet, but looked at the halfway appearing enemies problem. What I found out:

- trying the battles from a new game with Yanfly's Victory Aftermath - same problem: enemies that didn't have a chance to appear, appear after the battle should be done, and if they're defeated, the victory screen (including adding EXP/Gold/drops) appears several times (NeonBlack's victory screen didn't appear at that point at all);

- trying the battles from a new game without any victory screen script - same thing as with Yanfly's, including the multiple victory messages when you beat the re-appeared enemies.

Which leads me to the conclusion that the culprit might be Yami Battle Symphony engine. (Or RPG Maker itself? Probably not.) Or maybe Hime's Post Battle Events? I don't think I have anything else that would mess up battles. I made an unsophisticated fix for this issue - instead of appearing halfway, I made those enemies that should be "summoned" dead before the battle starts and then the summoning enemy revives them instead. It had its own challenges, but it seems to be working for now (tried 40 battles so far). If anyone has ideas about what can be happening about the halfway appearing, I'd be happy to hear them.

I replaced b.actor_id with just b.id (and the crash didn't occur again), but left b.enemy_id, which doesn't seem to be problematic.

I want to thank everyone who replied to me, it really helped me to pull myself together and look for solutions. When (or, hopefully, if) I run into any new issues, I'll make a separate post, but if anyone would like to add anything here, please do.

Original thread: https://forums.rpgmakerweb.com/threads/things-that-worked-suddenly-dont.182093/