Experimental Feature: Accuracy

Discussion and development of scenarios and campaigns for the game.

Moderators: Forum Moderators, Developers

Post Reply
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Experimental Feature: Accuracy

Post by Dave »

Enough people have complained and speculated on ways to modify Wesnoth to be less luck based. I think it'd be nice to experiment with a feature that gives the player a little more control over their fate.

This feature is definitely very very experimental, however it is committed to SVN, and I welcome people to try to make eras and scenarios based around it to experiment with it.

The feature is called 'accuracy'. The way it works is like this: any attack may have an 'accuracy' attribute. It may be a positive or negative number, and defaults to 0. When attacking with this attack, the accuracy is added to the chance to hit.

Thus, if we gave an elvish archer a +10% accuracy on their bow attack, a unit that they normally had 60% to hit, they would now have 70% to hit.

Of course, a unit may have negative accuracy. For instance, we could use this to give the Troll Whelp -10% accuracy, but an extra attack.

Attacks also have a parry attribute. Parry gives the unit a defensive bonus when fighting using that weapon. For instance, a Fencer could be given a +20% parry on its sword attack. Then whenever using its sword in a fight, it would be 20% harder to hit than normal.

This change doesn't actually change how random numbers work, of course, but it allows players some control, choosing units with higher accuracy if they so desire.

If any experienced scenario designers are interested in working with me to develop an era (perhaps simply a modified version of the default era) using this feature, please let me know.

Of course, I suspect many people will be suspicious or even hostile toward this change, but I think we have to experiment at least a little, and try a few different things. :-)

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming

User avatar
Chris NS
Posts: 475
Joined: May 6th, 2006, 3:22 pm
Location: Where the Queen lives

Re: Experimental Feature: Accuracy

Post by Chris NS »

That would certainly make an interesting AMLA, but I'm not sure how useful this would be for a less luck-based game. Unless it goes up to 100%, there's still the risk of disastrous rotten luck at the wrong moment.

A more effective way of mitigating bad luck would be to reduce the damage given by a hit and increase it for a miss. How easy would it be to include that? (This would, of course, also mean the end of your own units surviving through flukes.)

Of course, I haven't got time to make a more deterministic mod and I probably wouldn't bother playing one if it appeared, so don't worry about my opinion too much.

megane
Art Contributor
Posts: 410
Joined: October 30th, 2006, 4:55 am
Location: The Big Ö (a.k.a. Austria)

Re: Experimental Feature: Accuracy

Post by megane »

Dave: I'm not sure I'd call myself experienced, but I'm at the very least capable of UnitWML, and I'd be willing to help you out with this. Balancing for "accuracy" will give the math imps in my brain something to do :twisted:
that little girl's parents were attacked by ninjas - generic npc
hee hee! - little girl

tsr
Posts: 790
Joined: May 24th, 2006, 1:05 pm

Re: Experimental Feature: Accuracy

Post by tsr »

HM, sounds interesting. What immediately came to mind was using the new feature to alter some traits and also the ToD.

I know, not what you had in mind, but still :)

Like instead of fiddling with the damage done depending on ToD, you alter the 'accuracy' and 'parry' (wich incidentely gives us more control since we can chose to only alter one attack and not all, so that units that have a main attack get that one changed but not the secondary attack).

Also the traits/abilities/weapon-specials: strong, dexterous, guardsman, backstab, marksman, magic, etc(?) could use the new parameters instead. Plus a whole new type of terrainmodifiers (assuming you could change the 'accuracy' and 'parry' based on terrain) are now possible.

I'm seeing the base defence being determined by the unit (size, armor, 'skills') and the defence-bonus being determined by terrain, attackers weapon, etc in a much more fine-grained way than the current. So that for example you can have +20%-units against ranged fire but not against melee-fire.

Ok, this was just throwing out some thoughts while trunk is being downloaded...

/tsr

User avatar
zookeeper
WML Wizard
Posts: 9741
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Experimental Feature: Accuracy

Post by zookeeper »

CABD. ;)

Code: Select all

    [attack]
        name=sword
        description=_"sword"
        icon=attacks/sword-elven.png
        type=blade
        range=melee
        damage=5
        number=4
        [specials]
            [chance_to_hit]
                id=accuracy
                name="accuracy"
                apply_to=self
                add=10
            [/chance_to_hit]
        [/specials]
    [/attack]
    [attack]
        name=bow
        description=_"bow"
        icon=attacks/bow-elven.png
        type=pierce
        range=ranged
        damage=3
        number=3
        [specials]
            [chance_to_hit]
                id=parry
                name="parry"
                apply_to=opponent
                add=-10
            [/chance_to_hit]
        [/specials]
    [/attack]
Parry doesn't work because [chance_to_hit] add= doesn't seem to understand negative values, but I'd suppose that'd be trivial to fix.

I don't think it makes a lot of sense to implement a new mechanism when the old weapon special system is more than capable of handling it (at least if minor bugs like the abovementioned are fixed) without even needing complex WML.

Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Re: Experimental Feature: Accuracy

Post by Dave »

zookeeper wrote:CABD. ;)
This is true, but there are a couple of problems with the current way of doing it:

(1) it's very slow, and would slow down the AI greatly if plenty of units used it (which is the intent)
(2) it doesn't allow for an as nice customer display on the unit's status bar, which is also important if lots of units use it.

True, an era using this feature could probably be prototyped with the existing WML way of doing it, but on the other hand, my implementation in C++ only took about a dozen lines of code, and gives nicer support for it.
Chris NS wrote: That would certainly make an interesting AMLA, but I'm not sure how useful this would be for a less luck-based game. Unless it goes up to 100%, there's still the risk of disastrous rotten luck at the wrong moment.
Ahh but see, I think most people who complain about luck are mistaken as to what the actual 'problem' is.

The reason they feel frustrated is because they don't have enough control over their chance to hit. This leads them to be forced to take risks which don't pay off.

I don't think truly "disastrous" luck is often a problem at all.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming

Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Re: Experimental Feature: Accuracy

Post by Boucman »

I'd like to second the call for an "accurate" trait

this is a great opportunity to do a trait, and we are always short of ides to differentiate units without altering gameplay...
Fight key loggers: write some perl using vim

megane
Art Contributor
Posts: 410
Joined: October 30th, 2006, 4:55 am
Location: The Big Ö (a.k.a. Austria)

Re: Experimental Feature: Accuracy

Post by megane »

Well, I made an Accuracy Era for 1.5.0-svn. It's probably horribly unbalanced, so, if you'd like, feel free to playtest it and complain at me. Only works in svn, of course.

EDIT: removed the attachment; you can get it off the add-on server now.
that little girl's parents were attacked by ninjas - generic npc
hee hee! - little girl

CarpeGuitarrem
Posts: 250
Joined: November 19th, 2007, 7:46 pm
Location: One among the Fence

Re: Experimental Feature: Accuracy

Post by CarpeGuitarrem »

Very interesting idea. I'm not in a position to help develop, but here's some moral support...
Glory in Blood...Needs Programming Help!

If you have time, check out my ongoing serial story...
The Hidden: Secrets of the Future's Past

User avatar
Iris
Site Administrator
Posts: 6632
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Experimental Feature: Accuracy

Post by Iris »

:shock: Is this really http://www.wesnoth.org? Are you sure you are David White and not someone else that hijacked his accounts? :P

OK, I can give it a try when porting IftU to 1.5.x (there are so many new features I want to test there including formula AI). I just have to finish a few scenario rewrites and I should be ready to go.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.

Lastmerlin
Posts: 45
Joined: September 25th, 2007, 5:37 pm

Re: Experimental Feature: Accuracy

Post by Lastmerlin »

hmm i dont see how this decreases the influence of luck...
The parameter, which says how big the random influence is, is (imo) the variance. A wesnoth uses almost always some binomial distribution (n actions with percentage p to be succesful) this is:
v = n*p*(1-p)
You see, that the variance is biggest, when p is 0.5
This should be logical to persons that dont like maths, too: If I hit never (p=0) or always (p=1) the outcome is already determined. If I attack with 50% chance * 4 hits i can have everything from 0/4 to 4/4 with a reasonable probability. Another example is fighting 1vs1 with gryphons - thats just gambling.
As you often place your units on good terrain (p=0.3 or p= 0.4) an increase of p by 0.1 oder 0.2 will increase the variance and hence, luck influence. A decrease will decrease luck - but increase frustration too - with a p=0.2 chance to hit you will almost never attack (20% to hit feels like 0% imo).

So i dont think that this modification is a good idea to solve the problems with rng frustation.

megane
Art Contributor
Posts: 410
Joined: October 30th, 2006, 4:55 am
Location: The Big Ö (a.k.a. Austria)

Re: Experimental Feature: Accuracy

Post by megane »

Lastmerlin wrote:hmm i dont see how this decreases the influence of luck...
The parameter, which says how big the random influence is, is (imo) the variance. A wesnoth uses almost always some binomial distribution (n actions with percentage p to be succesful) this is:
v = n*p*(1-p)
You see, that the variance is biggest, when p is 0.5
This should be logical to persons that dont like maths, too: If I hit never (p=0) or always (p=1) the outcome is already determined. If I attack with 50% chance * 4 hits i can have everything from 0/4 to 4/4 with a reasonable probability. Another example is fighting 1vs1 with gryphons - thats just gambling.
As you often place your units on good terrain (p=0.3 or p= 0.4) an increase of p by 0.1 oder 0.2 will increase the variance and hence, luck influence. A decrease will decrease luck - but increase frustration too - with a p=0.2 chance to hit you will almost never attack (20% to hit feels like 0% imo).

So i dont think that this modification is a good idea to solve the problems with rng frustation.
This mod is not, in any way, designed to remove the randomness from the game. AFAICT, Dave believes (as do I) that those who complain about the RNG simply do not understand what they are really asking for, and that they are actually angry about is the fact that they feel helpless in the face of random results (which they shouldn't, for reasons which have been discussed to the point of exhaustion in half a million different threads, but continue to do nonetheless).

Thus, it is an attempt to give players some degree of "control" over their chances, and in this (I feel) it succeeds. If you wish to kill an enemy who is on good terrain, you can use an accurate attack, increasing your chances to hit. If, on the other hand, you wish to "gamble," you can use an inaccurate attack, which will occasionally do a very large amount of damage. The important thing is that it feels different, feels as though what happens is more up to you and less the RNG.
that little girl's parents were attacked by ninjas - generic npc
hee hee! - little girl

Post Reply