How do I make Yanfly's Battle Engine Core run smoothly?

After a long break from development, I recently decided to give it another try with a new project.

However, I've run into some problems. One of which is that I don't want to use the default Skill animations that your character performs when casting a skill. Instead, I want my character to perform an Attack or Guard animation when using certain skills. I've discovered that I'm able to do this with Yanfly's Battle Engine Core and Action Sequences, and I've successfully made it work.

But here's the issue. Yanfly's Battle Engine Core is so awkwardly paced! There are significant pauses between your character's Attack animation and the actual attack animation on the target. Yet when one of your characters gets hit, its Flinch animation is only visible for a few frames. Additionally the enemy battlers also move forward when they attack, which is something that I don't want. Yet I can only increase or reduce the range, which is tied to both the enemy battlers and my own characters.

I want these things in particular to be a lot closer to the pacing of RMMV's default settings. Yet the Parameters that the plugin allows me to change do not seem to be enough. Are there any other developers who have struggled with this issue, and know how to fix it?
most probably you need to override the default action sequences by giving each skill its own full action sequence - that is IF that is caused by the action sequence and yanfly's plugin at all.

It could also be caused by an incompatibility or wrong order of plugins, and to help you in that case we would need to see your entire plugin list (preferably as a screenshot of the plugin manager because that also contains version numbers and so on)
There's not really that much to show yet, but here you go.



I assume the Animation Base Delay and Animation Next Delay are the most important parts, and those are both set to 0.

EDIT: Before you mention it, the plugin is OFF at the moment because I'm continuing to work on the game with the plugin turned off. The issues are only present when the plugin is ON.

I've moved this thread to Plugin Support. Thank you.

It's probably the sideview battle plug-in conflicting with it, as I use battle engine and have no issues without that script.
additionally, the plugin order is wrong for yanfly's plugins. It might not be the cause with only that few plugins, but you are guaranteed to get problems if you use a good number of yanfly's plugins in the wrong order, so you better start correctly. The plugins have to be installed in the order of the plugin list on yanfly's website to prevent those problems.
As above, and I'd suggest removing the SimpleMsgSideView plugin altogether. Yanfly's plugin offers the same kind of thing via its "Show Action Text" (full/simple) plugin parameter. 😮‍💨

If that doesn't fix it, then let's define some terms for clarity~
  • Action animation: assigned in the database, played on the target when the item/skill is used.
  • Cast animation: added by Yanfly's Battle Engine Core, played on the user during the action's setup phase.
  • Motion: a set of frames assigned to an animated battle sprite (swing, chant, etc).
Yanfly's Battle Engine Core plugin lets you customise a few things via plugin parameters, including Motion Waiting: "wait for attack motion to finish before displaying action animation?". Action sequences let you override the default settings (affected by the plugin parameters like Motion Waiting, etc) and fully customise when cast/action animations occur. The Action Sequence Pack 2 plugin also lets you specify motion changes, as I'm guessing you've figured out already. 😅

In case it helps, for a single-target item/skill I believe these are the default phases with motion waiting enabled, i.e. the actions used when none are specified via notetags:
Spoiler
Code:
<setup action>
clear battle log
display action
immortal: targets, true
perform start
wait for movement
cast animation
wait for animation
</setup action>

<target action>
perform action
motion wait: user
action animation
wait for animation
action effect
death break
</target action>

<follow action>
</follow action>

<finish action>
immortal: targets, false
wait for new line
clear battle log
perform finish
wait for movement
wait for effect
action common event
</finish action>
If the item/skill scope is "all allies" or "all enemies", it'll use <whole action> instead of <target action>.

Re enemy movement: if you want the enemies to not step or flinch at all, there's a <Sprite Cannot Move> notetag. Alternatively, you could remove it from enemy skills via action sequences: "step forward" is part of the setup phase, namely the "perform start" action.
So I took a peek at Yanfly's MV Battle Engine Core. Just the Battle Engine, no other plugins (not even the regular Core Engine). I do swear that I remember a similar delay issue also being present in Yanfly's Ace Battle Engine as well, but I could certainly be wrong because it's been a while being that I never use the Ace Battle Engine (in part to avoid all the frustrations you are currently having).

But indeed, while the MV default battle system plays the hit animation at the same time as the sprite motion animation, Battle Engine Core introduces a short delay between the motion animation and the hit animation. This occurs even if the Motion Waiting parameter is set to False (i.e. "Play animations during performing an action").

And this delay is exactly 10 frames long.

How do I know this?

No, it's not because I timed it with a stopwatch like some maniac.

It is because. It is hard-coded into the plugin. Written with a big fat "10" next to "WAIT". Check Line 1375 for the relevant code:
Code:
if (Yanfly.Param.BECMotionWait) {
  Yanfly.BEC.DefaultActionWhole.push(['MOTION WAIT', ['USER']]);
  Yanfly.BEC.DefaultActionTarget.push(['MOTION WAIT', ['USER']]);
} else {
  Yanfly.BEC.DefaultActionWhole.push(['WAIT', [10]]);
  Yanfly.BEC.DefaultActionTarget.push(['WAIT', [10]]);
};
Yes, there is delay even if Motion Waiting is set to false. Yes, the delay will be reduced if you lower the number or comment out the lines.

No, I do not know why Yanfly introduced it. So if you remove it you're doing so at your own risk. There may have been a reason why Yanfly hard-coded the delay in and it may have been to prevent something else from breaking which might not even be in the Battle Core itself but from one of the many other supporting plugins it needs to be compatible with. You would need to ask Yanfly yourself to confirm it.

Incidentally, speaking of hard-coded stuff, I personally found it quite dumb how Yanfly also hard-coded the plugin in such a way that it needs to be exactly named "YEP_BattleEngineCore" in order for the PluginManager to read its parameters. I initially changed the filename when testing it (because I also had an older version of the same plugin in the project folder) and spent half an hour wondering why the **** this new version completely broke the battle system. And then realized it wasn't reading the parameters since it had been hardcoded to use the one specific filename.
Yet when one of your characters gets hit, its Flinch animation is only visible for a few frames.
As far as I can tell, the Flinch duration is the same length as in the default system when only Battle Engine Core is being used. The problem might be coming from one of the other scripts.
Additionally the enemy battlers also move forward when they attack, which is something that I don't want.
Again, hard-coded.

Yanfly flagged both enemies and actors to step forward on performing an action (check Line 3943, the Game_Battler object/prototype is used to make both Game_Actor and Game_Enemy) and then coded the sprites of both to actually move forwards on screen when it happens (Line 2993, Sprite_Battler is used to make both Sprite_Enemy and Sprite_Actor). And then does it AGAIN for Sprite_Actor specifically.

So I guess you could comment out Line 2994 (the one that goes "this.startMove(Yanfly.Param.BECStepDist, 0, 12)") and it would stop enemies from moving but not the actors since the redundant code would kick in for them.

Again, however, I do not know exactly why Yanfly coded it this way and it could be that one of the other plugins made to work with it might introduce some other kind of sprite based off Sprite_Battler that would glitch out and stop moving if you did that. So again, tweak at your own risk.

EDIT: Although as caethyril pointed out, yes, the <sprite cannot move> notetag will disable movement for a specific enemy or actor. Probably better to use that then messing directly with the code.
I removed the SimpleMsgSideview, I've re-organized the Yanfly plugins and I used the notetags in all my abilities. Now everything seems to work as I wanted it to! It even now displays the damage enemy characters take from their debuffs, which was a second issue I wanted to address later!

Thank you all very much for your advice. I'll make sure to include your names in the credits, should I get around to actually finishing this thing.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-make-yanflys-battle-engine-core-run-smoothly.107190/