Legend_of_the_Invincibles icon indicating copy to clipboard operation
Legend_of_the_Invincibles copied to clipboard

Cleave effect on enemy attackers

Open white-haired-uncle opened this issue 1 year ago • 15 comments

I don't think cleave is working properly for enemy attackers. And I suppose other attacks against them might also be affected, but that's just speculation at this point. When used by enemy attackers, cleave does hit multiple units, but the attacker does not suffer the lethargy it is supposed to. Its unit.variables.wrath is set to yes, and unit.variables.wrath_intensity is set to -=2, but its attacks are unaffected. It appears that the attack effect requires a latent_wrath attack.special.damage, which all of my units (that I've checked) have, but enemies (that I've checked) don't have. I believe latent_wrath may be set by wesnoth.update_stats() in lua/stats.lua, but before I go any deeper I want to stop and ask for any assistance.

[EDIT: (not included in below log) I edited a save and gave the Shadow Hound a latent_wrath on his attack specials. Sure enough, now when he attacks me his attacks actually suffer the penalty they are supposed to].

This is an example of a Shadow Hound hitting my Gryphon Rider with lethargy/cleave, FWIW. I assume the last five lines are from an attack_end event for cleave.

20230804 09:26:50 error wml: Shadow Hound-15165 has hit Elvish Scout-2191 with lethargy
20230804 09:26:50 error wml:     [lethargy x]: Subtracting 2 from wrath_intensity of Elvish Scout-2191 (had )
20230804 09:26:50 error wml:     [set wrath intensity]: Acting on Elvish Scout-2191
20230804 09:26:50 error wml:         [set wrath intensity]: Processing unit.attack[0]
20230804 09:26:50 error wml:             [set wrath intensity]: Checking latent_wrath for latent_wrath
20230804 09:26:50 error wml:             [set wrath intensity]: Setting 0 to -2
20230804 09:26:50 error wml:         [set wrath intensity]: Processing unit.attack[1]
20230804 09:26:50 error wml:             [set wrath intensity]: Checking latent_wrath for latent_wrath
20230804 09:26:50 error wml:             [set wrath intensity]: Setting 0 to -2
20230804 09:26:50 error wml: Shadow Hound-15165 has hit Elvish Scout-2191 with lethargy
20230804 09:26:50 error wml:     [lethargy x]: Subtracting 2 from wrath_intensity of Elvish Scout-2191 (had -2)
20230804 09:26:50 error wml:     [set wrath intensity]: Acting on Elvish Scout-2191
20230804 09:26:50 error wml:         [set wrath intensity]: Processing unit.attack[0]
20230804 09:26:50 error wml:             [set wrath intensity]: Checking latent_wrath for latent_wrath
20230804 09:26:50 error wml:             [set wrath intensity]: Setting -2 to -4
20230804 09:26:50 error wml:         [set wrath intensity]: Processing unit.attack[1]
20230804 09:26:50 error wml:             [set wrath intensity]: Checking latent_wrath for latent_wrath
20230804 09:26:50 error wml:             [set wrath intensity]: Setting -2 to -4
20230804 09:26:50 error wml: Shadow Hound-15165 has hit Elvish Scout-2191 with lethargy
20230804 09:26:50 error wml:     [lethargy x]: Subtracting 2 from wrath_intensity of Elvish Scout-2191 (had -4)
20230804 09:26:50 error wml:     [set wrath intensity]: Acting on Elvish Scout-2191
20230804 09:26:50 error wml:         [set wrath intensity]: Processing unit.attack[0]
20230804 09:26:50 error wml:             [set wrath intensity]: Checking latent_wrath for latent_wrath
20230804 09:26:50 error wml:             [set wrath intensity]: Setting -4 to -6
20230804 09:26:50 error wml:         [set wrath intensity]: Processing unit.attack[1]
20230804 09:26:50 error wml:             [set wrath intensity]: Checking latent_wrath for latent_wrath
20230804 09:26:50 error wml:             [set wrath intensity]: Setting -4 to -6
20230804 09:26:51 error wml:     [lethargy x]: Subtracting 2 from wrath_intensity of Shadow Hound-15165 (had )
20230804 09:26:51 error wml:     [set wrath intensity]: Acting on Shadow Hound-15165
20230804 09:26:51 error wml:         [set wrath intensity]: Processing unit.attack[0]
20230804 09:26:51 error wml:             [set wrath intensity]: Checking cleave for latent_wrath
20230804 09:26:51 error wml:         [set wrath intensity]: Processing unit.attack[1]

white-haired-uncle avatar Aug 04 '23 14:08 white-haired-uncle

Yes, and it's mostly intentional. The enemies would be easier, often too easy, if they used it. Also, the AI doesn't know how to use it sparingly, it would be easy to exploit by having the enemy fight a single target until he or she has enough lethargy to be far less dangerous.

Dugy avatar Aug 04 '23 16:08 Dugy

I can see that. I don't like that the docs don't reveal the fact that it only applies to non-ai though.

But, when I tested it, lethargy doesn't build up. After the first attack it's set to -2, then the next turn it halves to -1. If used again, it is set to -3, which "halves" to -1 on the next turn, etc. If it applied to each unit struck (or attempted to) I suppose it could build up, but it looks like it's done via attack end so only once per attack.

Also, doesn't the ai take into account damage, not base damage? So if it built up, at some point the ai should stop using it anyway.

P.S. Now that I think of it, the cleave penalty is probably way too low. Even being able to hit a second target is a huge gain compared to losing 2 damage on this turn's retaliation and 1 on next turn's attacks, except maybe in the case where you'll be hit by a LOT of enemies this turn, for all but the very weakest of units (looking at you, Cunctator).

I had always wondered if cleave did/should have a penalty when used against only one target. Now I know.

white-haired-uncle avatar Aug 04 '23 17:08 white-haired-uncle

But, when I tested it, lethargy doesn't build up. After the first attack it's set to -2, then the next turn it halves to -1. If used again, it is set to -3, which "halves" to -1 on the next turn, etc.

I think that's just the way it's rounded.

Also, doesn't the ai take into account damage, not base damage? So if it built up, at some point the ai should stop using it anyway.

Given that on every turn, lethargy would be divided by 2 and increased by a fixed value, the damage would asymptotically reach a stable state with lower damage than intended. In case of retaliatory attacks, it would be 150% of the lethargy value. In case of cleave, it would not be significantly lower, but in the case of explosive, it could make quite a difference.

Now that I think of it, the cleave penalty is probably way too low. Even being able to hit a second target is a huge gain compared to losing 2 damage on this turn's retaliation and 1 on next turn's attacks, except maybe in the case where you'll be hit by a LOT of enemies this turn, for all but the very weakest of units (looking at you, Cunctator).

That is possible. The reason why these penalties were added was that originally, one could use attacks like Lethalia's explosive faerie fire like artillery in modern warfare - normal units engage the enemy, get them to form groups, then artillery/Lethalia came and destroyed most of them, leaving the normal units to mop up the badly damaged survivors. Meanwhile, Lethalia was receiving large amounts of experience, becoming even stronger in the process. I 'fixed' it by removing experience from killing secondary targets, but players started disregarding Area of Effect attacks completely. It wasn't very good, but I didn't want to add a cooldown because one would just mass clear with a high damage normal attack on individual targets, using retaliation a lot, and use an explosive attack whenever a larger grouping of enemies forms. Eventually, I decided to use lethargy, because it significantly weakened the retaliation during the enemy turn, and didn't lead to tactics of staying back until the cooldown ended. So, the purpose of the lethargy was to limit the use of attacks that could kill large numbers of units like explosive, weaker specials like cleave or cone were not much of a focus of the penalisation.

Dugy avatar Aug 04 '23 23:08 Dugy

Normally, by about An Army is Born, Lethalia has explosive slow chill tempest, which does not have a lethargy penalty. So her and her dopps pretty much do nothing but cast explosive slow every turn, while the rest of the army does the actual killing, at half the cost/danger (actually less than half the danger, as slow protects units which have fallen back to heal). It's really not fair, there should at least be a lethargy penalty and probably something more extreme like a cooldown.

I didn't use to go down the blizzard path, as I already had chill tempest. But lately I've been using blizzard, which I think has the same "problem". The nice thing about blizzard is it slows about half the enemies on the map (for her, Efraim's seems much more limited in scope). This is particularly effective when Uria shows up with her "army" of toasters in Inferno. With E/L casting blizzard every turn, all I see is a sea of XP.

Logically, lethargy should have a cooldown period. If an attack is supposedly so tiring, you really shouldn't be able to attack (and retaliate) on the following turn(s) and still recover.

I also suspect that either lethargy should be assessed for every enemy affected by the attack, or wrath should not. I try to give Efraim and my scythemasters wrath to counter their whirlwind penalty. It seems like wrath should at most offset lethargy, but often the end result is that lethargy simply slows the growth of wrath. And even if lethargy and wrath were magically balanced, if wrath grows per hit, while lethargy grows per attack (even if adjusted for multiple enemies), wrath still gets a benefit of having an immediate benefit against the current enemy in an attack.

Which is a long way of saying that I think explosive slow (and storm as necessary) really should get lethargy, probably followed by other adjustments in the future once the practical effect of that change is better understood.

white-haired-uncle avatar Aug 05 '23 01:08 white-haired-uncle

Yeah, that makes sense. It would make sense to add lethargy to explosive slow, and more of it to storm attacks, and even more to blizzard (possibly to the point where it would behave almost as a cooldown attack without wrath-based mitigation and increased number of attacks).

Dugy avatar Aug 05 '23 10:08 Dugy

Until I started playing with this, I always took lethargy much more seriously than I should. Now that I've looked at it more closely, it's not much more than an annoyance (the attack penalty for things like whirlwind, not the attack special). Sure, it's devastating to a low level unit, but then how many of those have attacks with lethargy? I've been doing some testing with Lethalia's chill tempest which does 33 against orcs. With explosive slow set to use the same "dooming" lethargy (10) as (some) other explosive attacks, the penalty quickly converges to 9/19 (attack=lethargy-1 / defense=2*lethargy-1).

At first glance, it seems like lethargy should be something like

some magic number * base weapon damage * number of attacks / attacker level

(attacks being attacker hits + attacker misses, which takes into account both striking multiple units and units that die quickly so you don't have to hit them as much).

And it probably should be assessed at the time of hit/miss (like wrath), not at the end of a round of combat.

I do need to look into how lethargy interacts with wrath more closely before I quit caring about it for the most part. And I should remember to be thankful that I have this much time to overthink an obscure detail of a video game.

white-haired-uncle avatar Aug 05 '23 23:08 white-haired-uncle

Your formula makes sense, but it would not work well for attacks that have many attacks and lower damage, it would reduce their damage to zero. On the other hand, entirely without influence of the number of attacks, an explosive attack with a large number of attacks would incur little penalty to other attacks. I would think more about something like:

some attack-specific magic number * base weapon damage * (5 + number of attacks)

Dugy avatar Aug 06 '23 11:08 Dugy

I suppose any lethargy penalty that applies only to damage and not number of attacks is going to be unfair to someone. The less damage you do per attack, and/or the higher the number of attacks, for a given attack, the higher the penalty. The only alternative I can see is to apply the penalty as a mix of less damage per attack and less attacks.

Did I just stumble upon the other use for Executioners Axe, and maybe a couple similar, I wonder?

Right now I'm concentrating on what to do with explosive slow. Even if lethargy reduced the damage to zero, I'm going to abuse it by using it every turn. I'm not casting it for the damage, I'm casting it for the slow. And even if the number of attacks was reduced, all that does as far as I'm concerned is lower the chance to hit (only need one hit to slow, after that I don't care).

I started playing with "partial slow", where the slowing effect of explosive slow falls off with repeated use (halving each consecutive use, doubling each turn not used). An easier implementation might just be to have the chance to hit(/slow) adjacent units (something I don't like about AoE attacks in general) have a probability that falls off on repeated use. Or a cooldown.

I think An Army is Born is probably the classic example of abusing explosive slow. Have Lethalia take the Potion of Authority on turn 1 (or before, if you plan ahead), then use her and the dopps to do nothing but explosive slow and provide huge leadership so your undead can quickly advance. And the guard rooms. Either way, it feels kind of like cheating, so long as you can do it every turn.

white-haired-uncle avatar Aug 06 '23 17:08 white-haired-uncle

I am not trying to be completely fair here, I want there to be some ways to mitigate the penalty, I just agree it should be stronger and I don't want it to completely cripple weaker units. The reason is that if you spend some specialisation options on mitigating the penalty, you can't add other tricks. Executioner's Axe is currently a way to bypass most of the penalty, but very little units can use whirlwind with axe (Lilith and Phantom, if I recall correctly).

Explosive slow never gave any penalty because it was always a support only tactic, needing many other units to finish the job. It never allowed the leader to chomp all kills and exp and become even more mighty than intended. Of course, if you think it makes the game too easy, its efficiency could be reduced to 30% or something like that.

Dugy avatar Aug 06 '23 18:08 Dugy

How about incorporating self-slow with lethargy? Simple to implement, and it applies more or less proportionally to all attackers.

For explosive slow, I'm now thinking of an array of negative effects (self-slow, chance to slow allies, chance to miss adjacent enemies, etc). Each turn you use exp slow, N goes up one, each turn you don't N drops one. When you use exp slow, N effects are picked randomly from the array. The random nature makes it a little dangerous, and removes any need to try to balance the negatives effects. Not the simplest solution, but kind of fun.

white-haired-uncle avatar Aug 06 '23 18:08 white-haired-uncle

How about incorporating self-slow with lethargy? Simple to implement, and it applies more or less proportionally to all attackers.

Slow expires in the next turn, so if a unit self-slows in its own turn, it will be all right in its next turn. It would still gimp retaliation, but I like the decay property of lethargy.

For explosive slow, I'm now thinking of an array of negative effects [...]

Explosive slow is for defensive purposes, it would be a nightmare if it had unpredictable side effects. If they were cycling, it would be too complicated to be practical.

But some of the suggestions could be put together. Make it hit all units adjacent to target, allies and enemies alike, which would always slow the caster as well. The possibility to hit allies as well would prevent compensating for it with a mass slow specialist that would be good only for slow and resilience, or would be immune to slow.

Dugy avatar Aug 06 '23 23:08 Dugy

Explosive slow is for defensive purposes

Making it defense only would be an interesting approach, though I'd restrict that to hard. Not as fun as random negative effects, but it would take care of the blatant abuse issue.

white-haired-uncle avatar Aug 07 '23 11:08 white-haired-uncle

Explosive slow on Lethalia's chill tempest or alike may be very op, but take a look at Cunctator's Sword - it has low damage, explosive slow, hit-and-run and used primarily to hold against a pack of very tough enemies. Nerfing that one seems too much for me, it doesn't really inflict much damage, just slows. Adding lethargy, self-slow, negative effects for a tool to stand against very powerful opposition doesn't sound good for me. Maybe we could deal with explosive slows on an individual basis? Like to nerf it where it can be abused for offensive purposes and don't do much to Cunctator's Sword's one?

Discontinuum avatar Aug 07 '23 15:08 Discontinuum

Speaking generally about mass/AoE attacks in LotI, to be honest, I always felt them to be underwhelming and I met many people feeling the same way. One guy I've talked to even said that "LotI died when introduced lethargy nerfing mass attacks to uselessness".

I don't go that much, but my use of mass attacks was always very limited. Whirlwind is very useful, although tiring, cleave and other ones that add only a small amount of lethargy are good as well. But I always struggled to put explosive or hose spells to use. My unit becomes very weak for some time, but I rarely can kill much more: you usually deal high damage to the target, not that high damage to adjacent ones and negligible damage to others in the crowd. When you face a bunch of demons with 100+ hp, inflicting several hp isn't worth losing retaliation: for me using usual attacks and then kill in retal on enemies' turn was always much more viable.

Maybe I just don't know how to abuse those properly, maybe people just like op things, but in my opinion extra nerfs of mass/AoE attacks should be taken only with a great caution

Discontinuum avatar Aug 07 '23 15:08 Discontinuum

Cannot help throwing in my two cents ...

I also basically never use AoE since lethargy was introduced. Duelist Wizard, buffed by max leadership friend(s), is about the only one I would use. With wrath, whirlwind stays viable, but nothing else. I went and changed my version of AoE to create a timeout (it only works every other turn), and I like that a lot better. I especially like that because it encourages having multiple different AoE attacks. My implementation has flaws though, so until I figure out fixes, I wouldn't consider submitting.

On Mon, Aug 7, 2023 at 10:28 AM Discontinuum @.***> wrote:

Speaking generally about mass/AoE attacks in LotI, to be honest, I always felt them to be underwhelming and I met many people feeling the same way. One guy I've talked to even said that "LotI died when introduced lethargy nerfing mass attacks to uselessness".

I don't go that much, but my use of mass attacks was always very limited. Whirlwind is very useful, although tiring, cleave and other ones that add only a small amount of lethargy are good as well. But I always struggled to put explosive or hose spells to use. My unit becomes very weak for some time, but I rarely can kill much more: you usually deal high damage to the target, not that high damage to adjacent ones and negligible damage to others in the crowd. When you face a bunch of demons with 100+ hp, inflicting several hp isn't worth losing retaliation: for me using usual attacks and then kill in retal on enemies' turn was always much more viable.

Maybe I just don't know how to abuse those properly, but in my opinion extra nerfs of mass/AoE attacks should be taken only with a great caution

— Reply to this email directly, view it on GitHub https://github.com/Dugy/Legend_of_the_Invincibles/issues/639#issuecomment-1668091554, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHCSF3AS5QJZXYJML6VDC3XUECQNANCNFSM6AAAAAA3EJZX6M . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

David

dalong76 avatar Aug 07 '23 23:08 dalong76