By default battle is arranged in phases: there's the "input phase" where you select your skills or whatever, then the "action phase" when actors/enemies use the skills they've chosen. Turn order only affects this "action phase". Are you looking at the input phase?
😅
It looks like it should be random if the following are equal for all battlers:
- Battler agility (i.e. AGI base param), and
- Action speed, configurable on the skill/item's page in the database.
(Note that the default skill 2, Guard, has 2000 speed.)
Turn order is determined by sorting battlers based on action speed (the one with the fastest action gets to go first). However, due to potentially-low precision in the randomness (integer from 0~4) the number of possible permutations for an equal-agi-equal-speed situation can be limited.
Spoiler: Supporting code excerpts (technical)
Code:
BattleManager.makeActionOrders = function() {
var battlers = [];
if (!this._surprise) {
battlers = battlers.concat($gameParty.members());
}
if (!this._preemptive) {
battlers = battlers.concat($gameTroop.members());
}
battlers.forEach(function(battler) {
battler.makeSpeed();
});
battlers.sort(function(a, b) {
return b.speed() - a.speed();
});
this._actionBattlers = battlers;
};
Game_Battler.prototype.makeSpeed = function() {
this._speed = Math.min.apply(null, this._actions.map(function(action) {
return action.speed();
})) || 0;
};
Game_Action.prototype.speed = function() {
var agi = this.subject().agi;
var speed = agi + Math.randomInt(Math.floor(5 + agi / 4));
if (this.item()) {
speed += this.item().speed;
}
if (this.isAttack()) {
speed += this.subject().attackSpeed();
}
return speed;
};
If the precision is the issue, then something like this will likely solve it~
Code:
// random turn order: ignores battler agility & action speed values
Game_Battler.prototype.makeSpeed = function() { this._speed = Math.random(); };
To try it out, just save as a .js file (Save As > File Type: All Files, Filename: whateverYouLike
.js) and import as a plugin.
🙂
[Edit: or grab the attached file!]