Issue with action order

I am trying to balance speed of my skill but no mater what I do, speed is inconsistant with the skills.

Got an ennemy with agility of 50 and casting a skill with 2000 speed acting last while my actors with a 30 agility using the guard skill at invocation speed of 30 (changed to test) and still all act first. I know RPG maker mv add a random factor but thats is way too much to explain the behavior. Is there something that is hardcoded in the engine that put certains types of action first? Why put a invocation speed if its not properly used?
Normally it should work just as you intended: With guard at 30 and attack at 2000 the guy using attack should always move first. Can you provide some screenshots on how set up your skills? Plus, do you use any plugins that could interfere?
I have several plugins (several YEP pluggins) with battle engine Core set action speed at agi (default value) but that should not cause a creature with more agi go at last with all actors less agi
My one not yanfly pluggin is MrTS_HideQuantities (that hide amount of items on specific item, not combat related)
Guard skill, I changed litterally nothing except speed under Invocation
Here is the attack skill (that use Yanfly LifeSteal plugging (at 0% but can get state that raise it) and Yanfly skillCooldowns

1692066747110.png
Did you try this with other skills than guard?
I am not sure if the "Guard"-Flag makes the action always move first or if skill #2 may even be hardcoded to behave like this.
Please try to create a different skills with higher speed one with and one without the "Guard"-Flag in the parameters to see if it's only your Gurad Skill that has these problems.

Also, since you use Yanfly Plugins did you check your plugin order? If not, these plugins need to be arranged at the plugin manager in a specific order you can find here to not act up.
The default action order in turn based is NOT simple agi.

The default is user.agi + skill.speed + random%
then sort highest total to lowest.

So a skill with a speed of 2000 is almost always guaranteed to go first - that is the sole purpose of skill speed, to get skills that need it to go earlier.
The default formula is:
agi + skill speed + Math.randomInt(Math.floor(5 + agi / 4))

So if your character agility is 30, the largest random factor that can be added is 11.
And if I understand correctly, using Yanfly Battle Core takes away that random element by default, unless you add it back to the formula.

I tested it quickly and if you set your guard skill speed to low and an enemy attack speed to high, the enemy goes first. So some other plugin or setting is interfering with your game, or are you using some other battle system than the default?
@Andar Maybe I misunderstood, but isn't this exactly the issue here? The OP set the guard speed to 30 and the attack speed to 2000 and still guard is performed first.

I did also test this and it's just as @rpgLord69 said: For me setting the guard speed to a lower number and the attack speed to a higher one works out as it should: The battler using the attack skill acts first.

So there is some kind of issue.
For Andar: this is why I made the post, I agree that a skill with speed 2000 should always act first but if you read it, my issue is that my guard skill with 30 speed act before skill with 2000 speed.... (the one using the 2000 speed action have even more agi than the one guarding). Having the 2000 speed acting first would indeed be the expected result I am trying to figure out why it is not the result I get. I've looked again (and changed back to default) but meant the default plugging formula that have the math random but not the Skill Speed (don't know how I would write for skill speed or if event used already).
1692222995143.png


As I said I used no other pluggins than the Yanfly ones exception of hiding items numbers of specific items. I tried clone the guard skill too (in case it was the skill 002 that had something special) but the problematic result stayed the same (the ennemi with 50 agi using a skill that should have 2000 speed acting after all my actors (all have 32 agi using the Guard skill at 30 speed). I can list all Yanfly pluggins that are on but as far as I know, the only one that affect was the one mentionned that has by default only agi in base formula but can be customizable. If I set the guard speed to 0, the guard is no longer the first but I want to understand how it works so I can adjust manually. (Initially, still wanted to have the guard be used first most of the time but have several skills that can act before guards.)
Note: the ennemy skill I want to have at 2000 speed is not the basic attack but a skill (called charge) if it change anything.
1692221787408.png
*
I can really deal without using pre-Guard skill was just really annoyed by the Issue.
Mind posting your plugin list? Something is definitely off here, but I dunno what it is.
Mind posting your plugin list? Something is definitely off here, but I dunno what it is.
(Skipped the 3 default ones)
YEP_CoreEngine
YEP_BaseParamControl
YEP_ExraParamFormula
YEP_MainMenuManager
YEP_MessageCore
YEP_X_ExtMesPack1&2
YEP_X_MessageMacro1to5)
YEP_X_MessageSpeedOpt
YEP_SaveCore
YEP_SpecialParamFormula
--------
YEP_BattleEngineCore
YEP_X_ActSeqPack1to3
YEP_X_CounterControl
YEP_X_InBattleStatus
YEP_X_VisualHpGauge
YEP_Z_ActionBeginEnd
YEP_AbsorbsionBarrier
YEP_BattleAICore
YEP_BattleSelectCursor
YEP_BattleStatusWindow
YEP_BuffsStatesCore
YEP_X_ExtDot
YEP_X_StateCategoris
YEP_X_VisualStateFX
YEP_Z_StateProtection
YEP_DamageCore
YEP_X_CriticalControl
YEP_Z_CriticalSway
YEP_ElementCore
YEP_ExtraEnemyDrops
YEP_HitAccuracy
YEP_LifeSteal
YEP_TargetCore
YEP_Taunt
YEP_VictoryAftermath
YEP_X_AftermathLevelUp
--------
YEP_ItemCore
YEP_X_AttachAugments
YEP_ItemSynthesis
YEP_ShopMenuCore
YEP_X_CondShopPrices
--------
YEP_SkillCore
YEP_X_LimitedSkillUses
YEP_X_SkillCooldowns
YEP_X_SkillCostItems
YEP_InstantCast
--------
YEP_EquipCore
YEP_WeaponUnleash
--------
YEP_StatusMenuCore
YEP_X_BattleStatistics
YEP_X_MoreStatusPage
--------
YEP_AutoPassiveStates
YEP_X_PassiveAuras
YEP_Z_PassiveCases
YEP_StealSnatch
--------
YEP_MoveRouteCOre
YEP_X_ExtMovePack1
YEP_FloorDamage
--------
YEP_OptionsCore
YEP_AnimateTilesOption
YEP_BattelAniSpeedOpt
YEP_FpsSynchOption
--------
YEP_EventChasePlayer
--------
YEP_CommonEventMenu
YEP_X_CEMSetupPack1&2
YEP_GabWindow
YEP_IconBalloons
YEP_RegionEvents
YEP_RegionRestrictions
YEP_SegmentedGauges
YEP_SmartJump
--------
MrTS_HideQuantities
(and changed back to default)
What you see there is the plugin default, nothing else - that is what yanfly said the value should be for his plugins. And it does indeed remove the skill speed.

Make a new testproject and test your values again WITHOUT adding plugins.
Because the true project default should include the skill speed, it is only the yanfly plugin that removed that.
Because the true project default should include the skill speed, it is only the yanfly plugin that removed that.
That's not correct. The plugin parameter above is then added to the skill's speed from the database. The formula listed as default is, in fact, the default formula in MV's code - which is then added to the skill's speed.

Code:
var speed = agi + Math.randomInt(Math.floor(5 + agi / 4));
    if (this.item()) {
        speed += this.item().speed;

I agree that testing should be done with all plugins turned off - I'm not sure why that wasn't a first step already done for troubleshooting.
I can vouch for what @ATT_Turan said, as I just tested it myself with three skills: one at 0 Speed, one at 1500 Speed, and Guard at 2000 Speed. Guard fired off first, no questions. The 1500 Speed skill went before the 0 Speed skill.

Additionally, I also tested an actor and an enemy both using the same 1500 Speed skill. The actor, who had the higher Agility, was the one who struck first each time, just as it should be. And yes, I use YEP Battle Core too.

EDIT: Just did another test by dropping Guard to 10 Speed. The faster skill actually procced first, with the Guard user going dead last.
*Update:
upon testing it seems that the problem occur when YEP_BattleAICore is active.
I don't see why - the AI plugin doesn't modify the function that determines action speed. It doesn't even reference speed in the entire plugin.

I think this needs to get thoroughly checked for conflicts. Make sure your plugins are in the exact order listed on the Yanfly Engine Web site. Make sure they're all the latest version - and double check that your MV project code is 1.6.2 or .2 (look at the beginning of rpg_core.js).
From what I understand, it might be because the ennemy only decide action when its his turn (that have to be agi based since skill isn't chosen yet) so the action speed isn't added. From what I've seen I will have to choose on more control on action speed versus AI that adapt to the battle.
I don't know why higher Agi wasn't first tough? Confused.. (At least I know the plugging that cause issue)
it might be because the ennemy only decide action when its his turn (that have to be agi based since skill isn't chosen yet) so the action speed isn't added.
If you're using the default battle system, that isn't true. Unless you have the Battle AI Core with the Dynamic Actions parameter activated.
It was activated but does that mean that the issue is the actors add action speed at first (in this case 30 from the guard) and ennemy have no bonus (since no skill selected yet). Guess by having it off, would fit well for game (intelligent ai still that, like the player decide action taken at start of battle then result phase)
Tested with the plugging on but Dynamic Action off and now charge skill correctly trigger before the actor. Thanx for ATT_Turan, now can get the best of both (not dumb AI and control on action speed) 🙂

Original thread: https://forums.rpgmakerweb.com/threads/issue-with-action-order.160035/