So I'm trying to learn the math/mechanics behind a CTB battle system. I found this Googling but found some of it confusing. Specifically, step 1 says that:
What should my approach be if my current battle system (which I'm trying to edit, not replace) currently manages turn order via an array in which the order of said array elements dictates the turn order? This is the function that handles turn order in LeTBS (Lecode's Tactical Battle System):
Note that
Basically, LUK is my Speed stat. Anyway, I'm simply trying to figure out how to manipulate the array so that the turn order can have a CTB mechanic instead of the basic "fastest to slowest" turn order.
However, shouldn't a unit's avg speed be
TotalSpeed divided by # of units?What should my approach be if my current battle system (which I'm trying to edit, not replace) currently manages turn order via an array in which the order of said array elements dictates the turn order? This is the function that handles turn order in LeTBS (Lecode's Tactical Battle System):
JavaScript:
BattleManagerTBS.determineTurnOrderSimple = function () {
var array = [];
this._turnOrder = [];
this._activeIndex = 0;
this.allPlayableEntities().forEach(function (entity) {
array.push(entity);
});
array = array.sort(function (a, b) {
return eval(Lecode.S_TBS.turnOrderSortMethod);
});
this._turnOrder = array;
this._turnOrderVisual.set(this._turnOrder);
};
return eval(Lecode.S_TBS.turnOrderSortMethod) simply refers to: b._battler.luk - a._battler.lukBasically, LUK is my Speed stat. Anyway, I'm simply trying to figure out how to manipulate the array so that the turn order can have a CTB mechanic instead of the basic "fastest to slowest" turn order.