Up until now, I've had the counters in my game set up so that the proc rate scales off a stat (e.g. Agility). After replaying Fire Emblem though, I'm thinking of making it so that counters only/always procs when the counterattacker's Speed is greater than the offending unit. Also, I was wondering if it's reasonable for units to be able to counter units attacking from the sides. Counters from the front make sense, while counters from the back don't make sense. But what about counters from the side though? And how could I go about accomplishing this? Not the directional stuff, just the Speed check to determine if a unit is fast enough to counter another unit. Also, is this a good idea in general? Cuz I'm systematically trying to remove aspects of RNG from my project.
Non-RNG Counters
Game Mechanics DesignI have no idea what plugin or event or where you're doing this, but wouldn't it simply be to the effect of
(which is not how Fire Emblem does it, but you did say it was just inspired conceptually)
Code:
if (b.agi>a.agi)
Maybe you could give your units a penalty during the counter calculations depending on where the attack is coming from?
So for example, if you have
Unit A with 100 Speed
and
Unit B with 75 Speed
Unit B attacking Unit A from the Front:
100 > 75 = Unit A will counter
Unit B attacking Unit A from the Side:
80 (-20% penalty) > 75 = Unit A will counter
Unit B attacking Unit A from behind:
50 (-50% penalty) > 75 = Unit A will NOT counter
No matter how you end up doing it, please do NOT make general counterattacks based off RNG.
That's more annoying than anything.
Leave RNG stuff like that to specialised perks or something (even then it's iffy but more tolerable).
So for example, if you have
Unit A with 100 Speed
and
Unit B with 75 Speed
Unit B attacking Unit A from the Front:
100 > 75 = Unit A will counter
Unit B attacking Unit A from the Side:
80 (-20% penalty) > 75 = Unit A will counter
Unit B attacking Unit A from behind:
50 (-50% penalty) > 75 = Unit A will NOT counter
No matter how you end up doing it, please do NOT make general counterattacks based off RNG.
That's more annoying than anything.
Leave RNG stuff like that to specialised perks or something (even then it's iffy but more tolerable).
I don't believe all RNG is inherently bad but I can understand why having less/no RNG makes things easier to balance as well as less frustration for players when screwed by bad RNG. We've all missed that shot in Xcom with a 98% chance to hit the target while standing 1 square in front of them.
But in regards to countering from the side. At the end of the day, it's a game. It doesn't have to be deep-rooted in realism and make sense. How do counters work in your game? In Fire Emblem "counters" worked as direct attacks right after receiving an attack. Though all units would counter back 1 atack, any additional attacks would come from their advantage in speed stat or certain special weapons. In Final Fantasy Tactics counters are a single attack after an enemy unit attacks you. In RPG Maker, default counters will block the attack completely and then counter with an attack. In Disgaea, counters are an entire stat on their own. And each point will allow you a counter attack after being attacked which can chain off of itself. So you can counter-counter and then counter-counter-counter.
So ditch the idea that counters can't work from the side or back because it doesn't make sense. And instead make it fun.
As to determine how to determine if a unit can or can't counterattack. I honestly feel your original formula of having it scale off the unit's agility is fine. Though, you could go FFT route and make it an ability that you have to know. Or make it like Fire Emblem where if A speed is X points higher than B speed, you will always get an extra attack. Or Disgaea and make how many counterattacks you get a stat itself. There are many ways you can go about it. How it fits best and the implementation is up to you. Just keep playtesting different strats. And if it feels more fun to get a bunch of counter attack combos off in one way over another, then go for that one.
Side note on direction facing mechanics. FFTA had it so attacking from the front had reduced accuracy, side normal accuracy, and back increased accuracy. While FFTA2 had it so attacking from the front dealt reduced damage, side normal damage, and back increased damage. So you could do something along the lines as well. Reduced/no counters from back, less counters from side, more counters from front.
But in regards to countering from the side. At the end of the day, it's a game. It doesn't have to be deep-rooted in realism and make sense. How do counters work in your game? In Fire Emblem "counters" worked as direct attacks right after receiving an attack. Though all units would counter back 1 atack, any additional attacks would come from their advantage in speed stat or certain special weapons. In Final Fantasy Tactics counters are a single attack after an enemy unit attacks you. In RPG Maker, default counters will block the attack completely and then counter with an attack. In Disgaea, counters are an entire stat on their own. And each point will allow you a counter attack after being attacked which can chain off of itself. So you can counter-counter and then counter-counter-counter.
So ditch the idea that counters can't work from the side or back because it doesn't make sense. And instead make it fun.
As to determine how to determine if a unit can or can't counterattack. I honestly feel your original formula of having it scale off the unit's agility is fine. Though, you could go FFT route and make it an ability that you have to know. Or make it like Fire Emblem where if A speed is X points higher than B speed, you will always get an extra attack. Or Disgaea and make how many counterattacks you get a stat itself. There are many ways you can go about it. How it fits best and the implementation is up to you. Just keep playtesting different strats. And if it feels more fun to get a bunch of counter attack combos off in one way over another, then go for that one.
Side note on direction facing mechanics. FFTA had it so attacking from the front had reduced accuracy, side normal accuracy, and back increased accuracy. While FFTA2 had it so attacking from the front dealt reduced damage, side normal damage, and back increased damage. So you could do something along the lines as well. Reduced/no counters from back, less counters from side, more counters from front.
Are counters granted through a skill? If so, I think it might be better to have them always proc. Countering is one of those things where if I have to equip it to use it, I'd like it to work every time. If not a skill, I don't see a need to sweat having agility factor into counter chance percent. A little RNG is not a bad thing.
A minor thing for others reading this, but I figure I'll point out that Speed in Fire Emblem doesn't actually influence countering enemies, but instead influences whether or not you get a second strike in battle. This works for if you're the target of an attack, or if you're the one attacking. So it isn't quite counter-related.
A minor thing for others reading this, but I figure I'll point out that Speed in Fire Emblem doesn't actually influence countering enemies, but instead influences whether or not you get a second strike in battle. This works for if you're the target of an attack, or if you're the one attacking. So it isn't quite counter-related.
the best approach would be to scale counter chance based on the difference between your stat and the enemy's stat, no?
like (your counter chance + your agility - their agility)% or something like that. adapted to the numbers your game uses.
that way the counter chance does increase for dedicated agility characters but can't get so high it breaks unless you're so overstatted that it's irrelevant.
maybe influenced by the angle of attack, 2x if attaking from the front, 0x if attacking from the back and 1x if flanked. that makes positioning important.
using breakpoints makes the game's difficulty jump around. if the counter goes from 0% to 100% when you reach an agility breakpoint you're basically saying you go from taking 50% more damage to dealing 50% more damage due to a couple points in agility.
you could also use conditional counters instead of guaranteed or RNG, like
-after using this attack you will counter all attacks for X turns
-if you end your turn without attacking you will counter all attacks until next turn
-the target of this skill will counter all attacks until it's turn comes
etc.
like (your counter chance + your agility - their agility)% or something like that. adapted to the numbers your game uses.
that way the counter chance does increase for dedicated agility characters but can't get so high it breaks unless you're so overstatted that it's irrelevant.
maybe influenced by the angle of attack, 2x if attaking from the front, 0x if attacking from the back and 1x if flanked. that makes positioning important.
using breakpoints makes the game's difficulty jump around. if the counter goes from 0% to 100% when you reach an agility breakpoint you're basically saying you go from taking 50% more damage to dealing 50% more damage due to a couple points in agility.
you could also use conditional counters instead of guaranteed or RNG, like
-after using this attack you will counter all attacks for X turns
-if you end your turn without attacking you will counter all attacks until next turn
-the target of this skill will counter all attacks until it's turn comes
etc.
Ah, I see... I was going about my approach all wrong. I was trying to implement the aforementioned mechanics via Yanfly's ExtraParamFormula and/or CounterControl plugins. Instead, what I really needed to do was hardcode the conditional:
JavaScript:
BattleManagerTBS.processCounterAttack = function (targets, subject, action) {
if (!action) return;
this.setCursorCell(subject.getCell());
targets.forEach(function (entity) {
if (entity) {
var dist = LeUtilities.distanceBetweenCells(subject.getCell(), entity.getCell());
if (dist <= 1 && action.isPhysical() && entity.battler().luk > subject.battler().luk) {
var skill = $dataSkills[entity.battler().attackSkillId()];
entity.battler().clearResult();
entity.lookAt(subject.getCell());
entity.addTextPopup("Counter");
entity.startSequence("counter");
this.forceAction(skill, entity);
}
}
}.bind(this));
};
I mean...there's really no need to do any of that, you can just put it into Counter Control if you're using that.
Code:
<Counter Condition>
Eval: defender.agi>attacker.agi
</Counter Condition>
In my game, yes. I utilize Skill Slots in my project. There are a variety of "Counter Skills" available to the player, but only 1 Counter skill can be equipped at any time.
Oh, I totally didn't see that example in the plugin help! Hmm, I would have to set the Counter chance to 100% then, right? I imagine I would also have to put that conditional on every single Counter skill?
if (dist <= 1 && action.isPhysical() && entity.getDir() != subject.getDir() && entity.battler().luk > subject.battler().luk) {Edit2: What are people's thoughts on RANGED Counters? Should they work differently? Should they even be a thing?
Ranged fighters can have ranged counters for sure. Up to you if you want to include a skill like Fire Emblem Heroes' "Distant Counter" skill, which allows one to counter at range if they normally couldn't.
If it's fun, I like it. Ranged counters are cool. Makes not a whole lot of sense but it's badass. You could go the Xcom route and do it Overwatch style. Where ranged attacks will only counter/fire if you're in a certain state and an enemy walks into your range/line of sight. Or have it like FFT and if you have the Counter: Arrow/Range/Magic you will counter attack back (assuming the enemy attacking unit is within your attack range). Or make it not counterable and leave it at that or maybe only certain ranged weapons can counter back. A big ballista crossbow that you have to reload, crank, pull back, and fire might not be as good as say a Quick Draw McGraw Pistol of Neverloading would be at shooting back a ole 1-2.
I think it [Ranged Counters] does make sense, because it doesn't necessarily mean you've blocked then countered with the same arm like with certain martial art moves.
But rather it's the concept of a counter attack, which is simply a response to another's attack.
So I think it's a good idea, and I don't see how it wouldn't make sense even 'realistically'.
But rather it's the concept of a counter attack, which is simply a response to another's attack.
So I think it's a good idea, and I don't see how it wouldn't make sense even 'realistically'.
Tactics Ogre LUCT adds a lot of things to balance out counters.
Even though they're 100% chance in all valid circumstances, you can still outrange and knockback in multiple ways. They take significant investment to deal comparable damage to regular attacks, and still take the front facing penalties. Furthermore, the act of countering itself adds Wait, leading to a soft stunlock if the enemy can gang up on you without you preparing accordingly.
All of these make counters more useful for secondary effects like applying weapon debuffs, or specifically punishing squishy snipers.
Even though they're 100% chance in all valid circumstances, you can still outrange and knockback in multiple ways. They take significant investment to deal comparable damage to regular attacks, and still take the front facing penalties. Furthermore, the act of countering itself adds Wait, leading to a soft stunlock if the enemy can gang up on you without you preparing accordingly.
All of these make counters more useful for secondary effects like applying weapon debuffs, or specifically punishing squishy snipers.
I've been down this rabbit hole and had the system made so every hit, the enemy would counter. And countering was a different element so some party members specialized in that etc etc etc.
Made encounters more dangerous because of the whole, every hit I do I take damage as well thing. Biggest issue I had was showing counter damage and how threatening it was. also I couldn't get it to target the proper actor for a counter.
Made encounters more dangerous because of the whole, every hit I do I take damage as well thing. Biggest issue I had was showing counter damage and how threatening it was. also I couldn't get it to target the proper actor for a counter.
I'm not arguing that it's not a perfectly acceptable idea, but as far as realism goes: if we're, say, two archers, standing there shooting at each other, in game terms that's us hitting Attack on our turn.
There's nothing you can do that will allow me to nock an arrow and get an extra shot at you faster than I could otherwise. Thus, there's no such thing as a counter attack.
In mêlée, there are maneuvers where you might combine your body's movement of dodging an attack with a swing back at the person, or use one motion to parry a blow and stab toward them. That is an attack that was enabled by what they did - a counter.
Maybe "follow-up attack" would be a more accurate term then?
it makes a little more sense in cover shooters. Firing in the general direction of where you were just shot from is a thing.
Maybe? But you're still making the same number of shots whether you're standing and aiming or firing blindly, you're not getting more opportunities to hit because of your opponent's attack. *shrug*
Ok, a few more questions regarding Counters. I plan to have several different Counter skills in the game. Some will be melee, others will be ranged, while the rest will be spells. Anyway, I currently have it so that Counters only trigger if the defender's Speed is greater than the attacker's Speed. One of my questions is: Should all attacks potentially trigger Counters? For example, should a magical Counter skill such as "Counter Burn" trigger from a physical strike at melee range? Should a ranged physical Counter skill like "Counter Shot" trigger from a physical melee attack? How about a ranged magical attack? What about a melee magical attack? Etc... 😅
tl;dr
Should I make a single all-encompassing rule for Counter requirements? Or should each Counter skill have its own requirements? Or should the attack triggering the Counter dictate what kind of Counters can trigger?
Edit: Should AoE attacks trigger Counters?
tl;dr
Should I make a single all-encompassing rule for Counter requirements? Or should each Counter skill have its own requirements? Or should the attack triggering the Counter dictate what kind of Counters can trigger?
Edit: Should AoE attacks trigger Counters?
I don't think it's a good idea for aoe to trigger counters. Sequentially resolving them will take way too long, and if there are different kinds of counters then processing them all at once is probably information overload. It's kinda fun when you aoe your allies and turn them into miniguns, but there aren't many fun, balanced ways to work it.
I'm a big fan of unique requirements, but even just the physical/magic division is tricky to make counters generally useful. Do you have any particular forms of active defense? Parry, Cover, etc? I think it would be good to frame what situations have active defenses play a bigger part, and what situations have counters take the spotlight.
Original thread: https://forums.rpgmakerweb.com/threads/non-rng-counters.148762/