A few days ago I made a thread talking about lag that I was getting during the boss fight I was working on. I didn't really understand too much about what was going on, so the thread is kind of confusing and I deleted a bunch of my own confusing replies and it was getting a bit messy. But I did more research and did some more rigorous testing and now have a clearer idea of what's going on and what to ask.
The problem seems to be that every time my boss' attack pattern loops, the CPU usage increases. It won't be noticeable during the first loop, but every loop it gets worse until I eventually observed that CPU usage spikes to 100% and the frames drop to less than 20.
But there's kind of just some oddities with it all. For instance, if I disable all of my event groups besides the ones that keep the player and boss moving, the CPU usage remains constant and low and there is no perceivable lag. I figured I could solve the issue then by just disabling unused groups during the boss fight. However, when I enabled some groups that are essential to the player losing lives and receiving game overs, the lag is back and is just as worse as all the groups being enabled.
Additionally, no matter what event groups are enabled or disabled, if I take the boss' "dashattack" out of his attack cycle, there is not lag or significant CPU usage increase. I've tried temporarily disabling parts of that attack, such as a timer and events that cause him to play a skidding animation, but neither of those prevent that lag from happening. So to me it would seem like that attack is what is responsible for the lag, but like I said before, if I disable a bunch of event groups that attack doesn't cause lag which is puzzling.
I've been going at it for a few days now trying to figure out what the primary cause is, but haven't been successful.
Thanks in advance for the help. This is the first time I've run into a problem like this. It's definitely been a learning experience!