RMMV [YEP] Skill Cooldown and Dynamic Cooldown Reduction

MarxMayhem

Veteran
Veteran
Joined
Apr 17, 2020
Messages
214
Reaction score
226
First Language
Filipino
Primarily Uses
RMMV
As title says.

If you know League of Legends, I'm basically asking to recreate the same function. For those who don't know: Playable characters in League of Legends have active abilities that go on cooldown after use. However, there are parameters that can lower the number of seconds that skills will be on cooldown after use. For the purpose of RPG Maker, we have this in turns.

Now, YEP's Skill Cooldown plugin *does* have a feature I can use to achieve this in the <Global Cooldown Duration: x%> and <Global Cooldown Rate: x%> tags, but I have issues with them, namely:
  • They do not have a maximum limit. In League, the maximum CDR you can have is 40%, with an ability that allows it to be 45% instead. The maximum limit exists in League as a game-balancing check, and I would like to have it for the same purpose as well.
  • These tags calculate multiple values multiplicatively, unlike in League where it is calculated additively. This can make the Duration tag super powerful and the Rate tag very weak.
  • The final result does not round off the decimals. I would have no issue with this if I am using a time-based battle system, but I am not using one. As a result, using a skill and then seeing those decimals takes me out of it, and I presume players would be as well. Managing CDR is something the players will be able to do, and it feels like cheating to withhold them from using a skill just because the final cooldown had a decimal, and regardless of a decimal's value, it will always be treated as 1 more turn.
tl;dr I'd like a cooldown system that 1) reduces cooldowns based on percentage, where 2) I can impose a maximum limit on that percentage, 3) have values affecting this be additive and 4) round off values as necessary. I thought I could use Lunatic Mode to achieve this or solve some of my gripes, but I remember that I don't know JavaScript. As such, I plead to the great knowledge of this community.

TIA, Marx
 

MarxMayhem

Veteran
Veteran
Joined
Apr 17, 2020
Messages
214
Reaction score
226
First Language
Filipino
Primarily Uses
RMMV
Bump. Hoping that someone is making a variable-related solution to my concern.

In the meantime, I was looking for alternatives. I was made aware of the toFixed() function, which is supposed to adjust (and even remove) decimals from a result. I have no idea how to apply this in the <Cooldown Eval> tag, so advice is appreciated.

TIA
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,936
Reaction score
3,137
First Language
English
Primarily Uses
RMMV
There are problems with changing a few of your issues.
  • They do not have a maximum limit. In League, the maximum CDR you can have is 40%, with an ability that allows it to be 45% instead. The maximum limit exists in League as a game-balancing check, and I would like to have it for the same purpose as well.
  • These tags calculate multiple values multiplicatively, unlike in League where it is calculated additively. This can make the Duration tag super powerful and the Rate tag very weak.
The problem is that there isn't one central place that all of the cooldown modifiers for an actor are collected, calculated, and then applied. If there were, it would be pretty straightforward to say "add these instead of multiplying."

But the code goes through a list of things that could be affecting the actor and applies the tags from each one sequentially. That means the code has no way of knowing whether there will be more than one tag to apply, nor what their values might be.

So, from my initial glance through the plugin, implementing these would take a significant rewrite of how the cooldown modifiers are handled and applied. I don't know if there's another cooldown system plugin that handles things differently, that should be easy to Google.
  • The final result does not round off the decimals. I would have no issue with this if I am using a time-based battle system, but I am not using one. As a result, using a skill and then seeing those decimals takes me out of it, and I presume players would be as well. Managing CDR is something the players will be able to do, and it feels like cheating to withhold them from using a skill just because the final cooldown had a decimal, and regardless of a decimal's value, it will always be treated as 1 more turn.
This isn't fixed by correctly selecting it in the Time Based plugin parameter? If you say no, I'll look into it because that would be a bug, but if you select NO (false) in that parameter, everything should already be calculated as whole turns.
 

MarxMayhem

Veteran
Veteran
Joined
Apr 17, 2020
Messages
214
Reaction score
226
First Language
Filipino
Primarily Uses
RMMV
This isn't fixed by correctly selecting it in the Time Based plugin parameter? If you say no, I'll look into it because that would be a bug, but if you select NO (false) in that parameter, everything should already be calculated as whole turns.
I have it set to false/NO by default. I toggled the switch to true, and then back again just to be sure, and results are the same. Mine is v1.12 if that makes a difference.
The problem is that there isn't one central place that all of the cooldown modifiers for an actor are collected, calculated, and then applied. If there were, it would be pretty straightforward to say "add these instead of multiplying."
I guess my expectations were improperly set, as I found that a similar effect can be done with damage formulas using the Buffs & States Core plugin. I thought this could be achieved, even if other plugins have to be involved.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,936
Reaction score
3,137
First Language
English
Primarily Uses
RMMV
Try going to line 1145 and changing it to say
Code:
return Math.round(value);

If that gives you an initial integer value for your cooldowns but then they change to decimals as they go, you may need to do the same thing on line 1315.

But honestly, I don't see a use for you using rate modifiers in a non-tick-based system...but I could be wrong and not have thought it through sufficiently. I haven't used the plugin personally.
 

MarxMayhem

Veteran
Veteran
Joined
Apr 17, 2020
Messages
214
Reaction score
226
First Language
Filipino
Primarily Uses
RMMV
But honestly, I don't see a use for you using rate modifiers in a non-tick-based system...but I could be wrong and not have thought it through sufficiently. I haven't used the plugin personally.
I'm not a big fan of making skills that passively increase/decrease cooldowns by flat amounts. I guess you can call it my discipline in balancing combat- weaker skills that are affectable by skill cooldowns should not benefit from it as much as stronger skills.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,936
Reaction score
3,137
First Language
English
Primarily Uses
RMMV
I'm not a big fan of making skills that passively increase/decrease cooldowns by flat amounts. I guess you can call it my discipline in balancing combat- weaker skills that are affectable by skill cooldowns should not benefit from it as much as stronger skills.
Well, here's the problem. You have skills that go on cooldown when you use them, and you only want integer values that indicate how many combat turns they're cooling down for.

If you use an effect that changes the rate, and you don't want to allow decimal values, won't that force it to either not reduce in cooldown from turn to turn, or skip turns on its display? Either of which would be probably more odd to the player than seeing decimal values.

But, as I say, I've only read portions of the code and haven't actually used the plugin, so I might misunderstand how some of it works.

In any case, did the above fix work?
 

MarxMayhem

Veteran
Veteran
Joined
Apr 17, 2020
Messages
214
Reaction score
226
First Language
Filipino
Primarily Uses
RMMV
In any case, did the above fix work?
Right. I got hasty in responding to your other questions. Unfortunately, no. I only changed line 1145, but the result was skills never went to cooldown after use.
If you use an effect that changes the rate, and you don't want to allow decimal values, won't that force it to either not reduce in cooldown from turn to turn, or skip turns on its display?
Actually, my testing using the Rate tag was that the skill cooldown was multiplied to the rate modifier, and then that becomes its new cooldown with it properly counting down turns. (i.e. 10-turn cooldown with 45% cooldown rate = 4.50 CD, which counted to 3.50 CD, 2.50 CD, etc.). I figured that if I can't have my desired idea to work, I may as well try to get this to work instead.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,936
Reaction score
3,137
First Language
English
Primarily Uses
RMMV
Okay, it's cool that it works dynamically that way.

I'll take another poke at it sometime tomorrow, see if I can find where to get the initial (modified) cooldown to snap to an integer.
 

MarxMayhem

Veteran
Veteran
Joined
Apr 17, 2020
Messages
214
Reaction score
226
First Language
Filipino
Primarily Uses
RMMV
Reviving this thread because somehow I tried to address this again as of late.

Not gonna worry about the cap for now, but I had the idea of just using Lunatic Mode and checking for states and use the Math.trunc() function to get that decimal-less result I'm looking for. It's... not going well for me. Here's the code I used:
JavaScript:
<Cooldown Eval>
var cdreduce = 0;
if (user.isStateAffected(cd1)){
var cdreduce += 0.2;
}
if (user.isStateAffected(cd2)){
var cdreduce += 0.2;
}
if (user.isStateAffected(cd3)){
var cdreduce += 0.2;
}
if (user.isStateAffected(cd4)){
var cdreduce += 0.2;
}
var basecd = 10;
cooldown = Math.trunc(basecd - (basecd * cdreduce);
</Cooldown Eval>
I appreciate anyone's time with this.
 

caethyril

^_^
Global Mod
Joined
Feb 21, 2018
Messages
3,803
Reaction score
2,864
First Language
EN
Primarily Uses
RMMZ
var cdreduce += is a syntax error. var declares a new local variable: you only need it the first time. Also, the cd1, cd2, etc values don't seem to be defined.

Try something like this instead:

<Cooldown Eval> var baseCD = 10; var r = 1; if (user.isStateAffected(10)) r -= 0.2; if (user.isStateAffected(11)) r -= 0.2; if (user.isStateAffected(12)) r -= 0.2; if (user.isStateAffected(13)) r -= 0.2; cooldown = Math.trunc(baseCD * r); </Cooldown Eval>
Plugin link for ease of reference:
 

MarxMayhem

Veteran
Veteran
Joined
Apr 17, 2020
Messages
214
Reaction score
226
First Language
Filipino
Primarily Uses
RMMV
Also, the cd1, cd2, etc values don't seem to be defined.
Those were just placeholders for state IDs. Apologies for the confusion. :elswt:

<Cooldown Eval> var baseCD = 10; var r = 1; if (user.isStateAffected(10)) r -= 0.2; if (user.isStateAffected(11)) r -= 0.2; if (user.isStateAffected(12)) r -= 0.2; if (user.isStateAffected(13)) r -= 0.2; cooldown = Math.trunc(baseCD * r); </Cooldown Eval>
This works as how I want it! My cooldown system would be more robust than what I posted, but this is exactly what I need to get started. You are my favorite person at this moment~
 

Latest Threads

Latest Posts

Latest Profile Posts

A shotgun is not a rifle. Huh.
SIGH its so hard to convince my friend that making a game for fun and making one to sell takes different planning. I don't care about weird bothersome ways of doing things in a game made for fun, but when you are planning to market it, there is some stuff that you just have to streamline or cut out.
It might be a little bit boring and tedious, but building that database of armor, items, weapons and skills are super important.
More words of wisdom: Trying to make everyone happy will just make you miserable.

Forum statistics

Threads
124,384
Messages
1,163,260
Members
163,184
Latest member
282065
Top