- Joined
- Aug 25, 2016
- Messages
- 268
- Reaction score
- 148
- First Language
- English
- Primarily Uses
- RMMV
So, my game is getting pretty big right now. I have quite a bit custom artwork and plugins. I've recently noticed that my game has started to stutter a bit every 10-15 seconds. I'm not able to figure out the cause. I've disabled plugins and enabled some... tested various combinations. The stuttering just seems to continue from time to time.
I've also tried doing tests in just one map. It stutters. I remove a few events. It still does it. However; I remove a few more and it seems to stop. I then enable some... it starts again, but then I remove different events... and it stops. It just doesn't appear to be anything in general and is completely random.
I looked online and found this response on another forum. I wanted to check on here and see if this is a good idea, might work, or if someone has a better/different suggestion before I went in and changed anything. I've been messing around with my game all day and cannot find the culprit. I didn't want to post an outside link (not sure if that's allowed), so here's what someone said to try:
I've also tried doing tests in just one map. It stutters. I remove a few events. It still does it. However; I remove a few more and it seems to stop. I then enable some... it starts again, but then I remove different events... and it stops. It just doesn't appear to be anything in general and is completely random.
I looked online and found this response on another forum. I wanted to check on here and see if this is a good idea, might work, or if someone has a better/different suggestion before I went in and changed anything. I've been messing around with my game all day and cannot find the culprit. I didn't want to post an outside link (not sure if that's allowed), so here's what someone said to try:
Hey guys, I know this post is 5 years old, and I've had a similar problem with my game for YEARS, and I finally figured out today, with a clue from ??? (in this thread). It did indeed turn out to be Garbage Collection.
If you experience the micro-stutter it might help you as well. I go into the library file "pixi.js", and in it, there's a section to set global hard-coded variables for the rendering engine to override the defaults.
??? (on this Thread) was talking about the micro-stutter in RPG Maker MV games (lag spikes every 5-10 seconds) that cause it to feel like it "skips" or slight hang for a 10th of a second, every few steps or every few seconds. That he thought it was a problem with Pixi and how it handled rendering.
There is one attribute called "GC_MAX_CHECK_COUNT:" (Garbage Collector max check count) in Pixi.js around Line 21,239 for pixi.js - version 4.8.9.
To troubleshoot this, I set my game to Canvas mode temporarily, and the spikes went away, even though overall performance was lower (because using CPU instead of GPU in Canvas mode).
This led me to conclude (as ??? did) that it was something within Pixi.js and WebGL in the way that it renders everything, that was causing the spikes.
I went through editing the Global Defaults, setting memory buffer sizes, other crap, nothing worked, then I saw garbage collection "max checks" and I was like "hmmm that dude said something about garbage collection" and then I thought fewer checks would make it faster, so I set it to 1, instead of the default value of 600.
It make the stuttering really bad, really bad, but it was the same type of stutter.
Instead I set the value to be much larger, so it would be allowed to check 12000 times instead of 600, spikes went away. It was driving me nuts over years not being able to find it, turned out to be simple but not obvious. I hope this helps others who are experiencing this problem.
If you experience the micro-stutter it might help you as well. I go into the library file "pixi.js", and in it, there's a section to set global hard-coded variables for the rendering engine to override the defaults.
??? (on this Thread) was talking about the micro-stutter in RPG Maker MV games (lag spikes every 5-10 seconds) that cause it to feel like it "skips" or slight hang for a 10th of a second, every few steps or every few seconds. That he thought it was a problem with Pixi and how it handled rendering.
There is one attribute called "GC_MAX_CHECK_COUNT:" (Garbage Collector max check count) in Pixi.js around Line 21,239 for pixi.js - version 4.8.9.
To troubleshoot this, I set my game to Canvas mode temporarily, and the spikes went away, even though overall performance was lower (because using CPU instead of GPU in Canvas mode).
This led me to conclude (as ??? did) that it was something within Pixi.js and WebGL in the way that it renders everything, that was causing the spikes.
I went through editing the Global Defaults, setting memory buffer sizes, other crap, nothing worked, then I saw garbage collection "max checks" and I was like "hmmm that dude said something about garbage collection" and then I thought fewer checks would make it faster, so I set it to 1, instead of the default value of 600.
It make the stuttering really bad, really bad, but it was the same type of stutter.
Instead I set the value to be much larger, so it would be allowed to check 12000 times instead of 600, spikes went away. It was driving me nuts over years not being able to find it, turned out to be simple but not obvious. I hope this helps others who are experiencing this problem.