weirdest lag issue you will see ever, need help fixing it

Seems like you have 5 or more scripts that "share" the method "start" in Scene_Battle, so i won't be surprise if one of them is using an overwrite and not alias.

Try look for "def start"(ctrl+shift+f) in those 5 scripts listed and check which one didn't alias it properly.

If any script is going to go crazy, it's because one culprit script modifies the important method everyone uses. >_<
scene interpreter def start http://puu.sh/kfMdS/f69ee835e5.png
MOG battle hud ex def start http://puu.sh/kfMfE/0932868bed.png
Implentation v1.4 def start (Theo TSBS) http://puu.sh/kfMjl/1368874b79.png
YEA enemy last selection fix def start http://puu.sh/kfMnD/af1611fcb5.png
 
Hmm.. All seems to be aliased properly.

Have you tried remove scene interpreter script? Since that script is listed twice in your gobj file.

If that's Tsukihime's scene interpreter script that allows common event to run in certain scenes, make sure you set that up correctly and check if the common events you are trying to run through that script isn't doing a bad loop.
already tested by disabling all the custom scripts that was causing stacks
Wait right there.. you mean you removed all scripts listed in gobj and STILL getting the lag? 😳
l removed
Script 0154 -- ▼Scene Interpreter, Line: 116:in `start'
Script 0185 -- YEA - Enemy Last Selection, Line: 31:in `start'
Script 0195 -- MOG_Battle_Hud_EX, Line: 1518:in `start'
Script 0124 -- ▼Killozapit - Cache Back, Line: 269:in `main'


l didnt removed

Script 0282 -- ▼Implementation v1.4, Line: 6147:in `start'

because l cant, it's the main script of my system
Ok.. off we go with the caveman foolproof debugging style. 😛

Make a new project, and add your scripts one by one, to that new project. Test play with every new script added and as soon as it lags, you know your culprit.

Edit:

If all scripts migrated fine to the new project, then it's probably your events. There's always a chance of bad loop in parallel processes that cause accumulative lags.
already did it twice, took me 1 month

the problem is every test takes over 10 mins to do and even then its not easy to see if theres lag

if the memory is getting higher and higher at every action there must be an easier way to see which script or event is doing all that

if it would be a parallel event, it would lag all the time, not only when a actor sequence is on
Well, you have learn today that those scripts you are suspecting isn't causing the lag.

So putting aside the ▼Implementation script(that's still black listed by gobj), there can be other scripts that causes the problem indirectly. Or like i said, events with parallel process can cause lags too.

You mentioned something like going into menu twice can "clear" the cache. Means there's a serious problem with one of your scene's terminate method that isn't doing its job.

Try a new project and migrate ONLY ▼Implementation script + your common events and maps. If the problem persist, try a new project with one script and nothing else. If that problem didn't go away.. well.. you know what to do. 😉

Make sure you test play long enough to get the problem to kick in, like you did today.
l wont do it, l rather kill myself then do that all over again

alright it's enough, $100 CAD for anyone that find the problem and removes any stacking
already did it twice, took me 1 month


the problem is every test takes over 10 mins to do and even then its not easy to see if theres lag


if the memory is getting higher and higher at every action there must be an easier way to see which script or event is doing all that


if it would be a parallel event, it would lag all the time, not only when a actor sequence is on
You can try using the FPS control to force the game to run at, say, 500 FPS to speed up testing.


You can create a new project with the same scripts and then upload that project. Or just upload your current project and send it to whoever is interested.


I can look at the issue and see if my command manager is really causing those problems.
Or simply add this to the top of your script editor

Graphics.frame_rate = 120Where 120 is the fps you wish it to run.
Mog has a memory dump script. I hope you've seen that since you have mog scripts.

https://atelierrgss.wordpress.com/memory-clear-purge/

Invoke the memory purge through script calls where ever needed. And test your game.

Also an easy way to see this is open up task manager and see if your game.exe is increasing in memory usage while you play.
If that "Scene Interpreter" script is Tsukihime's Scene Interpreter, I can say for sure that it has a memory leak, and that one causes the Message_Window leak.

I actually reported this on Tsuki's site a long time ago.

Putting this below that script solves the leaks from that script:

Spoiler
class Scene_Map def create_message_window @message_window = Window_Message.new unless @message_window && !@message_window.disposed? endendclass Scene_Battle def create_message_window @message_window = Window_Message.new unless @message_window && !@message_window.disposed? endend
Don't know if you get some other leaks from other scripts, but this one should be fixed at least.

Looking at your script list, you don't really read the notes on them, do you? 😀

Effectus should be at the TOP of all custom scripts.

That little snippet from Theo should be somewhere at the top too.

Also, you should NOT share Effectus like this, because that violates the ToS of that script, so take it out from your script list.
If that "Scene Interpreter" script is Tsukihime's Scene Interpreter, I can say for sure that it has a memory leak, and that one causes the Message_Window leak.

I actually reported this on Tsuki's site a long time ago.

Putting this below that script solves the leaks from that script:

Spoiler
class Scene_Map def create_message_window @message_window = Window_Message.new unless @message_window && !@message_window.disposed? endendclass Scene_Battle def create_message_window @message_window = Window_Message.new unless @message_window && !@message_window.disposed? endend
Don't know if you get some other leaks from other scripts, but this one should be fixed at least.

I may have had a lot of comments at that time and missed yours.

I see the problem with the script though: a message window is created when the scene starts, but then the map and battle scenes are creating their own message windows again replacing the existing references.

This is probably the cause of it, since the issue occurs after a lot of scene changes happen.
If that "Scene Interpreter" script is Tsukihime's Scene Interpreter, I can say for sure that it has a memory leak, and that one causes the Message_Window leak.

I actually reported this on Tsuki's site a long time ago.

Putting this below that script solves the leaks from that script:

Spoiler
class Scene_Map def create_message_window @message_window = Window_Message.new unless @message_window && !@message_window.disposed? endendclass Scene_Battle def create_message_window @message_window = Window_Message.new unless @message_window && !@message_window.disposed? endend
Spoiler
Don't know if you get some other leaks from other scripts, but this one should be fixed at least.

Looking at your script list, you don't really read the notes on them, do you? 😀

Effectus should be at the TOP of all custom scripts.

That little snippet from Theo should be somewhere at the top too.

Also, you should NOT share Effectus like this, because that violates the ToS of that script, so take it out from your script list.
l can read very well, effectus is a script beyond broken and l was even thinking about removing it completely since l already commented out 50% of it anyways

putting it above everything like fix scripts makes errors

oh and l dont care, l paid $20 for a script and then get ignored when l ask for support? nah, im not in anyway with their ToS anymore

Stapleton, theres not really a use of a memory dump script if it takes like 20 secs to clear it up at every script call. l would rather have a way to not have any memory leak at all.

i'm already doing that, otherwise l wouldnt have known it'd go up to 400k

on my way of making a demo that would show the lag instantly now

by copy pasting everything important for the demo, l get this error http://puu.sh/kglJg/ed8f8973c3.png

need a break, im going crazy
At least Tsukihime is given a chance to improve some of her scripts, so the discussion here is not all wasted. 😛

As for Fisherolol, the most i can think of, is your scene_battle isn't calling the terminate correctly when it switches back to scene_map. And parts of the battle script is running in the interpreter. Interpreter will not stop running when you switch scenes, esp some battle system calls a new set of interpreter to be run each time you enter a battle, so codes called in script calls and such kept running and stacking. Without a proper termination, the next time you enter the battle, the system is trying to do everything twice, and the next battle will makes a triple running of whatever is going in the battle script.

You mentioned about commenting a lot out in your main script. So i believe you have broken the termination method somewhere. Try check for either def terminate / def pre_terminate and see what's in there. For any scripts you have that uses class Scene_Battle, scroll down to the part where it shows def terminate/def pre_terminate and screenshot it. Post it here and i am sure the pro-eyes here will pick up what's wrong right away. 😉

Just in case you have scripts that modifies Scene_Base, screenshot the def terminate part and post them here in a separate set.

And to further ease out the debug process, do a global search (ctrl+shift+f) on Game_Interpreter.new and screen shot that search window result list.
http://puu.sh/kgssG/1b05072e12.png

http://puu.sh/kgsA3/af2f30fea0.png

only those 2 scripts have the terminate method with scene_battle

http://puu.sh/kgsBC/894093caa1.png

http://puu.sh/kgsCH/fbe6c051f7.png all those scripts modify scene base

http://puu.sh/kgsDE/a47a183e47.png Game_Inyerpreter.new

found something new, everytime an actor or enemy do a skill, the memory goes up but will never go back down.

with the same enemy using 3 differents abilities and my own 8 abilities, l can make the memory go up to 280k. the more information the sequence has, the more memory it gets
There's around 5 scripts using class Scene_Base from your list. Try snap shot the def terminate part in them.

And the top 2 script has nothing wrong with the terminate, have you tried looking for pre_terminate in them?

And judging from the interpreter call, 2 of your implementation script is calling for that. So i believe both is doing it in Scene_Battle class? It's weird that a script that control windows and graphic has no termination method. Something is missing there.

Edit:

The memory SHOULD go up after a few battle attack skills are released. Especially one with lots of animation files. And it should stay that way until the sprites are disposed. If they are not, disposed properly, that's your memory leak.
by searching class scene_base and then search def terminate in each of them, none of those scripts had this method

there is no pre_terminate method inside those 2 scripts

there is only one implementation script, the other is disabled and is an older version

Original thread: https://forums.rpgmakerweb.com/threads/weirdest-lag-issue-you-will-see-ever-need-help-fixing-it.44852/