[DYNRPG] BATTLE: ATB OVERHAUL!

Formerly Advanced Faster ATB 2

========================================================================
ATB OVERHAUL (formerly Advanced Faster ATB 2) v1.7
For RPG Maker 2003 with DynRPG v0.20 or higher
By PepsiOtaku
========================================================================

This patch allows you to control the speed calculations of party members and monsters independently, in turn controlling the speed of ATB bar. It uses the formula:

************************************
(ActiveSpeed or WaitSpeed) + ((AddValue * Agility) * (HeroSpeed or MonsterSpeed))
************************************

The maximum value the ATB Speed can be is 30000, which will trigger the battler's next action. The AddValue is a hard-coded number you set within the DynRPG.ini file. 300 is the recommended value, but you can decrease/increase this value to your desired result. The SpeedVar is a multiplier that you can set via variable from within RPG Maker.

The formula gets calculated a few times a second, so if you set your AddValue to 125 & the SpeedVar to 12, while the agility is 20 (multiplying to 30000) you would get an instantaneous ATB bar (which also makes things a little easy) forcing each party member's action. The lower the AddValue, the higher your SpeedVar value needs to be.

While you can't technically "stop" the ATB bar using that formula, you can set the SpeedVar to a negative value in RPG maker, which would make the ATB bar go backwards in game until it hits 0 and remains there until the SpeedVar is changed again.


What's NEW:

* v1.7: Fixed a bug in condition_speed_check where speed wouldn't reset when condition wore off (like a Berserk condition where speed increases)

* v1.6: More bug-fixes, StartInWaitMode, OnlyShowCommandWhenFocused, FixSelectionBarHeight, new recommended AddValue & ActiveSpeed, improved this readme hopefully

* v1.5: More tweaks and bug-fixes!

* v1.4: More bug squashing. Prevented the ATB bars from moving while any selection windows are open, with the exception of command and party member selections

* v1.3: Squashed hopefully the last bug--added more checks in the onBattleStatusWindowDrawn code.

* v1.2: Squashed some bugs. Added the ability to halt & resume via comment command

* v1.0: Added "FreezeSwitch" which will freeze all actions when turned on. You MUST turn this off again when you are done.

* v1.0: Added "WaitSpeed" which will set the Wait speed to a value, similar to "ActiveSpeed."

Installation

To install the plugin, make sure that you have patched your project with cherry's DynRPG patch which can be found here:
http://share.cherrytree.at/showfile-24504/dynrpg_0_31_05_26_2016.rar (Link for 0.31 - latest)
http://www.rewking.com/dynrpg
http://cherrytree.at/dynrpg

1. Copy the "battle_atb_overhaul.dll"into the DynPlugins folder of your own project.

2. Add the following (between the asterisks) to your DynRPG.ini

**********************************************


[battle_atb_overhaul]
; Starts the game (or test play) in Wait Mode instead of Active mode (Active is 2k3's default)
StartInWaitMode=false
; In Alternative mode, only show the command window (Attack/Magic/etc) when a hero has been selected
OnlyShowCommandWhenFocused=false
; FixSelectionBarHeight makes the selection bar height 16px instead of 15px in Command, Item & Skill windows.
; It might look better depending on your SystemSet or preference
FixSelectionBarHeight=false
; Switch ON = Active, Switch OFF = Wait
ATBmodeSwitch=4004
; ...(ActiveSpeed or WaitSpeed) + ((AddValue * Agility) * SpeedVar)...
; Default = 300
AddValue=300
; Set MultiplyAgility to false to change the formula to ...Base ATB Speed + (AddValue * SpeedVar)...
MultiplyAgility=true
; Master Variables. The 12 variables starting with BattlerStartVar get set to these
HeroSpeedMasterVar=4001
MonsterSpeedMasterVar=4015
; Heroes Require 4 vars: BattlerStartVar+0,+1,+2,+3
; Monsters Requires 8 vars: BattlerStartVar+4,+5,+6,+7,+8,+9,+10,+11
BattlerStartVar=4041
; Default multiplier values
DefaultHeroSpeed=3
DefaultMonsterSpeed=3
; ActiveSpeed default = 50. 100 is RM2k3's default speed, so it's recommended to set less
; so that modifiers would be more precise. Setting to 0 would always force WAIT mode.
ActiveSpeed=50
; WaitSpeed default = 0. Set to the same value as ActiveSpeed to force ACTIVE mode.
WaitSpeed=0
; Switch that will freeze the ATB bars if turned on
FreezeSwitch=4048
; Add condition exceptions here, separated by commas (ex: CondtionException=7,8,12,13)
; This will prevent the ATB bar from moving while a condition has "No Action Allowed"
ConditionExceptions=

**********************************************


3. Set "StartInWaitMode" to true to start the game (or test play) in Wait Mode instead of Active mode (Active is 2k3's default)

4. Set "OnlyShowCommandWhenFocused" to true to only show the command window when a hero has been selected (special feature of this plugin)

5. Set "FixSelectionBarHeight" to true to make the selection bar height 16px instead of 15px in Command, Item & Skill windows. If you don't know what this means, leave it at false, but this might look better depending on your SystemSet or preference.

6. Set "ATBmodeSwitch" to the switch value of your choice to change the ATB mode by switch. Switch ON = Active, Switch OFF = Wait

7. "AddValue" is for speed calculations (See top paragraphs). This can be set to any value between 0 and 30000, but you must figure out how this would affect the ATB formula.

8. Set "MultiplyAgility" to false to remove Agility from the formula, making it:
(ActiveSpeed or WaitSpeed) + (AddValue * (HeroSpeed or MonsterSpeed))

9. Change "HeroSpeedMasterVar" to the Variable ID of your choice. This variable controls the Master Speed multiplier for party members. 4001 is the default.

10. "Change MonsterSpeedMasterVar" to the Variable ID of your choice. This variable controls the Master Speed multiplier for monsters. 4015 is the default

11. Change "BattlerStartVar" to the Variable ID of your choice. 12 variables starting from here will be used for the ATB speed multipliers of individual battlers. The first 4 will be for battlers (4041-4044) while the last 8 will be used for monsters (4045-4052)
Example naming scheme:
4041:DynRPG-Hero1Speed
4042:DynRPG-Hero2Speed
4043:DynRPG-Hero3Speed
4044:DynRPG-Hero4Speed
4045:DynRPG-Monster1Speed
4046:DynRPG-Monster2Speed
4047:DynRPG-Monster3Speed
4048:DynRPG-Monster4Speed
4049:DynRPG-Monster5Speed
4050:DynRPG-Monster6Speed
4051:DynRPG-Monster7Speed
4052:DynRPG-Monster8Speed

12. Change "DefaultHeroSpeed" & "DefaultMonsterSpeed" to the default multiplier value of your choice. I use "3" but you can change this to whichever multiplier works best for you.
NOTE: "0" would override the whole formula, and use RM2k3's default ATB speed if you wish to do so
EXAMPLE: Say you have a menu that has "Battle Speed" from 1-5 where 1 is slowest and 5 is fastest. Using this plugin, you can scale the battle speed to something that feels right to you for each of those settings, and use the DefaultHeroSpeed/DefaultMonsterSpeed variable in the menu itself.

13. Set "ActiveSpeed" to a value less than or equal to 100 (100 is rm23k's default speed). This will change the overall speed.

14. Set "WaitSpeed" to a value other than 0 if desired.

15. Set "FreezeSwitch" to a Switch ID of your choice. When turned on, this will freeze the battle until the switch has been turned off again.

16. Set "ConditionExceptions" to the condition IDs that are set to "No Action Allowed", separated by commas (example: CondtionException=7,8,12,13). When a party member becomes afflicted with one of these, their ATB bar will be reset to 0 (as it's frozen) and will not increment whatsoever.


Instructions

This plugin takes three commands:
@init_hero_speed:
Reinitializes the 4 hero variables to the value of the Master Hero Variable
(this is done automatically at the start of battle)

@init_monster_speed:
Reinitializes the 8 hero variables to the value of the Master Hero Variable
(regardless of how many monsters there are, since it doesn't matter)
(this is done automatically at the start of battle)

@condition_speed_check p1, p2, p3, optionalText
p1: Condition ID
p2: Altered hero speed value
p3: Altered monster speed value
optionalText: This can be anything and has no meaning other than to tell you what condition is being checked
Using the technique documented below, this will check for a specific condition (p1) and if a hero/monster has that condition, their speed will be altered to hero's value (p2) & monster's value (p3) respectively. You can add text after the 3rd parameter for easy reference to the condition you're checking for. (example: @condition_speed_check 5, 10, 10, BERSERK) would set the hero's SpeedVar & monster's SpeedVar to 10 if they have condition 5 (Berserk in my case).

@halt_atb:
If in Wait mode, sets ATB to value of WaitSpeed in DynRPG.ini. If in Active mode, sets ATB to ActiveSpeed. This allows you to pause the ATB for custom skill events.

@resume_atb:
If the ATB is halted via "halt_atb," this resumes it to its default of "100."

TO ADD EASY CONDITION SPEED MANAGEMENT (recommended):
1. Create 2 additional variables (from the 14 requires by this plugin), call them something like "CondSpeed-Hero" and "CondSpeed-Monster"

2. Create a new Common Event called BATTLE-CondSpeeds (can be anything) & add the following (in this order):
<>Comment: 

<>Comment: ***LOWER PRIORITY CONDITIONS FIRST***
------
<>Variable Oper: [CondSpeed-Hero] Set, Var [HeroSpeedMasterVar]'s Value
<>Variable Oper: [CondSpeed-Hero] * #
(This can be any operation. Multiply by a negative number to make the ATB bar go slower.)
<>Variable Oper: [CondSpeed-Monster] Set, Var [MonsterSpeedMasterVar]'s Value
<>Variable Oper: [CondSpeed-Monster] * #
<>Comment: @condition_speed_check 3, V###1, V###2, CONDITION
(Where V###1 = CondSpeed-Hero & V###2 = CondSpeed-Monster)
-------


Repeat the 5 lines above for each condition, with lower priorities first, and higher priorities 2nd. This technique is a tad more complex than the previous condition_speed_check example, but it basically does the same thing, only it ensures the modified condition is relative to the current SpeedVar value (again, if you have a "Battle Speed" option in a menu somewhere)

3. In your Monster Groups, create two new pages with the following:
TRIGGER: Turns Elapsed [0] (first turn)

<>Call Common Event: BATTLE-CondSpeeds


TRIGGER: Turns Elapsed [1x+1] (every turn after the first one)

<>Call Common Event: BATTLE-CondSpeeds


4. Copy & Paste those pages into all of your battle events. This will run that common event at the start of every turn (it's very frequent) and set speeds accordingly. If you need to make changes from there, you'll need to edit that common event or develop your own technique!

Details

  • 159.1 KB
  • 408
  • 03/25/2024 09:34 AM

Actions

Posts

Pages: first prev 123 next last
Dang, hopefully it crashing only on longer playthroughs won't make it too much harder to establish cause and effect for that bug.
Fixed the bug! Big thanks to Milennin for testing! Download the latest version above or via github:

https://github.com/rewrking/battle_atb_overhaul
author=PepsiOtaku
Fixed the bug! Big thanks to Milennin for testing! Download the latest version above or via github:

https://github.com/PepsiOtaku/battle_atb_overhaul

So what was the nature of this bug, in case something like it comes up again?

Also, it sounds like the halt and resume commands that were added will help fix the issues that I brought up before, so I will have to give this another shot!
I don't know the complete nature of it to be honest, but this is my educated guess: it had something to do with the "selection" parameter in onBattleStatusWindowDrawn, where a condition would be checked for a hero that might not exist. Say you had 4 heroes during a battle, then before another battle, removed 2 heroes. Something would cause it to crash on the battle's startup... Again, I am not totally sure why the bug existed, but Milennin was basically able to reproduce it multiple times, so through some trial and error, I narrowed down the code to onBattleStatusWindowDrawn, and then made my if statements for condition checking more specific so it could never accidentally check for a hero that didn't exist.

It's definitely in my top 5 as far as pain-in-the-ass bugs go.
Note: All of the below is with "Active" mode turned ON.

Grrr...I think this update helps reduce the amount the ATBs fill unnecessarily while someone is in the middle of casting a spell or there is a long attack animation, but I am still getting the ATB filling really fast unexpectedly at times when you have a hero selected and you are choosing your "battle command".

This is especially apparent when all 4 heroes' ATBs are full and all the enemies do an attack and then in almost no time, they all start attacking again (enemies have an average/baseline speed stat too)!

Edit: I just recorded a video to help get the gist of what I'm talking about still. However, this time I didn't even need to have the battle command options highlighted. :/ (But I also just realized that this was after using a scripted ability with an animation, so it probably messed with your resume/halt functions...)

Main issues I'm having:

(1) ATB doesn't fill as quick as it should at the start of battle (this is not quite shown in this video because Ishio enters battle with a "First Strike")
(2) Enemy attacks will sporadically cause hero ATBs to begin filling quickly
(3) Enemy ATBs will go faster than intended when a "Battle Command" is highlighted in the menu but not chosen

Good Point: ATBs don't fill while the kind of long spell animation "Blaze Cannon" is shown.

Video that covers the main issues above:
https://youtu.be/-SxUidRrMQo

Video of enemies with OP ATBs after special skill/animation (described further above):
https://youtu.be/vSfx6xknEIQ

I probably need to use your halt/resume comment commands to handle scripted battle animations, no?

====

I've also noticed in the past that this plug-in needs a modification to avoid being able to exploit how the ATB for all actors continues to fill as a target is selected for a skill/item/attack but enemies do not attack! If the player actually fully exploits this, the speed stat no longer matters and you will almost be playing a true turn-based game since enemies and allies will get the same number of turns since you are forcing everyone's ATBs to full each time!
Active Mode gets a little hairy, but I'll try to explain as best as I can...

1: Change DefaultHeroSpeed & DefaultMonsterSpeed in DynRPG.ini to a value higher than 3. Might take some experimenting. Basically, you can use that to adjust the overall default speed, and then use HeroSpeedMasterVar & MonsterSpeedMasterVar followed by @init_hero_speed or @init_monster_speed for special conditions/scripting.

2: Basically, what you're seeing is the switch from the "ActiveSpeed" (probably 75 in DynRPG.ini) to the Default Speed (100). When a hero's ATB is full, the overall ATB speed slows down a little so enemies aren't overwhelming when you're trying to select your action. You can set ActiveSpeed=100 to eliminate this effect.

Admittedly, I probably coded/explained this in too confusing a way, but "halt_atb" & "resume_atb" should only be used for custom scripted actions (like steal/scan type of stuff). If you're in Wait mode, it halts the atb entirely, but if it's active mode, it uses the ActiveSpeed. If you want to freeze the atb during a cutscene or something in active mode, you need to use the "FreezeSwitch" in DynRPG.ini. I made a mistake in the documentation and have it as "confFreezeSwitch," so change that. Turn the FreezeSwitch ON at the start of your cutscene, and turn it OFF at the end of it.

3. Enemy ATBs are going faster than you'd expect due to their agility. Change MultiplyAgility=false if you don't want this effect. It was made for monsters with agility between 0-30ish. Both monsters and heroes should have around the same agility values. I basically remove any agility curves from my heroes and stick to bonuses from equipment or seeds. The reasoning for this has to do with the hit/miss fomula that 2k3 uses. Check out Craze's numbers guide for more info: http://rpgmaker.net/articles/371/

Admittedly, another oversight is that if you have a monster with a much higher agility, they'll be much faster. The thing is, agility isn't really that useful otherwise. I'll have to look into changing that formula so that you can use higher agility values without breaking it too much.

Regarding the target selection thing, don't monsters try to attack during that time anyway in active mode? I don't see how that's an exploit since you'll be taking damage.

Sorry it's so complicated! I usually write plugins to fit my needs in a caffeinated frenzy and forget to explain stuff.
This is currently what I have in my .ini.

; Switch ON = Active, Switch OFF = Wait
ATBmodeSwitch=4004

; ...Base ATB Speed + ((AddValue * Agility) * SpeedVar)...
; Default = 150
AddValue=10

; Set MultiplyAgility to false to change the formula to ...Base ATB Speed + (AddValue * SpeedVar)...
MultiplyAgility=true

; Master Variaibles. The 12 variables starting with BattlerStartVar get set to these
HeroSpeedMasterVar=4001
MonsterSpeedMasterVar=4015

; Heroes Require 4 vars: BattlerStartVar+0,+1,+2,+3
; Monsters Requires 8 vars: BattlerStartVar+4,+5,+6,+7,+8,+9,+10,+11
BattlerStartVar=4041

; Default multiplier values
DefaultHeroSpeed=25
DefaultMonsterSpeed=25

; ActiveSpeed default=75. 100 is RM2k3's default speed, so it's recommended to set less
; Setting to 0 would always force WAIT mode.
; WaitSpeed default=0. Set to the same value as ActiveSpeed to force ACTIVE mode.
ActiveSpeed=75
WaitSpeed=0

; Switch that will freeze the ATB bars if turned on
confFreezeSwitch=4048

; Add condition exceptions here, separated by commas (ex: CondtionException=7,8,12,13)
; This will prevent the atb bar from moving while a condition has "No Action Allowed"
; When a party member becomes afflicted with one of these, their ATB bar will be reset to 0 (as it's frozen)
; This was kind of a bug in Rm2k3. You could have a full ATB bar, but not be able to act, which didn't make sense
ConditionExceptions=7,9,17,20,24,29,43,44,45,51,53,58,59,60,61,62

author=PepsiOtaku
Regarding the target selection thing, don't monsters try to attack during that time anyway in active mode? I don't see how that's an exploit since you'll be taking damage.

I'm referring to target selection where you have your pointer displayed, selecting an enemy/target (probably what you thought I meant). However, they do not actually attack while you leave the game in this state.

author=PepsiOtaku
Enemy ATBs are going faster than you'd expect due to their agility.

All those enemies in the demo vids have AGI of 50, while everyone in the party had close to but greater than 50, so there isn't a HUGE differential.

author=PepsiOtaku
Change MultiplyAgility=false if you don't want this effect.
If I did this, should AGI have completely zero effect on the ATB speed then?
In your ini, just change confFreezeSwitch to FreezeSwitch. I'll look into the target select issue more when I get some time...
author=PepsiOtaku
In your ini, just change confFreezeSwitch to FreezeSwitch. I'll look into the target select issue more when I get some time...
Oh thanks! I double checked the source code, and I realized you had it programmed to check for "FreezeSwitch" in the .ini, not "confFreezeSwitch"!

EDIT: Actually, this didn't look like it changed anything, so is FreezeSwitch only activated manually? Like with the halt/resume commands (haven't tried those yet.)?
author=Shoobinator
Main issues I'm having:

(1) ATB doesn't fill as quick as it should at the start of battle (this is not quite shown in this video because Ishio enters battle with a "First Strike")
(2) Enemy attacks will sporadically cause hero ATBs to begin filling quickly
(3) Enemy ATBs will go faster than intended when a "Battle Command" is highlighted in the menu but not chosen

I'd like to add to #2 that this only happens when a "Battle Command" is highlighted in the menu but not chosen (similar to issue #3). This is an issue because someone's bar is full, but other bars go from the "reduced speed" to "full speed" when they are not supposed to. This sometimes happens when the enemy attacks while you have a command highlighted after selecting a fighter.
author=Shoobinator
EDIT:Actually, this didn't look like it changed anything, so is FreezeSwitch only activated manually? Like with the halt/resume commands (haven't tried those yet.)?


Yes, manually. See my long post from yesterday. Turn the switch on to freeze the atb bar, regardless of whether you're in active mode or wait mode--built for cutscenes. the halt/resume ones are for skills and things that need to rely on whether you're in active or wait mode. If active, halt will set the atb speed to ActiveSpeed, otherwise, will use the WaitSpeed.
Alright, issue #1 is resolved thanks to calling @resume_atb at the start of a battle! Issues #2 and #3 are possibly caused by the same or similar code with the battle command window.

And for clarity let me label issue #4 as:

(4) Enemies will not attack despite ATB bars being full while the player is currently selecting an enemy target. (This could be fixed by either letting the enemies attack during this state, OR by freezing the enemy AND hero ATBs (even if the ATB mode is "Active", which would make it feel less "Active" but would remove the exploit). I know that enemy ATBs fill while targeting because I can let them all attack, begin to target, deselect the command that targets, and then they will all immediately attack again. Again, this is exploitable because the enemies could all be ready to attack again while your party is far from ready, and you could then target an enemy and just wait to "equalize" everyone's ATBs.)

Also, of all these remaining issues, I would say that #3 is the worst, then #2, then #4, if you want to prioritize one over the other.
More fixes: https://github.com/rewrking/battle_atb_overhaul

I tightened up the Active mode quite a bit, and made a rule that if you have items, skills, or the target selection open, the atb bars will not fill. Also, if someone is attacking, the atb should pause briefly. Those 4 issues should be resolved. Let me know if you find anything else.
Hello,
I used for a while your first Faster ATB plugin and it worked well (the one with only one value to change).

Since you suggest me a while ago to upgrade and use this new plugin "battle_atb_overhaul" I tried it. But I had 3 issues.

1) As it was explained before, the values modifiers seem to work only when the first gauge has been filled which means the first turn is slower than the others.

It that a bug? Or is it normal?

2) The Battle Test Menu in the Database doesn't seem to use the value for "ActiveSpeed". I've set it to 1500 for test purpose and in game it fills super fast but not in the Test-menu.

3) Last but not least, I had a game breaking bug. Not sure how it happens but sometime I got stuck in battle on the attack window when a hero was ready to fight. His gauge was full. The window was opened but I couldn't even move on the commands (fight, magic, item). It seemed to happen after one of the heroes died in battle.

Thank you!
author=Boulon
3) Last but not least, I had a game breaking bug. Not sure how it happens but sometime I got stuck in battle on the attack window when a hero was ready to fight. His gauge was full. The window was opened but I couldn't even move on the commands (fight, magic, item). It seemed to happen after one of the heroes died in battle.


I have the same issue, it happens when a hero is killed while entering the command window by selecting the hero in gauge mode but he don't have picked a command yet. Maybe it happens because of the gauge mode? (I can't reproduce this bug with window modes)
I use gauge mode, you must be right.
First of all, I'd like to say this is a great tool and I'm pretty sure it can be helpful to me.

However, I am not quite sure how to use it. With or without the tool, the ATB seems the same speed throughout when I tried adjusting the AddValue. It defaults at 150, and when I switched it to 10, 100, 300, 500, 30000 etc. there does not seem to have an effect. Also, I can't find SpeedVar in RPG Maker 2003's database. I don't have any experience with Javascript that can be useful here, so if that is the answer, I might need a bit more detail.

Additional details: I used the default first four characters, all at Level 20 against the default enemy group Plains 1.

Thank you very much :)
I'm working on an update but still testing for bugs at the moment. I might be able to have that out by some time this coming week. The documentation is probably confusing as well, so I'm also going to try to break it down a little easier.

Latest version is here if you guys aren't already using this one but there's still some broken stuff as others have mentioned. Use for experimentation for now. https://github.com/rewrking/battle_atb_overhaul

As far as the formula goes:

(ActiveSpeed or WaitSpeed) + ((AddValue * Agility) * SpeedVar)...

ActiveSpeed/WaitSpeed: % of the default speed (0-100) & are values set in the ini. WaitSpeed should be 0 in most cases. ActiveSpeed is basicshould be 75 or 50. What I forgot to explain in the readme I think is that this is the speed of the ATB bars when another hero is ready to act. Otherwise, it'll use the rest of the formula.

AddValue: It's like a base multiplier, so you want to keep that low (between 150 and 300 is usually pretty good). If you make this higher, it's a pretty good idea to make ActiveSpeed lower.

Agility: What I did for Agility was keep it between around 5 and 25 for each of my characters and make it the same value for all levels, and only use various equipment or seeds to raise/lower it. I set Monster's agility at about 5-20 as well. It's kind of a garbage stat in 2k3's engine to begin with, so having it set really high doesn't serve much of a purpose.

SpeedVar: The 12 variables (4 heroes, 8 monsters) that get defined based on the HeroSpeedMasterVar & MonsterSpeedMasterVar at the battle's start, but can be manipulated mid-battle. You generally want to keep it small (between 1 and 5 for instance). DefaultHeroSpeed & DefaultMonsterSpeed assign those variables a default value at startup. If this is 0, then AddValue will also be 0 because math. :-/
Great news!! :) (I was afraid you gave up this plugin.)

By the way, it could be very useful if you make a simple plugin which allow to have "Wait" by default.
Personnaly I love very simple plugin that do one specific thing.
If you could do that I would be very grateful but maybe it's more difficult than I think.

Cheers!
author=Boulon
By the way, it could be very useful if you make a simple plugin which allow to have "Wait" by default.


You're in luck because that's already been code in the next version of this plugin. Basically so you can have wait enabled by default in test battle. :P
Pages: first prev 123 next last