Remove attack delay?

Hey guys,

I've been, for a while now, trying to lower or outright remove the attack delay that occurs when I press "attack". I'm not sure what the cause is and was wondering if anyone here had an insight into what the cause might be and how to fix it.

What I want to happen is that the attack animation occurs immediately after pressing "attack". I've tried turning off any and all battle plugins I have but the delay is still prevalent. Any help is appreciated.
what delay?

in default turn based the attack button is pressed in the selection phase, and then you have to select a target, and then the action phase has to run with your selected attack sometimes the second or third or later action.

so your entire description only makes sense if you changed the MV battlesystem with plugins to something else.
Yeah, as I mentioned in my first post. I turned off any battle plugins I had on at the time, which was YEP_X_BattlesysATB. But since the delay didn't go away I figured it wasn't the cause. But then I tried turning off all of my plugins as well. The attack now, while faster, still has a delay before it occurs. Albeit a small one.

I guess the YEP_Core plugins increase the delay in a way I can't undo. I say this because I tried using only YEP_Core plugins turned ON (without the atb system) and lo and behold the delay went back to being more prominent.
The attack now, while faster, still has a delay before it occurs. Albeit a small one.
delay between what?

there is not time in the default battle sequence at all, so a delay is absolutely impossible.

I think you misunderstood the entire concept because you probably have only one actor at the moment.
add three more actors for a full 4-actor-fight and then try again.
you'll see that you have to select "attack" for all four actors before the first attack happens at all.
What I want to happen is that the attack animation occurs immediately after pressing "attack".
...do you mean that you don't want the actors to wait for their turn in battle?

Is this what you mean?
Delay between the moment you press "attack" and the attack animation taking place. Not sure how else I'm supposed to explain it. Sorry, I know I'm not explaining properly.

For example, you decide to pick something up so you walk up to it and press "pick up". Now, you want this to happen immediately right? But instead there is a delay before you character picks said object up. This delay is what I'm trying to remove.

It's less prominent when I don't have any of the YEP_Core plugins set to ON but the same delay exists without them as well. It's just less prominent.

Nevermind, I can't seem to embed a video. None of the ones I tried worked.
Delay between the moment you press "attack" and the attack animation taking place. Not sure how else I'm supposed to explain it. Sorry, I know I'm not explaining properly.

For example, you decide to pick something up so you walk up to it and press "pick up". Now, you want this to happen immediately right? But instead there is a delay before you character picks said object up. This delay is what I'm trying to remove.

It's less prominent when I don't have any of the YEP_Core plugins set to ON but the same delay exists without them as well. It's just less prominent.

Here, check the video below. This is with the YEP_Core plugins set to ON.



So you meant "lag between clicking attack and seeing the animation play out when the turn actually starts".

Delay had us thinking you wanted a different battle system.
there is not time in the default battle sequence at all, so a delay is absolutely impossible.

I generally don't like to jump into threads like this lately, but this is simply wrong.

The default battle system is largely controlled by Window_BattleLog, which has a built-in wait of a set number of frames, which absolutely does equate to a timed delay. The length of the delay depends upon the number of frames being waited.

@Arkos if you want to understand the way that timing works in MV (and to an extent, MZ), you need to understand that every action is routed through Window_BattleLog. The YEP plugins may modify this to an extent—I'm not sure, as I don't use them.

However, the delay between Window_BattleLog's messages is likely the reason you are seeing the delay that you describe. The delay is programmed so that there is some time between the name of the attack displaying on-screen and the animation triggering.

You can reduce or remove the delay via plugins, but just be aware that with no delay, every action will occur back-to-back with no time between them, which makes things difficult to track for players.
...do you mean that you don't want the actors to wait for their turn in battle?

Is this what you mean?
Nah, they need to wait but I'm talking about after the player has pressed "attack". There is a delay between having pressed attack and the attack actually happening.
Sorry, I'm with Andar not understanding what you mean. The delay between pressing attack and the attack happening is that battler waiting for their turn.
I generally don't like to jump into threads like this lately, but this is simply wrong.

The default battle system is largely controlled by Window_BattleLog, which has a built-in wait of a set number of frames, which absolutely does equate to a timed delay. The length of the delay depends upon the number of frames being waited.

@Arkos if you want to understand the way that timing works in MV (and to an extent, MZ), you need to understand that every action is routed through Window_BattleLog. The YEP plugins may modify this to an extent—I'm not sure, as I don't use them.

However, the delay between Window_BattleLog's messages is likely the reason you are seeing the delay that you describe. The delay is programmed so that there is some time between the name of the attack displaying on-screen and the animation triggering.

You can reduce or remove the delay via plugins, but just be aware that with no delay, every action will occur back-to-back with no time between them, which makes things difficult to track for players.
Yes, exactly this...Sorry for being crap at explaining things. But I see, I need a plugin to shorten the timer. And I guess removing it entirely isn't a good idea huh. I'll see if I can find a plugin that shortens the time before the attack occurs. Thanks!

P.S

Sorry to everyone else for being, well, garbage at explaining my issue.
Are you using YEP_BattleEngineCore? I took a look at that plugin's options as well as the code. Take a look at the "Animation Base Delay" option. You can try adjusting that number to a lower/higher value and experiment with those results.
but I'm talking about after the player has pressed "attack". There is a delay between having pressed attack and the attack actually happening.
OK, I'm now giving a sequence how the default engine works, with an example of two actors and two enemies. I number every step there is, and please tell the two numbers between you see that "delay" - that is the only way how we can solve this description problem.

1) Action selection sequence starts
2) Actor 1 gets his action selection and the player can press that selection, for example "attack"
3) Actor 2 gets his action selection and the player can press that selection, for example "attack"
4) Enemy 1 will get action selection based on enemy 1 action pattern
5) Enemy 2 will get action selection based on enemy 2 action pattern
6) Action selection sequence ends
7) the engine reorders all selected action based on (battler-agility plus skill-speed plus random percentage), highest value gets first action. Let's assume this is enemy 1, actor 1, actor 2 and enemy 2 last.
8) Action execution sequence starts
9) highest speed action (in this example enemy 1) gets executed
10) next speed action (in this example actor 1) gets executed
11) action for actor 2 gets executed
12) action for enemy 2 gets executed
13) action execution sequence ends
14) turn ends, go back to 1

Now @Arkos , your "player has pressed attack for actor 1" is up in step 2. And there is a lot of other things, including "player has pressed attack for actor 2" between that button press and the execution of that attack in step 10, including having another enemy attack because that enemy is faster than actor 1.

And now please tell us where in that sequence is your "delay"?
Are you using YEP_BattleEngineCore? I took a look at that plugin's options as well as the code. Take a look at the "Animation Base Delay" option. You can try adjusting that number to a lower/higher value and experiment with those results.
Yes indeed, since I'm using YEP_X_BattleSysATB I had to have the YEP_BattleEngineCore as well.
I've tried fiddling with those options but even when set to 0 it doesn't help. I have noticed that it changes how quickly your animations happen after the first one but never changes how fast the first action happens, if that makes sense.

I've tried changing the action formula as well (the one at the very top that says "agi"). I thought maybe that is what's causing the delay but still nothing. The default formula went something like:

agi * Math.RandomInt(Math.floor(5 * agi / 4)) <<<< changing this didn't seem to have much off an effect, not that I have any idea what I'm doing mind you 👍.

Not sure what else to do really, tried looking for a plugin but came up short. There is one that increases the speed of battle by holding CTRL but not sure if it works or not. Will try today and see.
OK, I'm now giving a sequence how the default engine works, with an example of two actors and two enemies. I number every step there is, and please tell the two numbers between you see that "delay" - that is the only way how we can solve this description problem.

1) Action selection sequence starts
2) Actor 1 gets his action selection and the player can press that selection, for example "attack"
3) Actor 2 gets his action selection and the player can press that selection, for example "attack"
4) Enemy 1 will get action selection based on enemy 1 action pattern
5) Enemy 2 will get action selection based on enemy 2 action pattern
6) Action selection sequence ends
7) the engine reorders all selected action based on (battler-agility plus skill-speed plus random percentage), highest value gets first action. Let's assume this is enemy 1, actor 1, actor 2 and enemy 2 last.
8) Action execution sequence starts
9) highest speed action (in this example enemy 1) gets executed
10) next speed action (in this example actor 1) gets executed
11) action for actor 2 gets executed
12) action for enemy 2 gets executed
13) action execution sequence ends
14) turn ends, go back to 1

Now @Arkos , your "player has pressed attack for actor 1" is up in step 2. And there is a lot of other things, including "player has pressed attack for actor 2" between that button press and the execution of that attack in step 10, including having another enemy attack because that enemy is faster than actor 1.

And now please tell us where in that sequence is your "delay"?
Hey man, sorry. I know I've been explaining my issue quite horribly and I appreciate you for trying to make sense of my garble.

The thing is, my characters don't all get their turn one after the other. I'm using YEPS active battle system which is controlled by ones agility stat. the higher agility the more turns you get. For example, if one of your chars had 500 agi then that char would get a turn each 0.2 seconds while everyone else had to wait until their action bar fills up. So it's only one players turn at a time.

And I mentioned above that even without this atb system there seemed to be a timer before your attack actually happened, albeit a small one. Yes it may be so that its meant to be used in conjunction with your other party members but I'd still like the action to happen immediately without any waiting.

But if I'm being honest, the first action is always delayed even with more people in your party. First there is a text popup at the top letting you know what you're about to do. Then, I'd say maybe 0.6 - 0.8 seconds after that, you're attack actually takes place. All this when it's you're turn and not the enemies.

I would like to upload a video but I just can't seem to get it to work. tried a few different places but nothing panned out, sorry.
And I mentioned above that even without this atb system there seemed to be a timer before your attack actually happened, albeit a small one.
there is no timer anywhere in the sequence, other than the delay to make the battlelog output readable on display.
But that is why I gave you the entire sequence: so that you can see what the computer is required to calculate at any given part of that sequence.
calculating things requires time even for a computer, but you CANNOT cut off that time because then the battlesystem no longer works if the enemies don't calculate what skills to use and so on.

And now PLEASE ANSWER THE QUESTION:
between which two numbers on that sequence do you see your non-existant "delay"?
Because only then someone can start to see what part of the calculation takes more time that you think it should take, and tell you what scripts to request to remove those parts.
there is no timer anywhere in the sequence, other than the delay to make the battlelog output readable on display.
But that is why I gave you the entire sequence: so that you can see what the computer is required to calculate at any given part of that sequence.
calculating things requires time even for a computer, but you CANNOT cut off that time because then the battlesystem no longer works if the enemies don't calculate what skills to use and so on.

And now PLEASE ANSWER THE QUESTION:
between which two numbers on that sequence do you see your non-existant "delay"?
Because only then someone can start to see what part of the calculation takes more time that you think it should take, and tell you what scripts to request to remove those parts.
Remove 3, 4 and 5 since its neither the enemies or my other party members turn. I guess the delay happens at 9. When the action is supposed to take place. It takes around 1 second before it appears on screen and damages the enemy. I want this to be faster. What's bogging it down, I'm not sure.
What's bogging it down, I'm not sure.

I'm pretty sure that my original reply explains the issue.

You posted a Google Video that showed what you are trying to describe, but it looks like you removed it. Is this the issue?

(Shown below: MV + YEP_BattleEngineCore):

There is a delay between when the "Attack" skill is displayed and the skill animation begins.

MV-YEP-Action-Delay.gif


(Shown below: same as above, with a greater delay between the action display and the action animation for emphasis):

MV-YEP-Action-Delay-2x.gif


And is this what you are trying to accomplish?

(Shown below: no delay between the action display and the action animation):

MV-YEP-Action-Delay-Removed.gif
I'm pretty sure that my original reply explains the issue.

You posted a Google Video that showed what you are trying to describe, but it looks like you removed it. Is this the issue?

(Shown below: MV + YEP_BattleEngineCore):

There is a delay between when the "Attack" skill is displayed and the skill animation begins.

MV-YEP-Action-Delay.gif


(Shown below: same as above, with a greater delay between the action display and the action animation for emphasis):

MV-YEP-Action-Delay-2x.gif


And is this what you are trying to accomplish?

(Shown below: no delay between the action display and the action animation):

MV-YEP-Action-Delay-Removed.gif
Yes! exactly this. As one can see, there is a delay. And yes again, the last videos shows exactly what I want. No delay at all. I've been trying to find a plugin that somehow runs that window log thingy faster but I can't seem to find anything besides faster battles through a key input.

And yes, you're right. You mentioned what the issue was before. I was just replying to @Andar .
I'm guessing the last one is without YEP_BattleEngineCore? Or did you find a way to make it faster through some parameter changes inside the plugin?

Edit 1;
About the video I posted. I was certain it wasn't working since I couldn't load the video myself but you're saying you could see it...sigh. Should have left it up then.
I'm guessing the last one is without YEP_BattleEngineCore?

YEP_BattleEngineCore adds some additional wait frames to Window_BattleLog in a few places that you can override. You can save and install this code as a plugin; just be sure it goes below YEP_BattleEngineCore in your load order. The settings below gave me the results shown in the 3rd GIF in my prior post.

I did not test this with the ATB plugin, since Yanfly himself has dropped support for it (citing Window_BattleLog as one of the reasons, lol).

JavaScript:
// Override: default Window_BattleLog wait time
Window_BattleLog.prototype.messageSpeed = function() {
    return 0;
};
// Override: default animation wait time
Window_BattleLog.prototype.animationBaseDelay = function() {
    return 0;
};
// Optional: add a short wait after each action
let noWait_Window_BattleLog_endAction = Window_BattleLog.prototype.endAction
Window_BattleLog.prototype.endAction = function() {
    noWait_Window_BattleLog_endAction.call(this);
    this._waitCount = 30;
    this._endActionWait = true;
}
let noWait_Window_BattleLog_startAction = Window_BattleLog.prototype.startAction;
Window_BattleLog.prototype.startAction = function(subject, action, targets) {
    this._endActionWait = false;
    noWait_Window_BattleLog_startAction.call(this, subject, action, targets);
}
// Suppress additional waits added by other plugins
let noWait_Window_BattleLog_updateWaitCount = Window_BattleLog.prototype.updateWaitCount;
Window_BattleLog.prototype.updateWaitCount = function() {
    if (this._waitCount > 0 && BattleManager._subject && !this._endActionWait) {
        this._waitCount = 0;
        return false;
    }
    noWait_Window_BattleLog_updateWaitCount.apply(this);
};

I left the original wait commands in there so that you can refer to them and tweak the values if the speed ends up feeling too fast.

Edit: the originally posted code contained 2 modified functions that, after a closer review on my part, are exclusive to YEP_BattleEngineCore and not part of MV's base code. Yanfly's terms of use do not specify whether or not small modification plugins are acceptable, so I have removed the original code and replaced it with code that will yield the same result while only using default MV functions.

Original thread: https://forums.rpgmakerweb.com/threads/remove-attack-delay.147017/