Olivia Battle Impact plugin causing big framerate drop

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
603
First Language
English
Primarily Uses
RMMV
I've recently added the Battle Impact by Fallen Angel Olivia plugin to my list and I am now noticing a really big drop in framerate. I turn the plugin off and the framerate doesn't drop like it did.

One thing I've tried already is adding the Irina Performance Upgrade plugin because it mentioned lowering lag spikes due to hue changes for enemies and animations; however, I'm not seeing it get any better.

I am using mostly Yanfly plugins and a few of the Olivia octo pack plugins, but I've not seen any serious drops in framerate until adding the Battle Impact plugin.

Has anyone else used this plugin and noticed the same issue?

Anyone know of any way to stop this from happening?
 

zerobeat032

Cloaked Wanderer...
Veteran
Joined
Mar 28, 2014
Messages
296
Reaction score
322
First Language
English
Primarily Uses
RMMV
yeah this plugin absolutely TANKS framerates... for months I wondered why it was so sluggish and then I went plugin by plugin till I realized it was the Battle Impact plugin. I could barely scrape 30 frames using it. I dunno if the optimization is bad or what, but I just had to stop using it, which sucks because I paid for it... and hearing how hard it is to get a hold of Olivia, I haven't really bothered.

but yeah, it's definitely something up with this plugin.
 

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
603
First Language
English
Primarily Uses
RMMV
Yeah, it's a great plugin and since it did cost a bit, I would like to keep using it; but like you said, the framerate drop sucks. :kaodes:
 

Htlaets

Veteran
Veteran
Joined
Feb 1, 2017
Messages
85
Reaction score
56
First Language
English
Primarily Uses
Yeeeaaaahh, it's annoying because I like the plug-ins effects and I paid for it, but it definitely tanks framerate.
I tried it on a blank project with my lower end PC:

With plugin off:
Battle_plugin_off.png
No dips at all.


Battle plug-in on (dips as low as the 20s, never gets higher than 42):
Actually get better frames in my packed-to-the-gils with plug-ins main project with it on.

Also, it seems to break when people use it with windows 7. I have testers that say it makes the battle get super zoomed in for some reason. It's double annoying since Irina's action sequence impact partially relys on it. Oddly enough, Olivia's other plug-ins don't cause the same problems.

Is there some way to contact Olivia?
 
Last edited:

HumanNinjaToo

The Cheerful Pessimist
Veteran
Joined
Apr 18, 2013
Messages
1,226
Reaction score
603
First Language
English
Primarily Uses
RMMV
I have not discovered a way to contact her. Wish there was some kind of fix or something because I hate not being able to use it. I've got a pretty decent gaming laptop, so I can't imagine it's a hardware issue on my end.
 

Htlaets

Veteran
Veteran
Joined
Feb 1, 2017
Messages
85
Reaction score
56
First Language
English
Primarily Uses
Aight so I decided to take a swing at this. Bear in mind that I have just a tiny smidge of programming "skill" and the fact that it's a paid plugin means I can't copy and paste code snippets here.

Rant follows, jump to TL;DR for important findings:

First step is figuring out what the problem is. To this end I started commenting out sections of code.

The first section I ran into (the stuff under "Sprite_Battler (new blank line, new line) The superclass of Sprite_Actor and Sprite_Enemy") turned out to make things run smooth again (mind I'm about 90% certain that it basically stops all of the functionality of the plug-in, but I digress).

Since this "worked" I started commenting out some of the section. Most of the sections I tried with this just outright broke everything (error code at start), so I decided a different tact.

I added console.log([x]); where x = number of appearance to the end of all the functions. What this does is make me able to see when each function is called in the console, and since the frame tanks even when nothing is happening in battle, I figured the problem functions are constantly being called.

TL;DR:
I found which functions were being called constantly: the 7th, 8th, 9th, and 11th functions quickly flooded the console letting me know that they're the problem.

These functions begin as follows (The TOU doesn't say you can't post function names, just to not redistribute the plugin or use the code in different plugins, but if it's against forum rules, I'll edit in line numbers instead):

Code:
Sprite_Battler.prototype.update = function()
Sprite_Battler.prototype.updateHealAfterglowFilter = function() {
Sprite_Battler.prototype.updateMotionBlurImpact = function() {
Sprite_Battler.prototype.updateStateBuffApplyRemoveIconSprite = function() {
That first function seems to be the one that calls the other three. Each of these functions seem to be constantly checking a conditional on whether or not there's any duration left on motionblur effects on every sprite.

Which may be the root of the problem, because this is happening so often that just adding in the console log makes the framerate drop to 2 in a blank new project, not just on my somewhat low-end laptop but even on my super high end rtx 2080 ryzen desktop.

So, basically the solution seems to be to have "Sprite_Battler.prototype.update = function()" update less often and I'm not quite sure how given that I can't use a sleep function.

EDIT SEMI-WORK AROUND THAT IMPROVES THINGS:
Aight, got a patch job that will help (need to test this more thoroughly, but it doesn't seem to break anything, anyway?). Can't copy and paste the code (or can I? TOS are so vague):

Anyway, go to:

Sprite_Battler.prototype.updateHealAfterglowFilter = function()
Sprite_Battler.prototype.updateMotionBlurImpact = function()
Sprite_Battler.prototype.updateStateBuffApplyRemoveIconSprite = function()

Each of these have conditional "if" statements in them, yeah? Cut the statements (not the logic inside them) out and put them (make sure you move the bottom } bracket as well) in
Olivia.BattleImpact.___Sprite_Battler_update___ = Sprite_Battler.prototype.update;

By put them in I'm gonna fake code this to give a quick example (this is not the actual code, it's just semi-similar sounding to get the formatting right):

Code:
if (Afterglow duration > 0) {
    this.HealAfterglow updating function mentioned above;
    }
    if (motion blur duration > 0) {
    this.motion blur updating function above();
    }

Finally you have to deal with the icon state whatever function which is formatted differently than the other two and requires a different "solution" (I make no claim to real programming knowledge, just some minimal code literacy that has lead me wrong before, full disclaimer).

I didn't mess with that function itself, instead I combined the various if statements into one to enclose the function call as follows (if this goes too far, I apologize, but there's literally no useful info to copy the plugin in this code):

Code:
if (this._iconsToBeApplied.length > 0 || this._iconsToBeRemoved.length > 0 && !this._stateBuffApplyRemoveIconSprite.isBusy())
{
[Insert function call here]
}
Now, these conditionals are still getting called 8 bajillion times a second, so the problem isn't solved. But it cuts out three function calls unless they're necessary and a variable change 8 bajillion times.

In case mods are curious about TOS:
1. These plugins may be used in free or commercial games.
2. 'Fallen Angel Olivia' must be given credit in your games.
3. You are allowed to edit the code.
4. Do NOT change the filename, parameters, and information of the plugin.
5. You are NOT allowed to redistribute these Plugins.
6. You may NOT take code for your own released Plugins.
So it doesn't explicity bar code snippets from being shared and the snippets I put out are meaningless on their own (the real logic of the plugin is in a giant block of unbroken text that's all latin to me, which, fortunately, doesn't seem to cause the performance problem).

Putting that aside, I am still stumped on the windows 7 issue (also stumped on a non-duct tape solution).
Edit 2:
For the first bit, you can get a few extra FPS by encasing the Olivia.battleimpact.__ etc in

setInterval([INSERT CALL HERE], 60);

Which will just make that part only run every 60 miliseconds. Might be able to get away with more. Either way, tested it all out and the plug-in still functions as intended, just with decently better performance (but still much worse than without it).
 
Last edited:

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,138
Reaction score
15,464
First Language
Filipino
Primarily Uses
RMMZ
I'm unsure if this is exactly an Olivia problem. I did do some google search just in case and


and about this statement:
Which may be the root of the problem, because this is happening so often that just adding in the console log makes the framerate drop to 2 in a blank new project, not just on my somewhat low-end laptop but even on my super high end rtx 2080 ryzen desktop.
If you put console.log in anything that runs 60 times a second. That causes a frame rate drop no matter what. Like just try this one:
1594374219511.png
Code:
Sprite_Battler.prototype.update = function() {
    Sprite_Base.prototype.update.call(this);
    console.log('update checks')
    console.log('update checks')
    console.log('update checks')
    if (this._battler) {
        this.updateMain();
        this.updateAnimation();
        this.updateDamagePopup();
        this.updateSelectionEffect();
    } else {
        this.bitmap = null;
    }
};
That said conditional if checks like that should not affect the frame rate at all. At least not by that much. An if check for > x should not cause lag. If you look at default RM code, even Ojima-san does this:

Code:
Sprite_Animation.prototype.update = function() {
    Sprite.prototype.update.call(this);
    this.updateMain();
    this.updateFlash();
    this.updateScreenFlash();
    this.updateHiding();
    Sprite_Animation._checker1 = {};
    Sprite_Animation._checker2 = {};
};

Sprite_Animation.prototype.updateFlash = function() {
    if (this._flashDuration > 0) {
        var d = this._flashDuration--;
        this._flashColor[3] *= (d - 1) / d;
        this._target.setBlendColor(this._flashColor);
    }
};

Sprite_Animation.prototype.updateScreenFlash = function() {
    if (this._screenFlashDuration > 0) {
        var d = this._screenFlashDuration--;
        if (this._screenFlashSprite) {
            this._screenFlashSprite.x = -this.absoluteX();
            this._screenFlashSprite.y = -this.absoluteY();
            this._screenFlashSprite.opacity *= (d - 1) / d;
            this._screenFlashSprite.visible = (this._screenFlashDuration > 0);
        }
    }
};
and another example:

Code:
Sprite_Enemy.prototype.update = function() {
    Sprite_Battler.prototype.update.call(this);
    if (this._enemy) {
        this.updateEffect();
        this.updateStateSprite();
    }
};

Sprite_Enemy.prototype.updateEffect = function() {
    this.setupEffect();
    if (this._effectDuration > 0) {
        this._effectDuration--;
        switch (this._effectType) {
        case 'whiten':
            this.updateWhiten();
            break;
        case 'blink':
            this.updateBlink();
            break;
        case 'appear':
            this.updateAppear();
            break;
        case 'disappear':
            this.updateDisappear();
            break;
        case 'collapse':
            this.updateCollapse();
            break;
        case 'bossCollapse':
            this.updateBossCollapse();
            break;
        case 'instantCollapse':
            this.updateInstantCollapse();
            break;
        }
        if (this._effectDuration === 0) {
            this._effectType = null;
        }
    }
};
Using Pixi filters on lower end PC (depending on the specs too) doesn't really give us much information. Pixi filters uses WebGL and those are very GPU dependant. If you can give me a sample project that happens in vanilla that is only olivia's plugin (without any changes to her code) that can cause this slowdown it'd be easier to help.
 
Last edited:

Htlaets

Veteran
Veteran
Joined
Feb 1, 2017
Messages
85
Reaction score
56
First Language
English
Primarily Uses
I'm unsure if this is exactly an Olivia problem. I did do some google search just in case and


and about this statement:


If you put console.log in anything that runs 60 times a second. That causes a frame rate drop no matter what. Like just try this one:

Code:
Sprite_Battler.prototype.update = function() {
    Sprite_Base.prototype.update.call(this);
    console.log('update checks')
    console.log('update checks')
    console.log('update checks')
    if (this._battler) {
        this.updateMain();
        this.updateAnimation();
        this.updateDamagePopup();
        this.updateSelectionEffect();
    } else {
        this.bitmap = null;
    }
};
That said conditional if checks like that should not affect the frame rate at all. At least not by that much. If you look at default RM code, even Ojima-san does this:

Code:
Sprite_Animation.prototype.update = function() {
    Sprite.prototype.update.call(this);
    this.updateMain();
    this.updateFlash();
    this.updateScreenFlash();
    this.updateHiding();
    Sprite_Animation._checker1 = {};
    Sprite_Animation._checker2 = {};
};

Sprite_Animation.prototype.updateFlash = function() {
    if (this._flashDuration > 0) {
        var d = this._flashDuration--;
        this._flashColor[3] *= (d - 1) / d;
        this._target.setBlendColor(this._flashColor);
    }
};

Sprite_Animation.prototype.updateScreenFlash = function() {
    if (this._screenFlashDuration > 0) {
        var d = this._screenFlashDuration--;
        if (this._screenFlashSprite) {
            this._screenFlashSprite.x = -this.absoluteX();
            this._screenFlashSprite.y = -this.absoluteY();
            this._screenFlashSprite.opacity *= (d - 1) / d;
            this._screenFlashSprite.visible = (this._screenFlashDuration > 0);
        }
    }
};
Using Pixi filters on lower end PC (depending on the specs too) doesn't really give us much information. Pixi filters uses WebGL and those are very GPU dependant. If you can give me a sample project that happens in vanilla that is only olivia's plugin (without any changes to her code) that can cause this slowdown it'd be easier to help.
Thanks for the input, did preface that my coding knowledge base is shaky at best. That being said, this has nothing to do with radeon graphics in my case, at least. On top of that, there is no meaningful frame rate difference between when the battle impact effects show up and when I'm just idling in the command menu, so I don't think it has anything to do with rendering (since nothing is being rendered through the plugin).

As for the test bit, my low end laptop is using an intel core M3 with intel HD 615 integrated graphics. As a few posts up the frames in a vanilla project with the plugin on and off is night and day.

Additional possibly useful tidbit: the performance tanks more with more enemies and they don't need to be doing anything, you could just be sitting in the command menu. I do have some testers that run into similar frame rate problems on different machines, too. Also, as enemies are defeated the framerate goes up greatly.

As for the conditional thing, I was just throwing stuff at the wall when I tried it, but... it actually did have a noticeable impact on framerate. I'm actually leaning more towards the last conditional bypassing the setting of two variables making the difference since that was the thing that added the most frames in my testing.
Here's how the before and afters panned out:

This is with the M3 integrated laptop:
No plugins (Well, community basic and splash screen were on by default, but yeah):
Before changes with just battle impact (low point was 20, high point was 40, again, fluxed with nothing on screen happening):
After with changes to battle impact(console stuff commented out, high point is 52 low point is 48):
So, obviously changing where the conditionals happened did do something for some reason, right? My (quite possibly idiotic) guess at part of what's going on here is that the function in question polls every single sprite every single frame, which is why performance is worse depending on the number of battlers (just to double check I tried the duct taped fix version with the max number of battlers, performance dropped to ~30 fps, get about 10-16 on non-duct tape, 60 fps without the plugin). Having the conditionals run outside the functions shaves a tiny bit of work (calling the functions and skipping two variable settings) off this exponentially growing pile. Or something. Either way, only thing I'm sure of is that the stupid duct tape thing helps frame rate.

Either way, my 2080 machine is mostly 60 fps (occasional dropped frames when this plug-in is on with a lot of enemies) even with this plug-in, but that's not the case with the machines I've had people play and test on, unfortunately.

As for a sample project: I'd be happy to send one out, but that's kinda against the TOS of the plugin isn't it? Unless you also have the plug-in and I just PM directly, right? Actually, wait, if that were the case you couldn't distribute a project with the plugin.
 
Last edited:

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,138
Reaction score
15,464
First Language
Filipino
Primarily Uses
RMMZ
you don't have to worry about me. I'm friends with Olivia.
Just PM me the project where the lag happens.
 

Moon_Haven

Veteran
Veteran
Joined
May 5, 2020
Messages
154
Reaction score
61
First Language
French
Primarily Uses
RMMV
Hey folks! I bought the whole pack a few minutes ago for this very plugin, and just discovered that the FPS goes down to a crawl. If anyone comes up with a solution, that would be nice... spent quite a bit of money on something that I cannot use is very disappointing :(
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,138
Reaction score
15,464
First Language
Filipino
Primarily Uses
RMMZ
Hey folks! I bought the whole pack a few minutes ago for this very plugin, and just discovered that the FPS goes down to a crawl. If anyone comes up with a solution, that would be nice... spent quite a bit of money on something that I cannot use is very disappointing :(
It's happening to your sample project with Olivia without anything else???
 

Moon_Haven

Veteran
Veteran
Joined
May 5, 2020
Messages
154
Reaction score
61
First Language
French
Primarily Uses
RMMV
It's happening to your sample project with Olivia without anything else???
Good morning!

Enabling any of the following 3 plugins will have a substantial impact on the FPS, making it impossible to use.

Olivia_BattleImpact (this one hits the hardest on FPS, drop to 10-15 FPS)
Olivia_BattleEffects
Olivia_BattleEffects2

Even if I turn every every parameter off (Enable = False) in these plugins, the FPS impact remains very high.

I've tried the OctoBattle plugin, which includes a portion of the plugins above, and I see no FPS drop. I've then tried most of the other plugins (SideBattleUI, OTB, Tooltips, etc.) and see no FPS drop either. This leads me to believe there's a line of code, used only in the 3 plugins above, that is buggy.

Cheers!
 
Last edited:

Anohe1

Veteran
Veteran
Joined
May 12, 2019
Messages
30
Reaction score
5
First Language
French
Primarily Uses
RMMV
Did someone find a way to correct the issue because I really need to finish my project and those plugins with pixi.js in libs make the game bug or crash at times
 

Moon_Haven

Veteran
Veteran
Joined
May 5, 2020
Messages
154
Reaction score
61
First Language
French
Primarily Uses
RMMV
Did someone find a way to correct the issue because I really need to finish my project and those plugins with pixi.js in libs make the game bug or crash at times
I did not and since there’s no way to contact Olivia, I’ve moved on. It thought me a valuable lesson...

Anyways, while it’s not entirely the same, I suggest you take a look at TSR_Popups plugin.
 

Anohe1

Veteran
Veteran
Joined
May 12, 2019
Messages
30
Reaction score
5
First Language
French
Primarily Uses
RMMV
Well thank but I stopped I'm disappointed beyond measure both in me and in olivia
I'll go back to my old ways playing Bloodborne, soon Cyberpunk and maybe waiting for Elden Ring
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Hello humans! How goes your day in this journey of living? I hope it is good, for I am human like you, and I am feeling great! Worship the altar.
Sand is basically small rocks
Realizing my earlier maps are an abomination against all things, I'm doing a bit of a remake. Tell me if you can see the difference. :LZSwink:



And the horrific before pics...

Last part of OcRam Obfuscator sneek peaks!

Forum statistics

Threads
105,603
Messages
1,014,939
Members
137,274
Latest member
Parzival
Top