Unit ability: defends

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

CyberJack wrote:Yes, the 2-for-1 or 3-for-1 counterattack makes it much too powerful.
These are bodyguards, not meatshields. If you really want to protect someone, what you don't do is have a weak effect.
CyberJack wrote:And I think the per-swing random chance makes it too difficult to do the percentage calculations when deciding whether to attack such a combination.
It just halves the Chance To Hit against each of them, as opposed to your system, which multiplies 40% into the whole calculation. The former is easier to comprehend IMO.
CyberJack wrote:My proposal was much simpler: when the attacker and defender are both within the ZoC of a bodyguard, one single random number is rolled, representing the attacker's chance to get past the guard and within reach of the other unit. If he succeeds, he attacks the target unit normally; otherwise, he attacks the bodyguard instead, just as though he had chosen to do so in the first place.

If there's a second appropriately-positioned guard (there can't be more than two), their attempts to interpose are evaluated sequentially; the attacker has to dodge past both of them to succeed in reaching the preferred target. In any case, the attacker is only ever counter-attacked by the single unit that it ends up attacking[2].
That is NOT simpler. It takes more than twice as many lines of text than mine, and it is also much, much less specific. I will point out some problems for you.

"when the attacker and defender are both within the ZoC of a bodyguard" doesn't say who the attacker and defender are. It does imply that a combat is occuring with both participants adjacent to the bodyguard, but only if the reader knows about ZoC. More to the point, it doesn't say whether this occurs when an opponent attacks your unit, or when you attack an opponent's unit, or when two enemy units battle within the radius. My description does all these things.

"one single random number is rolled" doesn't specify what the chance is.

"representing the attacker's chance to get past the guard and within reach of the other unit" is pointless text, which should be avoided.

"If there's a second appropriately-positioned guard" is rather confusing, since the previous paragraph did not refer explicitly to the position of the bodyguard.

"their attempts to interpose are evaluated sequentially" doesn't define a sequence. This is a weakness in the ability definition itself, rather than the description.

CyberJack wrote:Allowing firststrike attacks to ignore bodyguards is an optional extra refinement, to make sure that it's not too powerful an ability, and that there's still always a way to get past the guards.
Abilities that nullify other abilities are bad.
CyberJack wrote:[1] EP's bodyguard obviously believes that the best defence is a strong offence :)
It also halves the damage dealt to its charge, which not exactly a small effect.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

CyberJack wrote:Especially when you consider, say, a level-2 Dwarvish Stalwart (7-3) protecting a level-3 Dwarvish Lord (15-3).
Stalwarts would not be Bodyguards. The Bodyguard would be a level-3 branch of the Stalwart.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
CyberJack
Posts: 161
Joined: November 25th, 2004, 2:50 pm
Location: UK

Post by CyberJack »

Elvish Pillager wrote:
CyberJack wrote:Yes, the 2-for-1 or 3-for-1 counterattack makes it much too powerful.
These are bodyguards, not meatshields. If you really want to protect someone, what you don't do is have a weak effect.
On the other hand, in the interests of game playability, we don't want anyone to be totally invulnerable. With your proposal, a major unit with bodyguards (and ideally backed by a healer too) becomes virtually unkillable even by the strongest opponents. The attacker has a hard time even damaging the target, and takes immense damage from the combined counterattack.
Elvish Pillager wrote:
CyberJack wrote:And I think the per-swing random chance makes it too difficult to do the percentage calculations when deciding whether to attack such a combination.
It just halves the Chance To Hit against each of them, as opposed to your system, which multiplies 40% into the whole calculation. The former is easier to comprehend IMO.
Wibble? The 40%-vs-50% wasn't the issue; I don't care whether the bodyguard has 30- 40- 50- or even 70% chance to intercept. It was the fact that some-but-not-all of your swings could strike one target, and some other number strike another. And they could have different defence probabilities too. And different resistances :(

So a duellist (5-5) in a castle (70% defence) attacking a Dwarvish Lord (15-3, 40% resistance to blade) in the same castle (70%) with one Dwarvish Stalwart (7-3, 30% resistance to blade) bodyguard standing on one side in hill terrain (60% defence) and another on the other side in a swamp (20% defence) will have a probabilty to hit that's ...

... just too difficult to work out :(

However, the worse aspect is definitely the multiple counterattacks; that poor duellist receives an expected damage of 29HP, even with his excellent defence. And he probably didn't hit the Dwarvish Lord at all :(

And Wesnoth just doesn't accommodate two-for-one attacking anyway
Elvish Pillager wrote:
CyberJack wrote:My proposal was much simpler: when the attacker and defender are both within the ZoC of a bodyguard, one single random number is rolled, representing the attacker's chance to get past the guard and within reach of the other unit. If he succeeds, he attacks the target unit normally; otherwise, he attacks the bodyguard instead, just as though he had chosen to do so in the first place.

If there's a second appropriately-positioned guard (there can't be more than two), their attempts to interpose are evaluated sequentially; the attacker has to dodge past both of them to succeed in reaching the preferred target. In any case, the attacker is only ever counter-attacked by the single unit that it ends up attacking[2].
That is NOT simpler.
'Tis too :P
Elvish Pillager wrote:It takes more than twice as many lines of text than mine, and it is also much, much less specific.
It's a description, written for intelligent humans who are fully conversant with Wesnoth (such as those normally found on this forum), not a newbie guide, nor the algorithm for the unintelligent computer to follow (which I could code in less time than it takes to write this reply).
Elvish Pillager wrote:I will point out some problems for you.

"when the attacker and defender are both within the ZoC of a bodyguard" doesn't say who the attacker and defender are.
Defender = unit the bodyguard is guarding.
Attacker = unit trying to attack the Defender.
I thought we could take that for granted in the context of a discussion of "units that could protect other units from incoming attacks".
Elvish Pillager wrote:It does imply that a combat is occuring with both participants adjacent to the bodyguard, but only if the reader knows about ZoC.
If they don't, they'd better learn about it. Or stop playing Wesnoth. It is, after all, both in the helpfile and the Frequently Used Acronyms list
Elvish Pillager wrote:More to the point, it doesn't say whether this occurs when an opponent attacks your unit, or when you attack an opponent's unit, or when two enemy units battle within the radius. My description does all these things.
See above
Elvish Pillager wrote:
"one single random number is rolled" doesn't specify what the chance is.

"representing the attacker's chance to get past the guard and within reach of the other unit" is pointless text, which should be avoided.
Au contraire, that specifies what the chance is. It is the as-yet-undetermined parameter that is selected for the effectiveness of the hypothetical "bodyguard" ability
Elvish Pillager wrote: "If there's a second appropriately-positioned guard" is rather confusing, since the previous paragraph did not refer explicitly to the position of the bodyguard.
"appropriate" = "such that both attacker and defender are also within its ZoC" :roll:
Elvish Pillager wrote: "their attempts to interpose are evaluated sequentially" doesn't define a sequence. This is a weakness in the ability definition itself, rather than the description.
Yes it does. First the would-be attacker has to dodge one guard (or end up attacking that guard instead of the preferred target). Then if the first guard was successfully dodged and there is another guard, the attacker has to dodge that one too (or end up attacking that guard instead of the preferred target). Then, once/if all guards have been bypassed, the attack against the preferred target may proceed normally
Elvish Pillager wrote:
CyberJack wrote:Allowing firststrike attacks to ignore bodyguards is an optional extra refinement, to make sure that it's not too powerful an ability, and that there's still always a way to get past the guards.
Abilities that nullify other abilities are bad.
Firststrike is a weapon special, not an ability.

And like I said, that's an optional balancing refinement, to stop bodyguard units being too effective.
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

CyberJack wrote:On the other hand, in the interests of game playability, we don't want anyone to be totally invulnerable.
With my proposal, unless the unit is flanked by two level 3 units, then you can always attack it from another position. You can also kill the guards. You can also just attack the unit; it'll still take 50% damage. If you control Sentinels, you can always make a ZoC of protection instead of bodyguarding anyway, if they don't have the ability.
CyberJack wrote:With your proposal, a major unit with bodyguards (and ideally backed by a healer too) becomes virtually unkillable even by the strongest opponents. The attacker has a hard time even damaging the target, and takes immense damage from the combined counterattack.
Sure, they have trouble. They would have equal or greater trouble if the bodyguards were just sitting in a solid wall in front of the unit, instead of flanking it.
CyberJack wrote:The 40%-vs-50% wasn't the issue; I don't care whether the bodyguard has 30- 40- 50- or even 70% chance to intercept.
On the contrary, it is quite an issue. Tell me, what's half of 60%? You get the answer immediately: 30%. Now tell me what's 40% of 60%? It takes multiple seconds to do this one.
CyberJack wrote:It was the fact that some-but-not-all of your swings could strike one target, and some other number strike another. And they could have different defence probabilities too. And different resistances :(
Usually you'd want to kill the guards first anyway, so you wouldn't be worrying about that.
CyberJack wrote:So a duellist (5-5) in a castle (70% defence) attacking a Dwarvish Lord (15-3, 40% resistance to blade) in the same castle (70%) with one Dwarvish Stalwart (7-3, 30% resistance to blade) bodyguard standing on one side in hill terrain (60% defence) and another on the other side in a swamp (20% defence)
GET YOUR FACTS STRAIGHT. The Lord has 50%, not 70% defense in castle, the Stalwart has 50%, not 60% defense in hills, and the Stalwart has a 6-3, not 7-3, melee attack.
CyberJack wrote:will have a probabilty to hit that's ...

... just too difficult to work out :(
16.67% chance to hit the Lord, 16.67% chance to hit Stalwart #1, 6.67% chance to hit Stalwart #2. It took me about 10 seconds to calculate that.
CyberJack wrote:However, the worse aspect is definitely the multiple counterattacks; that poor duellist receives an expected damage of 29HP, even with his excellent defence.
Average damage taken by the Duelist is 30.6. If you'd been right about their stats previously, you'd be even more wrong.
CyberJack wrote:And he probably didn't hit the Dwarvish Lord at all :(
You've also been ignoring the fact that you're running a level 2 unit up against three level 3 units. Yes, it's true that the Stalwart is a level 2 unit, but that's only because you're also ignoring the fact that I explicitly stated that the Stalwart would not be a bodyguard.
CyberJack wrote:And Wesnoth just doesn't accommodate two-for-one attacking anyway
Well, yeah, but the same could be said of every ability before it was implemented. Did they say "But Wesnoth just doesn't support poisoning" before Poison was implemented?
CyberJack wrote:not a newbie guide,
But that's the thing: We were all newbies once. If the description cannot be read by a newbie, how will they learn what the ability does? It's a very antisocial move to exclude a large number of players when writing a description.
CyberJack wrote:nor the algorithm for the unintelligent computer to follow (which I could code in less time than it takes to write this reply).
Have you submitted a patch yet? If not, then I'd suggest you do if it's so easy for you.
CyberJack wrote:Defender = unit the bodyguard is guarding.
1) I didn't ask you to explain it to me now; I already know. I would rather you rewrite the description than try to explain away its deficiencies.
2) This is equally unspecific, since you never define what unit the bodyguard is guarding. It makes it sound like you'd select a unit.
CyberJack wrote:I thought we could take that for granted in the context of a discussion of "units that could protect other units from incoming attacks".
Yes, but you never say "units that could protect other units from incoming attacks" in the description. This is supposed to be a description that players can understand, not that intelligent forum-goers with a broad knowledge of the context can understand.
CyberJack wrote:If they don't, they'd better learn about it. Or stop playing Wesnoth. It is, after all, both in the helpfile and the Frequently Used Acronyms list
Yeah. The way I learned it, though, didn't make it sound like "A zone of control" was an area. It was just a conditional statement that applied when a unit came next to another, not when it came within an area around the other.
CyberJack wrote:See above
What? What above? Where is there an 'above' in the description? Do you think anyone will properly understand something that even I cannot understand without unreferenced, exterior sources? Not a chance! I design my descriptions to describe all the effects of what I am describing, in complete detail, using no references to anything that you don't absolutely need to know to play the game at all. I, for instanced, played for a while before I learned about Zone of Control, and I didn't exactly play terribly either.
CyberJack wrote:Au contraire, that specifies what the chance is. It is the as-yet-undetermined parameter that is selected for the effectiveness of the hypothetical "bodyguard" ability
It never says that. If I read it, even knowing of the parameter, I would hardly understand it.
CyberJack wrote:"appropriate" = "such that both attacker and defender are also within its ZoC" :roll:
Don't roll your eyes at me, you defined a conditional but you didn't define a reference to its trigger in any terms. It causes bugs in programming, and it causes incorrectness in description too. Basically, it's a confusing way to state it.
CyberJack wrote:Yes it does. First the would-be attacker has to dodge one guard

WHICH guard?
CyberJack wrote:Firststrike is a weapon special, not an ability.
It is an ability. It is of the class of abilities known as 'weapon specials'. Either way, weapon specials that nullify weapon specials, weapon specials that nullify normal abilities, normal abilities that nullify weapon specials, and normal abilities that nullify normal abilities are ALL bad.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
Big Bad Joe
Posts: 258
Joined: January 26th, 2005, 11:07 pm
Location: You really do not want to know

Post by Big Bad Joe »

Do you think anyone will properly understand something that even I cannot understand without unreferenced, exterior sources?
I do and I think anyone can, just you have the problems. Does it say something about your ehm. capabilities?? :lol:
Just bored..
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

Big Bad Joe wrote:
Do you think anyone will properly understand something that even I cannot understand without unreferenced, exterior sources?
I do and I think anyone can, just you have the problems. Does it say something about your ehm. capabilities?? :lol:
You think you could understand anything without a solid context? Fine then:

The pumpkins should always be aimed at 45 degree angles unless the wind is blowing in the other direction.

Now that you know what to do, supposing you have a contraption in front of you, which knob do you turn: The big one or the little one?

Just an example...
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
User avatar
Dragonking
Inactive Developer
Posts: 591
Joined: November 6th, 2004, 10:45 am
Location: Poland

Post by Dragonking »

Eh.. soon we will have another war... please calm down and stop arguing (it's easy to feel offence on your's posts).
I don't like this idea. Why? Cause I don't like it. I feel that if I'm attacking a unit, I want to kill it, not make dmg to all units around. But if it will be available for lvl3 unit(s) only - I will not complain here. Why? Cause I'm MP player (offline last times :( ) and on MP lvl3 units can be found so many times, as many times you can see Santa Claus during Easter....
Ah one more thing - stop arguing (read: don't destroy another topic)...
This is a block of text that can be added to posts you make. There is a 255 character limit
Big Bad Joe
Posts: 258
Joined: January 26th, 2005, 11:07 pm
Location: You really do not want to know

Post by Big Bad Joe »

Telling me or EP??
Do you refer to:
Do you think anyone will properly understand something that even I cannot understand without unreferenced, exterior sources? or
I do and I think anyone can, just you have the problems. Does it say something about your ehm. capabilities??
8)
Last edited by Big Bad Joe on March 29th, 2005, 9:15 pm, edited 1 time in total.
Just bored..
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

Dragonking wrote:Eh.. soon we will have another war... please calm down and stop arguing (it's easy to feel offence on your's posts).
I try to keep my posts inoffensive... I get the feeling I do a terrible job... :oops:
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

It would not be a bad idea for everyone who considers posting to this thread or responding to a post in this thread to read: http://www.wesnoth.org/forum/viewtopic.php?t=3454
And yes, it violates the above rules to post about people you think violated the above rules. Moderator's prefer to work on more interesting things then sorting out what posts cross the thresholds. Self moderation is infinitely preferable.
User avatar
Dragonking
Inactive Developer
Posts: 591
Joined: November 6th, 2004, 10:45 am
Location: Poland

Post by Dragonking »

Big Bad Joe wrote:Telling me or EP??
Do you refer to:
Do you think anyone will properly understand something that even I cannot understand without unreferenced, exterior sources? or
I do and I think anyone can, just you have the problems. Does it say something about your ehm. capabilities??
8)
I'm talking about THAT (look above to "quote" part). It is IMO great example of offence (especialy this big I). I will not write here anymore anything about good manners - you all should know how people who respect others should behave.
btw: I prefer write/read simple posts, cause my english isn't perfect (easy to see in my posts) and after reading 100/1000/10000 lines of english textes it's easy to misunderstood something. Still "see above" text wasn't SO hard to understand.
I wish you nice and calm discussion.
This is a block of text that can be added to posts you make. There is a 255 character limit
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

CyberJack: here's a description of your effect.

Whenever an opponent's unit attempts to attack a unit of yours, if both it and the attacker are adjacent to this unit, then the attacker has a percentage chance to attack this unit instead, displayed next to this ability in the unit desription. If two units with this ability attempt to redirect the attack, then their probabilities are evaluated in a random order.

It takes up about half as much space, is easier to understand, and defines a better behavior.
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Basically, I think that this huge discussion is rather pointless, and very hard to follow... so I won't reply to it, I'll just offer my views on the subject.

I think that bodyguard would never be a particularly powerful ability by itself. Why? You would just take out the bodyguard first. Now, if you grouped a bunch of bodyguarding units together, that would be powerful. So, IMHO, bodyguarding units should be unable to guard other bodyguards. That's the gameplay reason for this. Realism-wise.... why would a bodyguard get hired to guard another bodyguard? :roll: Its like "even my butlers have butlers!".

I think that the simplest, and best (but not because its simplest!) way for bodyguarding to work is that enemy units can only attack the bodyguard if they are adjacent to it. Similar, in a way, to the "Taunting Elf" from Magic: The Gathering. The reason being that, with any bodyguard system where the special is powerful at all, you're probably better off killing the bodyguards first anyway.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
CyberJack
Posts: 161
Joined: November 25th, 2004, 2:50 pm
Location: UK

Post by CyberJack »

Elvish Pillager wrote:
CyberJack wrote:nor the algorithm for the unintelligent computer to follow (which I could code in less time than it takes to write this reply).
Have you submitted a patch yet? If not, then I'd suggest you do if it's so easy for you.
Oh well, I haven't got time to do it properly, to the quality that I'd be willing to submit as a patch, 'cos I'm going away tomorrow. But here's the snippet of C++ that implements the basic idea:

Code: Select all

Index: playturn.cpp
===================================================================
RCS file: /cvsroot/wesnoth/wesnoth/src/playturn.cpp,v
retrieving revision 1.352
diff -c -r1.352 playturn.cpp
*** playturn.cpp        26 Mar 2005 17:10:32 -0000      1.352
--- playturn.cpp        30 Mar 2005 01:27:46 -0000
***************
*** 592,598 ****
        //we must get locations by value instead of by references, because the iterators
        //may become invalidated later
        const gamemap::location attacker_loc = attacker->first;
!       const gamemap::location defender_loc = defender->first;

        const std::vector<attack_type>& attacks = attacker->second.attacks();
        std::vector<std::string> items;
--- 592,631 ----
        //we must get locations by value instead of by references, because the iterators
        //may become invalidated later
        const gamemap::location attacker_loc = attacker->first;
!       gamemap::location defender_loc = defender->first;
!
!       // CyberJack: implement 'bodyguard' ability
!       // If there is a unit in the common ZoC of attacker and defender,
!       // AND that unit is on the same side as but of lower level than
!       // the defender, AND has the 'bodyguard' ability, then (maybe)
!       // substitute the guard for the defender.
!       gamemap::location adjacent_attacker[6], adjacent_defender[6];
!       get_adjacent_tiles(attacker_loc, adjacent_attacker);
!       get_adjacent_tiles(defender_loc, adjacent_defender);
!       int ixa, ixd;
!       for (ixa = 0; ixa < 6; ++ixa) {
!               for (ixd = 0; ixd < 6; ++ixd) {
!                       if (adjacent_defender[ixd] != adjacent_attacker[ixa])
!                               continue;
!                       unit_map::iterator guard = units_.find(adjacent_defender[ixd]);
!                       if (guard == units_.end())
!                               continue;
!                       if (guard->second.side() != defender->second.side())
!                               continue;
!                       if (guard->second.type().level() >= defender->second.type().level())
!                               continue;
!                       if (guard->second.is_guardian() == false)
!                               continue;
!                       // OK, we found a bodyguard
!                       // Does he successfully intercept the attack?
!                       // We arbitrarily assign a 60% chance for now ...
!                       if ((get_random()%100) > 60)
!                               continue;
!                       // Yes! Bodyguard stands in for the defender ...
!                       defender_loc = guard->first;
!                       ixa = ixd = 6; // exit from both for() loops
!               }
!       }

        const std::vector<attack_type>& attacks = attacker->second.attacks();
        std::vector<std::string> items;
I cheated and used the exisiting ai_special=guardian as a convenient flag to overload to mean 'bodyguard', 'cos I couldn't be bothered implementing a new one for a prototype of an idea that I'm not particularly in favour of in the first place!

I've also attached a replay file, just to show how it would work. In this game, the Walking Corpses have the 'bodyguard' ability. All the Undead units are totally passive, never initiating any attacks; and the Drakes always attempt to attack the Undead Leader (but don't usually succeed) :D
Attachments
Bodyguards_Turn_17.txt
Demo of 'bodyguard' ability
(43.21 KiB) Downloaded 115 times
CyberJack
Posts: 161
Joined: November 25th, 2004, 2:50 pm
Location: UK

Post by CyberJack »

Elvish Pillager wrote:
Dragonking wrote:Eh.. soon we will have another war... please calm down and stop arguing (it's easy to feel offence on your's posts).
I try to keep my posts inoffensive... I get the feeling I do a terrible job... :oops:
I'm not offended. I think EP's posts are fun :)
Post Reply