Ellye's ATB (also includes CTB option)

clitvin

Veteran
Veteran
Joined
Oct 26, 2015
Messages
104
Reaction score
13
Primarily Uses
When you get a chance I also have a feature request.

Conditional atb mods for skills and items. <if state x self_atb: y>

Basically exactly like the atb mods we have now except they only work if the actor is affected by the specific state. 
 

a6p

Veteran
Veteran
Joined
Nov 1, 2015
Messages
30
Reaction score
8
First Language
English
I'm really happy about the turn ticks. Now poisons and other DoT effects hit multiple times while the atb bar is loading.

However, the action end option doesn't seem to work for states. Any time I use the action end option, the state just goes away. I'll guard and it'll be removed right away.

I've been having to replace them with <atb_duration:1000> or something (I lowered the max atb to 1000). Additionally, the turns don't seem to work with Yanfly's Skill Cooldown system.
 

Luminous

Veteran
Veteran
Joined
May 24, 2012
Messages
122
Reaction score
43
Hi there, just wanna ask some question, is that possible if the future update is to add the <cast_time:25000> notetag into the armor or weapon tab? so if we equip heavy weapon like axe, the delay will of our normal attack will be more long than if we equip the dagger or sword. It's not a big deal because I can create a whole new attack skill for the axe weapon but that will be a problem if we want to make every weapon casting time is unique and different each.


I hope it will be planned to the next feature ^^ Thanks.
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
803
Reaction score
350
First Language
English
Primarily Uses
N/A
When trying to escape the actors don't lose any AT, so you can just keep trying to escape over and over again until you succeed. Is there any way to fix this?
I made a snippet to temporarily fix this issue and thought I'd share it.


Since Mellye said they'd be doing a formal update, I didn't add too much.


Currently, all this does is reduce all actor's atb to 10% for each failed escape attempt.


No casting cancelling or anything else.


Hope this helps.


Link: http://pastebin.com/jp137h3R


(Put the plugin under both Elle'y Atb and YanFly's battle core in the Plugin Manager.)
 
Last edited by a moderator:

Tohisu

Veteran
Veteran
Joined
Oct 25, 2015
Messages
56
Reaction score
2
First Language
French
Primarily Uses
RMMV
How do we have to name this plugin, Maliki79?
 
Last edited by a moderator:

Tohisu

Veteran
Veteran
Joined
Oct 25, 2015
Messages
56
Reaction score
2
First Language
French
Primarily Uses
RMMV
It's working btw, thx.
 

Mellye

Veteran
Veteran
Joined
Oct 24, 2015
Messages
347
Reaction score
279
First Language
Portuguese
Hi! Just wanted to say sorry for the long hiatus - I've had a few personal issues those past months that I'm still dealing with, but things are slowly going back to normal now.


I think I'll be able to resume working on my scripts soon.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,789
Reaction score
941
First Language
Chinese
Primarily Uses
N/A
After reading the implementation of this plugin, right now I'm interested in these 2 parts:


Possibility for repeated BattleManager.updateEvent

Spoiler





BattleManager.update is extended to the below in this plugin:


    //Changing the flow of battle
    _BattleManager_update = BattleManager.update;
    BattleManager.update = function() {
        if (!this.isBusy() && !this.updateEvent())
        {
            switch (this._phase)
            {
                case 'atb':
                    this.increaseAtbGauges();
                    break;
                default:
                    _BattleManager_update.call(this);
                    break;
            }
        }
    };


Where the original BattleManager.update is this:


BattleManager.update = function() {
    if (!this.isBusy() && !this.updateEvent()) {
        switch (this._phase) {
        case 'start':
            this.startInput();
            break;
        case 'turn':
            this.updateTurn();
            break;
        case 'action':
            this.updateAction();
            break;
        case 'turnEnd':
            this.updateTurnEnd();
            break;
        case 'battleEnd':
            this.updateBattleEnd();
            break;
        }
    }
};


When there are no active input window and BattleManager._phase isn't 'atb', BattleManager.updateEvent will be called twice per frame:


BattleManager.updateEvent = function() {
    switch (this._phase) {
    case 'start':
    case 'turn':
    case 'turnEnd':
        if (this.isActionForced()) {
            this.processForcedAction();
            return true;
        } else {
            return this.updateEventMain();
        }
    }
    return this.checkAbort();
};


This can be somehow dangerous when BattleManager._phase is 'turn', as BattleManager.processForcedAction and BattleManager.updateEventMain are these:


BattleManager.processForcedAction = function() {
    if (this._actionForcedBattler) {
        this._subject = this._actionForcedBattler;
        this._actionForcedBattler = null;
        this.startAction();
        this._subject.removeCurrentAction();
    }
};


BattleManager.updateEvent = function() {
    switch (this._phase) {
    case 'start':
    case 'turn':
    case 'turnEnd':
        if (this.isActionForced()) {
            this.processForcedAction();
            return true;
        } else {
            return this.updateEventMain();
        }
    }
    return this.checkAbort();
};


BattleManager.updateEventMain = function() {
    $gameTroop.updateInterpreter();
    $gameParty.requestMotionRefresh();
    if ($gameTroop.isEventRunning() || this.checkBattleEnd()) {
        return true;
    }
    $gameTroop.setupBattleEvent();
    if ($gameTroop.isEventRunning() || SceneManager.isSceneChanging()) {
        return true;
    }
    return false;
};


If it's so unfortunate that BattleManager.processForcedAction runs in this situation, both BattleManager.startAction and BattleManager._subject.removecurrentAction will be run twice in the same frame, which is at least playing with fire.


If $gameTroop.updateInterpreter and $gameTroop.setupBattleEvent run twice in the same frame, the battle events can become quite erroneous.


Luckily, the remedy can be as simple as this:


    //Changing the flow of battle
    _BattleManager_update = BattleManager.update;
    BattleManager.update = function() {
        switch (this._phase)
        {
            case 'atb':


                if (!this.isBusy() && !this.updateEvent()) {


                    this.increaseAtbGauges();


                }
                break;
            default:
                _BattleManager_update.call(this);
                break;
        }
    };



Always updating the whole status window per ATB update

Spoiler





BattleManager.increaseAtbGauges will be run per frame as long as the ATB can be updated:


    //Increases the ATB gauges when idle:
    BattleManager.increaseAtbGauges = function() {
        var loopForInstantATB = instant_atb;
        var oneATBFilledAlready = false;
        //================================================
        //ATB LOOP
        //We need to be in a loop here if we're using instant ATB option, but run only once in other cases.
        //================================================
        do
        {
            //==========================================
            //Turn Timer
            //==========================================
            turn_atb += CalculateATBRate(turn_timer);
            //Turn timer finished:
            if (turn_atb >= full_atb)
            {
                turn_atb -= full_atb;
                //We advance the troops page (for events and AI) depending on parameter:
                if (battle_event_turn_mode === 0)
                {
                    $gameTroop.increaseTurn();
                }
                //We apply onTurnEnd if paramaters are set so
                if (battler_end_turn_effects !== 1)
                {
                    this.allBattleMembers().forEach(function(battler)
                    {
                        battler.onTurnEnd();
                        this.refreshStatus();
                        this._logWindow.displayAutoAffectedStatus(battler);
                        this._logWindow.displayRegeneration(battler);
                    }, this);
                }
            }
            //========================================
            //End of turn timer related stuff
            //========================================


            this.allBattleMembers().forEach(function(battler)
            {
                //States with ATB duration:
                battler._states_atb_duration.forEach(function(duration, stateID)
                {
                    battler._states_atb_current[stateID] += CalculateATBRate(battler._states_atb_rate[stateID], 100);
                    if (battler._states_atb_current[stateID] >= duration)
                    {
                        battler.removeState(stateID);
                    }
                }, this);


                //Dead battler has no ATB nor cast:
                if (battler.isDead())
                {
                    battler.atb = 0;
                    battler.resetCast();
                }
                //====================
                //Casting time logic:
                //====================
                //Cast finished:
                else if (battler.finished_casting === true)
                {
                    battler.resetCast();
                }
                //Currently casting:
                else if (battler.target_cast_atb > 0)
                {
                    //Got stunned or similar while casting, auto-interrupt for now:
                    if (!battler.canMove())
                    {
                        battler.BreakCurrentCast(true);
                    }
                    else
                    {
                        battler.current_cast_atb += battler._cast_rate * (battler.CastHaste() / 100);
                        if (battler.current_cast_atb >= battler.target_cast_atb && oneATBFilledAlready === false)
                        {
                            battler.finished_casting = true;
                            this.battlerHasFullAtb(battler, true);
                            oneATBFilledAlready = true;
                            loopForInstantATB = 0;
                        }
                    }
                }
                //===================
                //Not casting, ATB INCREASE:
                //===================
                else
                {
                    battler.atb += battler.calculateATBRate();
                }
                if (battler.atb >= full_atb && oneATBFilledAlready === false && battler.target_cast_atb <= 0)
                {
                    this.battlerHasFullAtb(battler);
                    oneATBFilledAlready = true;
                    loopForInstantATB = 0;
                }
            }, this);
        } while (loopForInstantATB === 1);
        //==============================
        //END OF THE ATB LOOP
        //=============================
        this.refreshStatus();
    };


It's crystal clear and obvious that the whole status window's redrawn per BattleManager.increaseAtbGauges, which can be run per frame.


Except for extremely powerful machines, redrawing the whole status window per frame is extremely likely to lead to at least significant, if not just outright severe, constant lag and FPS drop.


In my machine(i7-3820 + 2 * 2GB DDR3-1333 + Asus GTX550Ti), redrawing the whole status window per frame led to about 12ms added load per frame even after I've updated the display card driver to the latest version leading to about 100% RMMV performance boost. For machines barely meeting the RMMV requirements, the added load can only be more.


I've benchmarked the time performance of this plugin in my machine and the final load per frame is 15ms with status window being redrawn per frame, which is just 2ms away from the final load per frame leading to detectable FPS drop. It's because the targeted FPS in RMMV is 60, which is under 17ms load per frame. For machines barely meeting the RMMV requirements, the final load of this plugin without redrawing the status window per frame will likely reach or even far exceed 17ms, leading to at least noticeable FPS drop.


Actually, just redrawing all actors' ATB bars will suffice. Even though it'll lead to the ATB bar description text being slightly ugly, it's still trivial compared to be much more serious performance issues.


The other parts of the status window will only need to be redrawn when at least 1 actor's refreshed. If the existing entry points for redrawing the whole status window, including BattleManager.refreshStatus and Scene_Battle.prototype.refreshStatus might be not enough, Game_Battler.prototype.refresh can be used as well to ensure all reasons of redrawing the whole status window are completed covered.


2 exceptions of this are that, when the maximum ATB bar length decreases and/or the ATB bar description text changes, the whole status window will have to be redrawn, otherwise the newly drawn ATB bars wouldn't completely cover the old one, and/or thenew text would just be drawn over the old ones, which would still remain drawn on the status window.


While more can be done when optimizing time performance here(like only redrawing an actor ATB bar when its maximum length increases, its colors change and/or its fill percent changes, which can lead to only 1ms added load per frame per actor ATB bar to be redrawn in my machine), the above performance optimization alone should  make this plugin much more performant.
 
Last edited by a moderator:

Zanryu99

Warper
Member
Joined
Mar 16, 2016
Messages
1
Reaction score
0
First Language
English
Primarily Uses
Been looking around trying to find some helpful plugins and I have to say, this is my favourite so far!


I was wondering though - I'm thinking of a system where my game runs off a fatigue system, so you can perform attacks so long as you have the STAMINA available to you; having the ability to specify changes to the ATB level in each skill is great, but what I'd need to do is allow actions to be taken provided you have ANY of your ATB available, but have a wait time in between each action; then if/when ATB hits '0', your character is fatigued and can not act until ATB has recharged some.


my coding knowledge is very basic, and was self-taught about 6 years ago. If anyone could help me figure out how to do this in this plugin, that'd be wonderful!
 

Pazuzu10

Villager
Member
Joined
Apr 22, 2016
Messages
6
Reaction score
0
First Language
English
Primarily Uses
Good morning. I tried to get the plugin today, but the download doesn't have anything in it. It saves as a Javascript and it came right from the pastepin link on this post. Any idea what could be happening?


Couple days later: Never mind, I figured it out. 
 
Last edited by a moderator:

leap.campione

Villager
Member
Joined
Oct 27, 2015
Messages
6
Reaction score
0
Found out that the casting motion doesn't end well if Yanfly's Battle Engine Core is on.
 
 
Joined
Apr 30, 2012
Messages
216
Reaction score
35
First Language
Spanish
Primarily Uses
That is a compatibility problem... Patches seems to stop working when Yanfly update his battle engine.
 

CoolWill1984

Villager
Member
Joined
Aug 15, 2014
Messages
23
Reaction score
2
First Language
English
Primarily Uses
Do you happen to have another download of this. When I try to download it from pastebin my antivirus says it has a virus and removes it.
 

Forthright

Veteran
Veteran
Joined
Mar 9, 2016
Messages
60
Reaction score
10
First Language
English
Primarily Uses
Do you happen to have another download of this. When I try to download it from pastebin my antivirus says it has a virus and removes it.
Just click the link, copy and paste it all into Notepad + and save it as a .js
 

atmanSeijo

Veteran
Veteran
Joined
Apr 20, 2016
Messages
30
Reaction score
3
First Language
English
Primarily Uses
RMMV
Hey, so, I've come across a bit of a problem. I wanted to get rid of the Fight/Escape window altogether and instead give my characters an Escape skill that they can all use, that way it shows up in the main battle window. But having Display Fight/Escape set to 0 and Allow Escape set to 1 still shows the Fight/Escape window. If I set Allow Escape to 0, then the characters escape and the game just gets stuck on the empty battle screen. Is there a fix to this?


Ah, sorry. I tested it a bit more and I was able to get it to work, false alarm.
 
Last edited by a moderator:

HasuHasi

Learning every day
Veteran
Joined
Aug 15, 2014
Messages
48
Reaction score
3
First Language
English
Primarily Uses
Hey guys, I really like how this ATB system seems to work. I use a lot of the yanfly plugins and also used his ATB until now, but apparently he is not supporting it anymore. I especially like, that you can see, what the name of the skill is, that the enemy is charging. I was never able to do that with yanfly's ATB. So I've been thinking to switch to a different ATB system, like this one or maybe like VE. I'd love to be able to stick to the rest of the yanfly plugins though - if at all possible...


So my question is: Does this ATB work good in general? And is it compatible with the yanfly plugins? For exmaple: can I use the yanfly skill cooldown plugin together with this?
 

Solis

Veteran
Veteran
Joined
Oct 24, 2015
Messages
376
Reaction score
84
First Language
English
 





@HasuHasi I liked this one when it first came out.  I'm not sure if it is still supported to be honest. If it is, I'd recommend it, if it is not, I'd check out Victor's ATB. 
 
Last edited by a moderator:

HasuHasi

Learning every day
Veteran
Joined
Aug 15, 2014
Messages
48
Reaction score
3
First Language
English
Primarily Uses
@Solis Thanks for your input. Today I tried VE ATB, but I couldn't get it to work with Yanfly library. When I install VE BasicModule it's still compatible. But as soon as I activate the VE_ATB it stops working (I get the error message that I cant use VE BasicModule with Yanfly BattleEngineCore). 


So next I tried Ellye's ATB and until now it works just fine with Yanfly's things. I'll do some more testing the next days, but so far I'm optimistic. The only thing I'm missing is a ATB Charge Bar, but I guess I can live without it :)
 

Solis

Veteran
Veteran
Joined
Oct 24, 2015
Messages
376
Reaction score
84
First Language
English
I am using Yanfly's ATB and I have ran into zero issues so far. Hope that helps. 
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Posts

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,195
Members
137,773
Latest member
Kirakirna
Top