Gentle approach to removing random

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:
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: Gentle approach to removing random

Post by optimother »

tekelili wrote: If I understand you well, it would be totally deterministic after 9 attacks (just one card left in deck). It is not so difficult count nine attacks vs determinated defense value (but I find irrelevant how difficult it is remember it). Just imagine how broken could become a combat when a player can know an attack outcome for sure and use such attack on a key spot or combined with skills as charge.
Still not a problem: you can add new cards and shuffle when there are just one or two left.
Edit: Repeating a little my last post, I dont see non-luck or balanced-luck systems working in Wesnoth. At difference of chess, where each player can only move one "unit" per turn and advantages are gained and exploited slowly, in Wesnoth the power players have at own turn is inmense and can easyly decide a game before oponent gets its next turn. Giving more deterministic outcomes to attacks, would overpower the active player (his army would be by far more efficient).
Did you try playing with my addon? Players become active every turn, if your army is overpowered now, then prepare for same overpowered army against you after attack.
iceiceice wrote:optimother: One possible issue with the idea of having multiple decks is that, if the decks are proceeding independently of one another, then it is possible that they will all sync up on one turn and you will get tons of hits on that turn.
This is exactly what I don't like in current random implementation.
The player might even arrange for this.
How?
It depends on what "problem" you are trying to solve. If you think the "problem" is that a single unit might, over the course of it's lifetime / a significant portion of the game, get way more hits than usual, then the offense counters / decks will solve that issue pretty decisively.

If you think the "problem" is that one team might get way too many hits on a single turn and gain a decisive advantage by killing all the enemy units before the luck can balance out, then I think you need to use a system where the units are linked, so the counter(s) / deck(s) are shared and used equally by all of the units in the team.
It would be nice to solve both, actually.
This stuff was discussed at length here: http://forums.wesnoth.org/viewtopic.php ... 26#p570326
Lengthy, agree.
One possible solution which I proposed was, instead of decks etc. for each defense value, generate numbers from a low-discrepancy sequence and use those instead of the RNG values. But I never coded or playtested this idea.
Basically it's same as cards for me.
Tbh though, I'm not sure if there's any way to retain the kind of balance you have in 1 v 1 mp games... I'm pretty sure reducing the variance hurts orcs trying to attack elves for instance. In a large attack of orcs on elves, you rely on occasionally getting lucky and double hitting to generate kills. If that never happens then you can never kill anything, and you probably have no hope. So maybe reducing luck also hurts some attacking factions, rather than helping them. That seriously complicates even the hypothetical idea of "retaining wesnoth balance" while reducing luck.
When you attack an elf standing on a plain (40% or less), it's perfectly possible to hit 2 of 2. But planning to hit 2 of 2 attacks vs 60% or 70% doesn't sound right to me.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Gentle approach to removing random

Post by zookeeper »

optimother wrote:
Tbh though, I'm not sure if there's any way to retain the kind of balance you have in 1 v 1 mp games... I'm pretty sure reducing the variance hurts orcs trying to attack elves for instance. In a large attack of orcs on elves, you rely on occasionally getting lucky and double hitting to generate kills. If that never happens then you can never kill anything, and you probably have no hope. So maybe reducing luck also hurts some attacking factions, rather than helping them. That seriously complicates even the hypothetical idea of "retaining wesnoth balance" while reducing luck.
When you attack an elf standing on a plain (40% or less), it's perfectly possible to hit 2 of 2. But planning to hit 2 of 2 attacks vs 60% or 70% doesn't sound right to me.
I think it's not so much about planning to hit twice than it's about the threat of possibly hitting twice. You can't ever count on your grunt hitting twice. However, can you count on your opponent's grunt not hitting your 60% or 70% unit twice? No, you'll make some precautions against that if at all possible. However, if you know that their grunt cannot hit twice, it changes some situations considerably, because you no longer need to prepare for the worst.
User avatar
iceiceice
Posts: 1056
Joined: August 23rd, 2013, 2:10 am

Re: Gentle approach to removing random

Post by iceiceice »

optimother wrote: When you attack an elf standing on a plain (40% or less), it's perfectly possible to hit 2 of 2. But planning to hit 2 of 2 attacks vs 60% or 70% doesn't sound right to me.
It depends on the scale of the battle.

Suppose you have 12 orcish grunts attacking 10 elves hiding in trees at night, trying to break through the line. Depending on the situation, a good player may basically try to feel out for 2/2 opportunities. Even an elf on 60% defense is going to get hit 2/2 more than 15% of the time, so a little more than 1/7 attacks will be this way. If the line has a bend in it, so you get 3 opportunities to attack at one point, you probably will attack from the middle hex first, to see if you 2/2, since if you do you have a good chance to kill the elf in the next attack and actually take territory, getting more hexes to attack other elves, and denying them forests. If you miss, you can ignore that elf and try a different 3 hex spot -- by just attacking from the middle you didn't waste any hexes you needed for another spot. If you manage to attack with all or most of your army, you can reasonably expect that at least one of your grunts will hit 2/2 this turn. If you just destroy the possibility of ever hitting 2/2, you seriously cripple the orcs. It's purely hypothetical but I think you can see the idea.

Edit: You can't plan your turn around getting a 2/2 on high defense ofc, but if you get good hits that gives you a way to win... if you can attack the line this way in multiple places, and you do so each turn say on the first night, and on the second night, you are quite likely to get the break you need.

And the point is that, for factions that are designed differently, reducing chance and making units do damage at a uniform rate greatly *increases* their power -- think about how much more devastating a loyalist army is if their spearmen and mages just never have bad luck, guaranteed. For instance, suppose I have two spearmen attacking a line of drakes. Suppose I have two hexes from which to attack a drake fighter. With this system, am I guaranteed to hit at least 2/3 with both spearmen, and therefore guaranteed a kill from two hexes? With the current system, if the loyalist attacks that way he has at least a chance to miss and take a large retaliation. And if he was "planning" on taking that hex from which to make more attacks, he would be S.O.L. and might risk the game because of it.

So I think it would be very complicated to just erase chance in this manner and also make adjustments to preserve any kind of balance, at least for the "normal" gameplay modes.
optimother wrote: Basically it's same as cards for me.
I think it's fundamentally different. Cards solves only the first problem I mentioned, whereas this solves only the second problem I mentioned, by linking all the units together in a way so that the *team* won't get lucky at the same time, even across units making attacks with different chances to hit.
User avatar
tekelili
Posts: 1039
Joined: August 19th, 2009, 9:28 pm

Re: Gentle approach to removing random

Post by tekelili »

zookeeper wrote:I think it's not so much about planning to hit twice than it's about the threat of possibly hitting twice.
Agree. One of things I most dislike about "blance-rng" approachs is assumption amount of damge dealt is so important, totally oversighting the huge "treshold enverioment" Wesnoth has. As experienced player, when I am attacking a decent oponent that have some clue about dfend, all comes to issue if I am able to break the line or not. Kill units becoming free new hexes to hit increases hugely damage, making irrelevant previous damage stats. Seriously, when I plan an attack that relys on been able to break enemy lines at one of three possible spots, if I fail at kill the first unit from available spots, I dont care if I did 43 or zero damage to that 44 hp grunt, and I feel insulted if you call me lucky for do 43 hp of damage and then lower my chances of hit in next attacks :annoyed:
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: Gentle approach to removing random

Post by Crow_T »

Have you figured out how to make this a proper addon for the server yet? I think it would be a good addition. http://wiki.wesnoth.org/PblWML
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: Gentle approach to removing random

Post by optimother »

zookeeper wrote:I think it's not so much about planning to hit twice than it's about the threat of possibly hitting twice.
Yea, this really makes sense. 'll think about it.
iceiceice wrote: Suppose you have 12 orcish grunts attacking 10 elves hiding in trees at night, trying to break through the line. ... If you just destroy the possibility of ever hitting 2/2, you seriously cripple the orcs. It's purely hypothetical but I think you can see the idea.
Elvish Fighter: 33hp.
Elish Archer: 29hp.
3 Orc Grunts at night can do 11x3 = 33.

Seems like orcs are still capable of some kills?
Edit: You can't plan your turn around getting a 2/2 on high defense ofc, but if you get good hits that gives you a way to win...
That's what I call luck-based win. Think as if you are defending Elf in same situation: you've built perfect defense line which was breaked (or not) just because computer decided so.
And the point is that, for factions that are designed differently, reducing chance and making units do damage at a uniform rate greatly *increases* their power -- think about how much more devastating a loyalist army is if their spearmen and mages just never have bad luck, guaranteed. For instance, suppose I have two spearmen attacking a line of drakes. Suppose I have two hexes from which to attack a drake fighter. With this system, am I guaranteed to hit at least 2/3 with both spearmen.
3 blows against 40% not always result in 2 hits, sometimes its just 1:

Code: Select all

offense defense damage
     20      40      0, new offense 80
     80      40      7, new offense 40
     40      40      0, new offense 100
Again, seems perfectly fair to me. Building your defense based on the fact that your opponent will have bad luck is against my concept of interesting game.
So I think it would be very complicated to just erase chance in this manner and also make adjustments to preserve any kind of balance, at least for the "normal" gameplay modes.
Agree here, gameplay is different, but more interesting for me.

I think it's fundamentally different. Cards solves only the first problem I mentioned, whereas this solves only the second problem I mentioned, by linking all the units together in a way so that the *team* won't get lucky at the same time, even across units making attacks with different chances to hit.
If you provide some concrete examples I think I could implement it to test in action.
tekelili wrote: Seriously, when I plan an attack that relys on been able to break enemy lines at one of three possible spots, if I fail at kill the first unit from available spots, I dont care if I did 43 or zero damage to that 44 hp grunt, and I feel insulted if you call me lucky for do 43 hp of damage and then lower my chances of hit in next attacks :annoyed:
You are lucky if you did more than expected. If you do 3/3 hits agains orc in water - that's not luck, but 3/3 against grunt in mountain is cheating.
Crow_T wrote:Have you figured out how to make this a proper addon for the server yet? I think it would be a good addition. http://wiki.wesnoth.org/PblWML
Thanks, will publish later.
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: Gentle approach to removing random

Post by optimother »

Meanwhile, card-based random: http://pastie.org/9388436 It's same codebase as before just added functions with _card_based_ in name.

Generates 5 misses/hits sequences and picks one with minimal longest streak. Surprisingly, long streaks are still quite common.
User avatar
tekelili
Posts: 1039
Joined: August 19th, 2009, 9:28 pm

Re: Gentle approach to removing random

Post by tekelili »

Building your defense based on the fact that your opponent will have bad luck is against my concept of interesting game
Bad luck has not real meaning in game mechanics, it just descibes an human subjective feeling. I could never "build my defense based on fact my oponent will have bad luck" because bad luck doesn´t mean any mathematical chance of succes/fail.

Without a previous mathematical description of "bad luck", it is quite difficult see any mathematical improvement in "solve that issue" ;)

Edit: In fact "bad luck" if often used for bad players to describe a bad play from them. In competitive Wesnoth this example scenario happens often:
"Player 1 (skilled one) is a bad tod and offers a defense that can be broken 60% of times, but he calculates a serie of retalation moves that include offer a 60% ctk on his leader, that would lead to enemy collapse if that leader kill fails. What he has calculated is that enemy has only a real 36% chance of succes.

Player 2 (unskilled one) calculates 60% of chances to break enemy lines and decide attack, he suucceds. Then he is retaliated and enemy offers a 60% ctk on his leader, player2 thinks thats great and take the chance: he fails and claim he was unlucky. Good player (as me in this thread) ------> :roll:"
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: Gentle approach to removing random

Post by optimother »

tekelili wrote:Player 2 (unskilled one) calculates 60% of chances to break enemy lines and decide attack, he suucceds. Then he is retaliated and enemy offers a 60% ctk on his leader, player2 thinks thats great and take the chance: he fails and claim he was unlucky. Good player (as me in this thread) ------> :roll:"
With pure random approach the chances you are referring to here are only statistically valid, in single game they almost don't mean a thing. A bad player has 36% chance to defeat the greatest you and to not even notice your skillfully crafted trap. That's what I written in the original post: the beauty (or the lack of it) of strategy is blurred by the randomness.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Gentle approach to removing random

Post by zookeeper »

I'd also suggest everyone to not make this yet another generic luck thread, since we know what happens to those.
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: Gentle approach to removing random

Post by optimother »

I think there wouldn't be a single one if there was on option in game: with luck or deterministic. If you like to play with random - no problem, wanna play chess with Wesnoth pieces - feel free for it, why not.
User avatar
tekelili
Posts: 1039
Joined: August 19th, 2009, 9:28 pm

Re: Gentle approach to removing random

Post by tekelili »

optimother wrote:A bad player has 36% chance to defeat the greatest you and to not even notice your skillfully crafted trap. That's what I written in the original post: the beauty (or the lack of it) of strategy is blurred by the randomness.
I won´t blame anyone for create an addon, but someone state false facts is ethical point it imho. The good player wont always offer a 36% chance of win to a worst player, he will only do as last resource probably after a previous attack with very high chances of succed failed. Worst player´s chance of succed will be 36x(percentage of times good player use that last resource)/100
Be aware English is not my first language and I could have explained bad myself using wrong or just invented words.
World Conquest II
User avatar
Oook
Posts: 70
Joined: March 23rd, 2009, 5:51 pm

Re: Gentle approach to removing random

Post by Oook »

What zookeeper, ice and tek have said really, regarding variance and abusability of this kind of idea, and how you think of 'luck-based wins'.

Here are a few examples to further illustrate things.

First, the abusibility:

A quick example of how you could abuse it: have your thunderers keep shooting until they miss a shot or two. These ones will then have a very high (if not certain) cth on their next attack.Once you have two or three of these 'primed' thunderers, you can be almost certain of getting 2/3 or 3/3 shots on a vill, say. Not really anything the defender can do to stop this, and not what most people would call 'fair' luck ;) You can do similar tricks with priming horsies / grunts to hit against 70% def, adepts to go 2/2 etc. The key point here is that not all hits are equal, so you can use your store of 'good luck' where it will be most effective. Of course, under the truly random system, you could get bursts of luck in key situations, but being able to direct it will just increase the chances of that happening.

Another problem due to your current 'randomised 100-80-60-40-20' starting values - it allows for some nasty attacks with newly recruited units. A new grunt / horsie would currently be certain of hitting once against 60% def, and have an 80% chance of one hit against 70% def. So grunt rush gets powered up - 3 fresh grunts have a certain kill on anything with < 33 hp (or more if strong). Two fresh grunts have a 64% chance of 2 hits against 70% - under actual random, that would be 35%. Fresh horsie has 80% chance for 1 hit on 70% defence - excellent for picking off orc assassins / outlaws with low risk. Obviously, you could reduce this problem by a better selection of starting values, but it again shows how easily odds can be manipulated, once you break with random.

Secondly, the 'win by luck' argument...
Imagine an orcs v elves match. Orcs are attacking, and there are 3 key points on the elvish lines. Each is held by a fighter, with 2 hexes free to attack from. Let's assume that grunts going 3/4 will kill any of them.
Chance to get 3/4 against 60% is 17.92% - that's ~1/6 ctk.
First watch, orcs hit all 3 points. Already, that's a 45% chance of a kill somewhere.
If they miss them all, let's assume they try again second watch. Again, 3 chances.
Now, after the 6 attempts for a kill, there was a 69% chance that at least one would succeed, and the line broken.

Hence, you'd expect a kill somewhere. The actual kill that happened would be unexpected, but in the larger picture of the repeated attacks, it would be expected to occur at some point. This works in the same way that a spearman getting 1/3 to finish an orc assassin is expected - the killing blow was 'lucky', but in the context of the other misses, luck was 'fair' overall. If the grunts breaking the line by getting 3/4 one time out of 6 was a 'luck-based win', then getting 1/3 against 70% would be a 'luck-based kill'. Your system makes it impossible for the grunts to get 2/2 here, so it changes an expected kill into a certain fail.

Here, the attacks are spread out over a couple of turns, and on different areas of the map. This does not change the fact that you'd expect one of them to succeed. Equally, they could be spread over different day-night cycles - two or three attacks one cycle, fall back if they fail, repeat 6 turns later etc. If you consistently set up attacks with individually low (but cumulatively high) ctk, while not giving your opponent equal or better chances, that is good risk management. You deserve to be rewarded for it in the long run, even if no specific attack was odds-on to succeed. Finding the statistically best attacks / defences (balancing risk/reward) is where a lot of the skill lies. By removing the chance for many attacks to ever succeed, you reduce the available strategies - statistically sound play now fails to work. This reduces the skill involved, and leads to less interesting play.

You certainly shouldn't expect a single game to always determine the more skillful player. Over multiple games, however, the more skilled player will dominate (see the ladder for examples). Your proposed mod will not improve matters - the only advantage it will give to skilled players is the ability to abuse its weak points ;)
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: Gentle approach to removing random

Post by optimother »

Oook wrote:A quick example of how you could abuse it: ... Not really anything the defender can do to stop this, and not what most people would call 'fair' luck ;)
In order to fully charge your units you have to miss on least one attack, but usually several. I have no better definition for fair luck than this. You missed a lot and managed to survive, now take your reward.

It's not that easy to keep you thunderer fully charged - your opponent can easily make you lose all the precious offense on some low defence melee attack (for example you have 90% offense and looking forward to shoot the assasin, but grunt from sand with 30% defense hits you, you hit him twice ending just with 30% of offense). Don't rush to make judgements, it's not better or worse, just different. You raised the right point of what I especially dislike with totally random approach — the thunderers :) The effect of randomness here is much more than with 2 grunts attacking elf fighter.
The key point here is that not all hits are equal, so you can use your store of 'good luck' where it will be most effective.
That's exactly my point! Not luck (computer program) should decide when you hit, but you (by your previous actions).
Another problem due to your current 'randomised 100-80-60-40-20' starting values - it allows for some nasty attacks with newly recruited units. A new grunt / horsie would currently be certain of hitting once against 60% def, ...
That's not true. Chances for new units to hit the first blow are exactly as stated — 30% vs 70, 40 vs 60, etc. Double check your math, read the source, or just to play to see it. 2 attacks is way more predictable, for example against 50% will certainly end up in 1 hit 1 miss. 3 attacks will have at least 1 hit almost for sure (see example vs 70% in original post). Randomised values are not limited to only those five, but can be any integer in range from 1 to 100.
Imagine an orcs v elves match. Orcs are attacking, and there are 3 key points on the elvish lines. Each is held by a fighter, with 2 hexes free to attack from. Let's assume that grunts going 3/4 will kill any of them.
Chance to get 3/4 against 60% is 17.92% - that's ~1/6 ctk.
First watch, orcs hit all 3 points. Already, that's a 45% chance of a kill somewhere.
If they miss them all, let's assume they try again second watch. Again, 3 chances.
Now, after the 6 attempts for a kill, there was a 69% chance that at least one would succeed, and the line broken.
Three answers on different aspects of this:
1) Expecting different outcome from same actions is kind a strange (I'm in a good company on this: http://www.brainyquote.com/quotes/quote ... 33991.html ) Obviously, if your strategy doesn't work develop a better one.
2) Think of you as an Elf player: you've done the best you could and still lost. 'WTF?' one might ask.
3) If you can invent a random system that is fair in a sense that low probability events do not occur too early (in your example - first, or even several of orc attacks hit 3 of 4), probably it'll be ok for me.

Do you have a replay with example of this scenario? Maybe after watching by myself I'll understand how nice random actually is :)
Hence, you'd expect a kill somewhere.
You do expect, but it might never happen. Some non-match-decisive random variations of the game are ok, but when in happens at key moments that's a problem in my opinion (thunderers I mean, not grunts).
This works in the same way that a spearman getting 1/3 to finish an orc assassin is expected - the killing blow was 'lucky', but in the context of the other misses, luck was 'fair' overall.
Hitting every blow when your hits do not result in a kill and then missing all can be 'fair' overall too, but it makes the whole a lot of difference.
If the grunts breaking the line by getting 3/4 one time out of 6 was a 'luck-based win', then getting 1/3 against 70% would be a 'luck-based kill'.
How else do you interpret 70% defense chance?

Getting hit 3 out of 4 times is by no means a 60% defense as advertised for Elvish Fighter. Only 40% blows should hit, in case of 4 you can't hit 1.6 times, so it's rounded to 1 or 2 of 4, not 0, not 3 and 4.

In my approach, Fighter can receive 4 of 4 hits if different units with good charge hit once, because the defense is tracked in attackers, not defenders. Maybe it should be switched to defending side, but it makes no real difference.
Your system makes it impossible for the grunts to get 2/2 here, so it changes an expected kill into a certain fail.
See how easy and intuitive it is: that thing won't work, lets don't waste time on it and go straight for something different.
If you consistently set up attacks with individually low (but cumulatively high) ctk, while not giving your opponent equal or better chances, that is good risk management. You deserve to be rewarded for it in the long run, even if no specific attack was odds-on to succeed. Finding the statistically best attacks / defences (balancing risk/reward) is where a lot of the skill lies. By removing the chance for many attacks to ever succeed, you reduce the available strategies - statistically sound play now fails to work. This reduces the skill involved, and leads to less interesting play.
Less skill of waiting some unprobable event, but it opens whole new world of other possibilities you described in abuse section. For example, the skill of foreseeing what your oponent is going to do and prepare counter for it will be more valuable than just repeating same grunts attack. For some it is more interesting to watch players doing the same actions checking on whose side the fate is this time (whose low-probability event will occur first/more often), for others it is more interesting to watch a perfectly planned win.
Your proposed mod will not improve matters - the only advantage it will give to skilled players is the ability to abuse its weak points ;)
It's 'weak points' are the main reason it was created. The lack of these 'weak points' is what I don't like in Wesnoth, and since there are tons of similar threads, and it's most frequently rejected idea, I can conclude many others too. If some Wesnoth gurus invested a lot in playing random way, no problem, nobody is trying to take it away from you. I invested more time playing chess and prefer it to poker, and have no plans to learn fortune-telling skill (probabilities which serious poker is all about). It's fun to roll a dice with a friend just for fun but in campaign it's just boring to restart because of bad luck. Currently RNG can determine the match outcome (although the probability of it is quite low, but as we learned above in many games you expect it to happen) which is not right for tournaments.

Couple of posts above I posted a version with card based random, it's semi-predictable, but still returns to expected mean much faster than true random. If totally deterministic approach doesn't suit you feel free to use it as a compromise. I tried it and got mixed opinion about it.
optimother
Posts: 76
Joined: July 12th, 2014, 4:09 am

Re: Gentle approach to removing random

Post by optimother »

I've published the add-on Deterministic Offense, now it can be installed like all others without hackery.

Works both in single player and mp (should work, not tested).

Also added one more option: mostly deterministic but slightly randomised to allow orcs kill elves. Once in about 10 hits units have an strike of good luck hit when should miss, and once have bad luck (miss when should hit). This doesn't change the number of hits done, but rearranges hits and thus damage to break exact planning, while having minimal impact on game in my opinion.

Some feedback would be nice, if anyone interested.
Post Reply