Unfair/random fighting

Discussion among members of the development team.

Moderator: Forum Moderators

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 »

SL wrote:
Elvish Pillager wrote:Not in an individual combat, though. If you just charged with fifteen horsemen on the other side of the map, and they all missed, and no other attacks had been made, then you could practically *rely* on your Cuttlefish hitting all ten times against the enemy leader, an Elvish Marksman in forest.
You're talking about with ryn's suggestion, right?
yes
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.
entropomorphic
Posts: 65
Joined: March 18th, 2005, 9:01 pm
Location: Boston, MA

Post by entropomorphic »

That's not an entirely fair example, EP. If such a system were implemented, it would also mean the third horseman's attack would be almost assured to succeed as well, the fourth horseman even more so, etc.

In any case, Ryn's suggestion is fairly ludicrous, from a mathematical standpoint. Implemented naively, it would decompose into making every attack alternate succeed-fail-succeed-fail, etc, with modifications based on chance-to-hit. With some sort of "deviation tolerance" implemented to allow longer strings of deviations, this can be alleviated. However, it ignores the fact that good random sets already have a standard deviation of near zero. This is true because the standard deviation of a large output set is used to determine the quality of a PRNG. Instead of enforcing a zero stddev, it's much better to simply improve the PRNG.

It's possible that Wesnoth calculations have flaws that induce less-than-random choices. Many other games have suffered this flaw, perhaps most notably the roguelike game Angband. I believe Wesnoth uses the platform-independent PRNG from the STL, but what is done with the output data can affect the end randomness. Perhaps I'll take a look tonight to see if I spot any obvious errors.
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

entropomorphic wrote:However, it ignores the fact that good random sets already have a standard deviation of near zero.
I think you misspoke here. I would call this a bad set. Maybe you meant to say the difference between the expected value and the sample mean will be close to zero.
Hope springs eternal.
Wesnoth acronym guide.
ryn
Posts: 196
Joined: August 23rd, 2004, 4:01 am
Location: Israel

Post by ryn »

The way I think about it is to store the average deviation (in terms of real numbers, not percents) and (with a certain maximal tolerance, in percents) change the generated values whenever the chance of the attack occuring (after the change) is greater than the chance of having a deviation equal to the current or smaller (closer to 0). Well, something like that.
2B |! 2B = 3F
egbert
Posts: 33
Joined: January 7th, 2005, 3:07 am

Post by egbert »

Won't it all balance out in the end anyway? Sometimes you get good luck, sometimes you get bad luck. It'll even out eventually.

For example, if the generated numbers are more likely to miss then to hit, then you'll miss more = bad luck.

But then, your opponent will miss more too = good luck.

I'm probably missing the WHOLE point of the discussion but it occured to me that the pseudo random numbers will even out anyway in something like wesnoth.
User avatar
Temuchin Khan
Posts: 1845
Joined: September 3rd, 2004, 6:35 pm
Location: Player 6 on the original Agaia map

Post by Temuchin Khan »

Maybe we should call it not "chance to hit" but "chance to miss." Then people would be psychologically prepared for an undesirable outcome.
gabba
Inactive Developer
Posts: 129
Joined: January 24th, 2005, 5:08 pm
Location: Quebec

Post by gabba »

While we are talking about psychology: I think the problem is that if you attack the same "guy" (whatever each figure represents in Wesnoth: 1 guy, 10 guys, 50 guys) with six surrounding troops, you'd expect that to have some effect. I mean, he's completely surrounded, even if he's a good fighter, how can everybody "miss" him? If you hit a bad luck streak and the guy you're attacking comes out with barely a scratch (and kills half of your guys on top of that), that looks really bad and unrealistic. I think that's the point where people start complaining.

A good solution, as I said above, would not be to reduce the randomness (let it be as random as it can be on a computer), but rather to add a new luck-independent effect to attacks. I could just be that each attack makes you lose minimum one health, but that's not a very popular solution. Instead, what I'd like to see would be a fatigue level. Fatigue would rise with each sustained attack (whether successful or not, defending successfully is also tiring), and at a certain level of fatigue units would fight with reduced efficiency. So ganging up on a powerful unit would be a viable tactic: I think this fits well with the Wesnoth strategy of "no super-units".
It would also open up the way for a new unit role: units with a lot of weak attacks could be used to harrass the enemy and tire him.
hurleybird

Post by hurleybird »

What kills the game for me isnt the randomness, but rather, what I do because of the randomness, like saving before every single attack, just in case. In the end it involves a lot of loading and saving, which ruins the atmosphere for me, even though its my fault!

Perhaps if there were someway to have each attack pregenerated and saved, so even if you loaded, you still got the same result, and/or put in resurection of units of some type (with some negative affects to the resurectee)
User avatar
Temuchin Khan
Posts: 1845
Joined: September 3rd, 2004, 6:35 pm
Location: Player 6 on the original Agaia map

Post by Temuchin Khan »

I'm getting to like that Fatigue suggestion, gabba. Is anybody going for it?
hurleybird

Post by hurleybird »

yeah, that really is an awesome suggestion.
hurleybird

Post by hurleybird »

Ok, here is how I think fatigue should work if it is put in. First, Fatigue should be reset to 0 for your units at the end of your enemies turn. Every time you attack or defend, the unit would get 1 point of fatigue, which would drop the units chance to hit by 10% and chance to defend by %5 of the value that it was before the fatigue was added (so a unit could get very close, but never equal to zero in attack or defend chances).

I think this is a great idea and would add another (subtle) strategy element to Wesnoth, it would also shift the balance a bit more towards the races with weaker and cheaper units, which is probably a good thing.
MRhe
Posts: 88
Joined: July 19th, 2004, 7:33 pm
Location: Cambridge, MA
Contact:

Post by MRhe »

This fatigue idea is pretty interesting, and I think it could be used to reflect how a unit getting attacked by multiple enemies should logically have some disadvantage. I'm not sure improving the chance to hit would be the way to go about it, however.

What about something along the lines of the slow effect after a certain # of attacks? Say, if a unit is attacked by 3 units it becomes slowed, and thus "ganging up" on a unit would be very advantageous.

It might go against the KISS philosophy a bit though, or detract from what is otherwise an excellent combat system. Interesting idea though.
gabba
Inactive Developer
Posts: 129
Joined: January 24th, 2005, 5:08 pm
Location: Quebec

Post by gabba »

I didn't realize there could be so many ways of implementing it! Anyways, here's my original idea for fatigue in more detail: fatigue starts at 0 for each unit at the beginning of the scenario.
Increasing fatigue: Each time a unit is attacked, successful or not, it gains one fatigue point (defending causes fatigue but attacking doesn't: this encourages agressive strategies). This means fatigue can rise quickly, since for example most elves have 4 attacks and would inflict 4 fatigue points.
Recovering fatigue: At the beginning of each turn, at the time when healing occurs, units lose 6 fatigue points (so they can recover from the attacks of 2-3 units). If they did nothing at all during the last turn, they lose 12 points instead. In addition, units near a healer with the "heal" ability lose 2 extra points of fatigue, and units in a village or near a healer with the "cure" ability lose 4 extra points.
Effects of fatigue: Once a unit reaches a certain fatigue level, say, 20, it acts with reduced capacities: -25% attack power, as if it was under inverted leadership. 20 seems to be a good value for the fatigue treshold, because if you band on a poor unit with six elvish fighters, it will cause 6*4=24 fatigue. Defending against six of these guys should be pretty tiring even if you were not involved in battle, hence the choice. You could add more fatigue levels beyond that, let's say another one at 50, which would do the invert effect of 2 levels of leadership. And so on - some calculations are needed to balance this.
Overall effect: all your elvish fighters may miss against the orcish warlord in his castle, but at least he won't be in perfect condition and kill more of your fighters next turn without breaking a sweat.

Allow me to plug another one of my ideas here: maximum level units (those that can't level up any more) should be more resistant to fatigue as their experience increases. After all, that's what veterancy means: there's a limit to how many people you can split in two with one swing of your sword, no matter how experienced you are, or of how many blows you can take before dying: hence the "no super units" philosophy of Wesnoth. However, an experienced fighter is able to fight much longer, and will panic less when surrounded by ennemies. So let's say that at 30 experience, your veteran unit will become tired at 21 fatigue points rather than at 20. With even more experience your unit would become even more resistant to fatigue - but it should become exponentially more difficult to increase that treshold. Someone please make the calculations for me.

Thanks all for your comments!
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 »

Seems like a well-designed system, although IMO it should be more scalar. (not just an abrupt drop-off at 20.) Also, favoring units with more attacks is not-so-good.

My idea is as follows: Any attack increases fatigue by the amount of damage it would deal if it hit, multiplied by the defender's defense. Thus, fatigue is increased by the average damage of the attacking unit.

Then, the fatigue calculation: The unit does less damage with more fatigue. Its damage is multiplied by (fatigue/maxHP)x50%. So, a unit which has twice as much fatigue as its maximum HP, which must have been very lucky, would do no damage; and a unit which, on average, would have died, would do half damage.

Each turn without combat would decrease fatigue by 4 + 4*level.

-----

HOWEVER, all this would be a huge sideways step for the official Wesnoth version. I would definitely like to see a fork of the engine with this system implemented, though.
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.
hurleybird

Post by hurleybird »

Elvish Pillager wrote:Seems like a well-designed system, although IMO it should be more scalar. (not just an abrupt drop-off at 20.) Also, favoring units with more attacks is not-so-good.

My idea is as follows: Any attack increases fatigue by the amount of damage it would deal if it hit, multiplied by the defender's defense. Thus, fatigue is increased by the average damage of the attacking unit.

Then, the fatigue calculation: The unit does less damage with more fatigue. Its damage is multiplied by (fatigue/maxHP)x50%. So, a unit which has twice as much fatigue as its maximum HP, which must have been very lucky, would do no damage; and a unit which, on average, would have died, would do half damage.

Each turn without combat would decrease fatigue by 4 + 4*level
Humm, dont like that. Just because an attack is more powerfull doesent mean that its harder to dodge, in fact, in most real world cases its the opposite, for example, a flying sidekick, probably the most powerfull attack in the unarmed arsenal, has a very low chance to hit and is easy to dodge.

IMO, if implemented you need to keep it simple AND not break the current game balance. So far, I think only my original proposal lives up (more or less) to those two points. However, more experianced max level units being more resistant to fatigue (perhaps taking less of a penalty) is an interesting idea, with lots of merit.

I'd like to hear what some devs think.
Last edited by hurleybird on May 26th, 2005, 5:09 am, edited 1 time in total.
Post Reply