Game "lag" as file playtime increases.

@Shaz : Correct. And has anyone tested that? That's why I propose a test to find out, as few actually make and finish 20+ hour games.

@Fernyfer775 : I'm not sure if this is related as mine occurred in ACE but I notice it happens more often walking left/right than walking up/down. If so it could be something in the map update code. Worth a shot anyways, as that's where I'm looking in ACE right now. Though for me it is only a jump from 60 FPS to 56 FPS, and it is quick. But it still causes a small, but noticeable stutter, and it occurs on my save file at 19 hours, 30 minutes and never on my save file of 2 hours, 30 minutes.
@bgillisp - I will do a test overnight for the next few nights and see if I notice any FPS changes on a fresh project with no plugins.

As for the FPS dips, for me, on a new game, it's a solid 60 FPS, even on my biggest maps with all sorts of doodads, events, parallax, and weather effects, but at around the 15-20 hour of playtime mark, it dips to about 44-55 and just swings wildly between that range. The dips only happen when moving, but from the 5 maps I just tested, it happens in any direction I'm going and the map size doesn't make a difference.

EDIT: My tests were done on both test-play and deployed files (as I've read that test-play can sometimes cause lag, whereas a deployed game won't).
Ok, good. One other thing to keep in mind based on what @Shaz pointed out about high end switches too...the maps I notice it on do reference a switch > 900 for an event trigger. So it could be both of them interacting? Anyways, I'll try moving those switches to a new map that is just for those events (as they are for end game cutscenes) and see if that helps too. If it does, it might be worth investigating for your game as well.

And if there is no FPS drop on your project with no plug-ins, I suspect the guilty party will be the yanfly plug-ins, as that is about all else we have in common (yanfly scripts vs yangly plug-ins), and I've noticed many of their common plug-ins use the same code as they did in ACE, just changed to JavaScript.
From all that is said here, it is a memory leak - but one that is saved.

Basically a memory leak happens if a function creates a new data segment (allocating memory to it) but doesn't free that memory if it no longer needs it.
Most of the time memory leaks are only temporary - but that is only because the allocated data is not saved and gets lost on game end.

However if that data is saved into the savefile despite no longer being used and then loaded again on continuing, then this happens.
I did not read much but:
OLD SAFE FILES cause trouble! In VX-Ace they did, isnt that the case in MV anymore?
20Hours of Gametesting? That sounds like he is using the same safe file for month, maybe new plugins, new variables or item limits got added since than??? (Please tell us)
You maybe have to play your game again, and see if after hours of playing this happens again.
How large is the save filesize? That's a dead give away if your savefile is large and the data being written and read is large this could easily cause memory problems. Usually this is noticeable when saving and when loading a save file in game and it takes a few seconds to perform those actions. Could be many things but sounds like a lot of data is being saved to the save file and being loaded back into the game causing a large amount of memory to be used.
The lag has been seen on multiple people streaming the game. It tends to happen to them all at around the 15+ hour range where you'll start to notice a stutter in the FPS.

As for save file sizes, they're about 200kb (about the size of an average medium sized sideview battler image sheet) or so on my newest playthroughs, which I did to test the issue. I really played through the game from start to finish, and as usual, it was around the 15 hours of playtime mark that i began to notice the laggy bits.

I'm not playing for 15 hours straight either, it's in increments, and it doesn't matter how long I've played in one sitting, it's tied to how long I've played that save file altogether that seems to impact performance.

I'm doing some tests on a fresh project and also digging around other plugins to see if there are any possible plugins that might be bloating up some variables in the background that I don't know about, as Shaz suggested.
I'm not sure you understood what I was saying. When you say "bloating up variables", are you referring to putting large values in them? You've mentioned this a number of times in this thread, and I do not believe that is the cause at all. That is not what I suggested.

I suggested plugins might be adding their own $gameXYZ global variable, or might be adding new properties to the existing $gameSomething variables which would increase your file size. That is one possibility of many. Plugins MAY be doing something that requires extra processing each frame, without adding any new variables at all.

I gave my own multi timer plugin as an example, saying the more timers you were keeping track of at once, the more likely it is to affect performance as they are all decreased and checked each frame.

At this stage, I don't think you can point the finger at any one thing and say "it's variable bloating" or "it's plugin processing" or "it's accessing the playtime variable" and look for every instance of that thing happening. You don't have any evidence that it's likely to be one thing or another. All you can do for now is test and rule out possibilities, to narrow down the list.
As for save file sizes, they're about 200kb

That's pretty huge, compare that to a save file on a blank project (8kb).
That's not a guarantee that it's the issue, but it's a possibility.

At this stage, I don't think you can point the finger at any one thing and say "it's variable bloating" or "it's plugin processing" or "it's accessing the playtime variable" and look for every instance of that thing happening. You don't have any evidence that it's likely to be one thing or another. All you can do for now is test and rule out possibilities, to narrow down the list.

100% agree. OP needs to run a proper performance profile and memory analysis, the Chrome DevTools are built-in and can do all these things.
Open dev tools (f8, performance tab and let it run for a bit. After a couple of minutes turn it off and let it draw the data. It will show function calls and execution times. Might show which function is bloazing your main thread.
Thank you for everyone that helped. It must have been a culmination of things I tweaked here and there that I can't pinpoint, but I did a brand new play-through of my game, from start to finish, letting the playtime reach 25 hours, and there was no lag this time around. The game had a pretty steady 60 fps the whole way through.

Wish I could pinpoint what exactly I did to fix the problem (since I tweaked a handful of things here and there while playing the guessing game), but either way, the lag is gone, so I'm happy. 🙂)

@bgillisp - As for the play-time test on a fresh project, I let it run for 30 hours and no FPS issues occurred.
@Fernyfer775 : Glad you got yours fixed. I found the fix for mine in ACE, and believe it or not...it was the step counter. I had the engine stop adding one to it every time I took a step and map scrolling became perfectly smooth again, with very occasional dips to 59 FPS if an animation tile was updating.And I just tested it on the same save game that was showing this issue at high play time, gone now that I made that one line coding change.

So oddly enough it wasn't a memory leak like everyone insisted (which made no sense to me as I had nothing that could be saved that way, otherwise every single person who uses Yanfly Save engine should have reported this issue by now), but it WAS a value which was getting too big during the course of a long game. In this case, it was the step counter. Which, honestly I don't use that anyways so commenting it out works well for me.

Anyways, I mention this as you may wish to see if the same thing matters in MV, since your project is in MV.
@bgillisp - Huh...you know, that's one thing I DIDN'T test! I zoomed from point A to B and didn't actually do a lot of stepping to get to the end of the game. I will have to do some tests on step counting to see if that's the culprit! I too use a step counter for a trophy plugin, so that might end up causing some issues. Thanks for the tip!
@Fernyfer775 : It'll take a lot of walking, as my save that showed it the most had more than 80,000 steps when I checked it with a variable. It seemed to me that it got really bad when it was over 65K, almost as if the engine had trouble when it had to be treated as a 32 bit variable due to the number exceeding 16 bits.
JavaScript numbers can go up to 2^53 so have fun!
It'll be easier to just change the step counter variable in the console than actually take a bunch of steps
I doubt it's the step counter in my game though, as from the trophy needing 50k steps previously was only reach by those who PURPOSELY ran around for a good long while before I knocked it down to only needing 20k steps to get.

@Aloe Guvner -- I was actually poking around some of the plugins, I assume the object I'm looking for is something like "$game.Party().steps" or something along those lines?
$gameParty._steps = 80000
in the console
Alright, so using SRD's Hudmaker, I made a gauge to track steps in my test room. At sub 100 steps, the game ran at 60 FPS, as expected. I then added increments of 100k steps to see if there would be any noticable changes, and even after getting the steps to 700k+ WITH the step counter plugin on, the FPS remained a steady 60 FPS, so that's out.

Spoiler
ZERO STEPS
zerosteps.png
700k STEPS - still at 60 fps (forgot to screen cap the fps meter lol)
700ksteps.png
Probably has more to do with how javascript saved the variable. Or maybe I just had something that didn't play nice with that counter at high levels (though no idea what). Either way, at least you eliminated that.

Original thread: https://forums.rpgmakerweb.com/threads/game-lag-as-file-playtime-increases.104367/