Bell curves and randomization, and other cool stuff. =)

General feedback and discussion of the game.

Moderator: Forum Moderators

User avatar
StevenAus
Posts: 84
Joined: December 18th, 2009, 12:15 am
Location: Perth, Australia
Contact:

Bell curves and randomization, and other cool stuff. =)

Post by StevenAus »

This is a quote from the Bug Thread of the Fall from Heaven 2 fantasy mod for Civilization 4:

http://forums.civfanatics.com/showthrea ... ost8856833


"Posted by: Emptiness
On: Jan 31, 2010 12:41 AM


---Quote (Originally by denev)---
Code:
---------
iDmg = GC.getGameINLINE().getSorenRandNum(iDmg, "Damage") + GC.getGameINLINE().getSorenRandNum(iDmg, "Damage");
---------
As can be seen, XML damage value is randomized twice. Is this intentional?
---End Quote---
Adding two random results is used here to produce a bell curve, where extreme results are rare and median results are more common. This is similar to what happens when two 6-sided dice are rolled and added. The result of 7 has a 6-in-36 chance to occur, but the each of the results 2 and 12 only has a 1-in-36 chance to occur. The result is that the damage can sometimes be higher or lower, but will most often be of a median amount."


One of the reasons why I have been playing more FFH2 than Wesnoth in the last month or so is that the game is not so affected by an out-of-field result. Apart from the start of game when an unlucky result can result in a loss (which doesn't matter too much because you can go and start a new game without much time lost), after the start of the game most of the time you do not lose because of a few bad dice rolls. With regards to the damage caused by a spell, more median results are more common, and I think this is a good thing. I think it would be great that for each Wesnoth "does this attack hit or not?" decision two dice rolls are taken and the result averaged to work out whether a hit occurs. I think this is a relatively simple way of working out whether there is a hit or not in Wesnoth, in a way that would limit the out-of-field results and reduce frustrating "insta-deaths", produce a more bell-curve shaped distribution, increase enjoyment of both single and multi player scenarios and result in more players for The Battle for Wesnoth. I know I've been very frustrated when on 5-10 occasions when I'm late in a scenario, been tactically sound and then the enemy gets lucky and wins the scenario by killing a loss condition hero, either by getting *much* more than the % of hits in, or rescuing units not getting any hits in when only one hit is required to save the essential hero.

Now I know that you can do what you will with my suggestion. However I think that using two rolls to work out whether a hit is scored will be a simple way to reduce frustration, increase enjoyment, increase players and make The Battle for Wesnoth even more enjoyable and successful, without compromising the element of "battle flux and fluidity" (momementum shifting back and forward in battle, "the ebb and flow of battle" or the "unpredictable yet predictable natural variation in the fortunes of armies for whatever reason in or out of battle".) Sorry for the somewhat "arty" way of describing it, however I think using these various collections of words helps to clarify in my mind and in the minds of others. <grin>

If you decide to try this suggestion of two averaged rolls which decide "to hit or not?" with each attack I would say almost for certain that I would regain some of my enthusiasm for the game - AND I daresay it would show to others that not only is the game made more enjoyable, but having the guts to use a simple and reasonably median-linked (and thus less frustrating) way of moderating combat results shows that fun and strategy is as important part of a game as having a certain philosophy. :-)

It's up to you. =) I enjoy the friendly nature and comraderie of communities and value these aspects highly. Such as the Quill YahooGroup: http://games.groups.yahoo.com/group/Quill/, VCMI Project http://vcmi.antypika.aplus.pl/forum/, fheroes2 project: http://sourceforge.net/projects/fheroes2/, Civfanatics: http://forums.civfanatics.com and http://forums.civfanatics.com/forumdisplay.php?f=190. I hope Wesnoth too can be a community I enjoy, participate in and contribute to. But I don't force my opinions on anyone - everyone needs to make their own decisions on what they find fun and rewarding, and I will do so too. =)

I wish the best for all turn-based fantasy games, whether commercial or open-source (or both ;-)), as I think they can be as fun as anything in front of a computer. :-)

Best regards,
Steven from Australia.
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Re: Bell curves and randomization, and other cool stuff. =)

Post by Velensk »

Wesnoth does do a bell curve. It merely does it over mulitple swings rather than for each individual attack. A spearman attacking a target in the open is most likely to hit twice with the odds for the other results slopeing down from that point.

The net effect is actually about the same. If you are doing an attack with a bell curve (let's say one where you would roll two six sided dice) and in order to hit you need to roll a six or less then at the core you would still have a base chance to hit (I think roughly a 15/36).

Where it does make a diffrence is when there are additive modifiers in the chance to hit. If your target is in a terrain that gives them good cover so that the attacker adds plus three to their roll, then they have to assemble a great deal more firepower to even have decent odds of landing a hit. Wesnoth has no such modifiers and as such it seems much more sensible to bell curve it the way it is done now which is both simple to understand and works the way you expect.

EDIT: Unless what you are proposing is that we make it less likely for the results above 70% and below 30% less likely effectively makeing it so that it is even more impossible to get elves out of forests and making it so that mages hit even more often. This strikes me as a bad idea. The odds should represent the number they say they are. People tend to underestimate the odds of the results with only a 4% chance (and to be fair it's hard to take them into account) but that seems like a bad way to deal with that problem. However having the terrains lie about what their base odds are just strikes me as a bad idea. In actuality if you wanted to stager it like that it would look something like this

%def chance to be hit
10%-> 15.5/16
20%-> 13.5/16
30%-> 10.5/16
40%-> 6.5/16
50%-> 3.5/16
60%-> 1.5/16
70%-> .5/16
The numbers would of course be staggered diffrently (probably done using 50% as the midpoint and calculating outward) this was just a quick model I worked up using two d4 but you get the idea. The odds would not be representive of what the real odds are.
Last edited by Velensk on January 31st, 2010, 1:01 pm, edited 2 times in total.
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
User avatar
pauxlo
Posts: 1047
Joined: September 19th, 2006, 8:54 pm

Re: Bell curves and randomization, and other cool stuff. =)

Post by pauxlo »

StevenAus wrote:---Quote (Originally by denev)---
Code:
---------
iDmg = GC.getGameINLINE().getSorenRandNum(iDmg, "Damage") + GC.getGameINLINE().getSorenRandNum(iDmg, "Damage");
---------
As can be seen, XML damage value is randomized twice. Is this intentional?
---End Quote---
Adding two random results is used here to produce a bell curve, where extreme results are rare and median results are more common. This is similar to what happens when two 6-sided dice are rolled and added. The result of 7 has a 6-in-36 chance to occur, but the each of the results 2 and 12 only has a 1-in-36 chance to occur. The result is that the damage can sometimes be higher or lower, but will most often be of a median amount."
Only to correct a bit: adding two dice does not give a "bell curve", but a triangle curve: Image

The bell curve comes as a limit case of adding lots of dice ... as it also comes as the limit case of adding coin throwing results, what Wesnoth does with its "multiple swing" approach.
User avatar
StevenAus
Posts: 84
Joined: December 18th, 2009, 12:15 am
Location: Perth, Australia
Contact:

Re: Bell curves and randomization, and other cool stuff. =)

Post by StevenAus »

Well I guess it just comes down to personal preference. I would rather not play most of a scenario (45 min to an hour) and lose the scenario based on a few bad rolls. I'd rather lose early, or lose late only if I have made a number of bad miscalculations. The luck vs. skill balance is always a hard one for any game.

Best regards,
Steven.
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Re: Bell curves and randomization, and other cool stuff. =)

Post by Velensk »

I think either you have misunderstood what we said or you are not explaining what you mean very well.
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Bell curves and randomization, and other cool stuff. =)

Post by zookeeper »

Posting Guidelines wrote:If you have a idea:

* Check the FPI (Frequently Posted Ideas) list. Wesnoth is a specific kind of game, and many features have been purposely excluded.
* Do a quick search of the forums. Most "new" ideas already have threads.
Since there's no indication that this thread really has anything new to offer on the topic of randomness in Wesnoth, I'll lock it. It's been debated to death years ago already, nothing good ever comes from these threads, it's not going to change and anyone is free to make add-ons or forks of the game which change how randomness works.

As for past threads about the subject, http://www.wesnoth.org/forum/viewtopic.php?f=6&t=21317 would be a good first read and you'll find more if you do a bit of searching.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Re: Bell curves and randomization, and other cool stuff. =)

Post by Dave »

Sorry zookeeper, but I felt that the discussion of random numbers is somewhat legitimate, especially if it gives people a better understanding of things. Note that I'm happy for this discussion to focus around how Wesnoth's random numbers or combat system works, etc, but not degrade into a hostile discussion.

StevenAus: the thing about your proposal is that it's useful if you have a variable amount of damage. However Wesnoth doesn't have a variable amount of damage. Every strike hits or misses.

As discussed above, Wesnoth does have a curve already based on multiple strikes.

With respect to the chance to hit when attacking, rolling multiple dice would have no meaningful effect. If you roll, say, 2d6 to hit, and you need 11 or more to hit, then that gives you around a 8.3% chance to hit. Why bother saying that you need 11 or more to hit and are rolling 2d6? Just jump to the chase and tell the player that they have a 8.3% chance to hit.

That is exactly what we do.

The mechanic that you and some others find frustrating isn't the way that we calculate getting hit, it's that each blow is either hit or miss, rather than focusing on variable damage amounts. As long as each blow hits or misses, you can do as much cooking on the numbers/calculations/etc behind the scenes as you want, but the fact will remain that every blow will have a certain percentage chance to hit once all your calculations are done.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
User avatar
Zarel
Posts: 700
Joined: July 15th, 2009, 8:24 am
Location: Minnesota, USA
Contact:

Re: Bell curves and randomization, and other cool stuff. =)

Post by Zarel »

pauxlo wrote: Only to correct a bit: adding two dice does not give a "bell curve", but a triangle curve: Image

The bell curve comes as a limit case of adding lots of dice ... as it also comes as the limit case of adding coin throwing results, what Wesnoth does with its "multiple swing" approach.
Note that the same is true of uniformly random distributions - the sum of two uniformly random distributions is a perfect triangle distribution, not a bell curve.

As mentioned by others, Wesnoth attacks are already multiple attacks, so they already do damage along a biased (off-center) bell curve - biased because the hit probability isn't always exactly 50%. Supersampling is a method to make bell curves smoother, but in the case of Wesnoth it would have the side effect of making hit probabilities a lot harder to calculate. Instead of being like "oh, enemy is in 60% terrain, so each of my attacks will have a 40% chance to hit" it'll be a really complicated formula that will make strategies using probability to your advantage so much harder.

There are many mods and a few patches out there that have implemented some form of supersampling to reduce randomness - as far as I know, they are all quite unpopular.
Proud creator of the :whistle: smiley | I prefer the CC-0 license.
User avatar
StevenAus
Posts: 84
Joined: December 18th, 2009, 12:15 am
Location: Perth, Australia
Contact:

Re: Bell curves and randomization, and other cool stuff. =)

Post by StevenAus »

Except that a reason why a particular mod is not popular can not easily be put down to one reason or another. Correlation ("two things happen together") and causation ("one thing *causes* another thing to happen") are two very different things, and the latter is *very* difficult to determine unless you do a huge number of carefully constructed tests and/or surveys. So don't assume that the reason why those mods are unpopular has to be that people don't like the main idea behind them. For example, Civ4 and FFH2 have all sorts of mods and modmods that co-exist, some more popular than others and some appealing more to some than others but there is no-one saying "the reason this one is unpopular is because it doesn't have enough randomness". For example, one big reason why such Wesnoth "less luck" mods could be unpopular is because it is strongly frowned upon by the dev group. The pressure to "fit in" can be a powerful motivator in human society, and I think it is unwise to completely discount it. I am not passing judgement on behalf of everyone who might be involved in Wesnoth - I am only making decisions for myself. I have found that whether a community is friendly, has little to do with whether it is open-source or not, or is based on a free game or a commercial game.

I think it has a lot to do with the interreactions between the players and the developers.

The first community I was ever involved in on the Internet was the Astral Wizard Heroes of Might and Magic community which formed around the Heroes of Might and Magic series of games, especially HOMM 2 and 3. It started to lose a bit of focus when HOMM 4 had shown that the developers weren't really in touch with the players any more. (However there is still a great sense of comraderie around the Quill YahooGroup to this day, and the new owners of the HOMM rights, Ubisoft, seem to be a bit better in some ways, though I think HOMM 2 and 3 are still cherished a bit more than the newer HOMM 5). So the reason that the original HOMM community faltered was not because it was based on a commercial game, but because the interreactions between the players and the developers had become less agreeable.

So that's about where I am now. I am not passing judgement on behalf of everyone. However I don't feel the same sense of comraderie and friendliness around the Wesnoth community that I feel in the HOMM or Civfanatics communities, or the VCMI Project which I am involved in. I felt a bit sad that this suggestion thread inspired by another similar turn-based fantasy game was locked (although it was unlocked) because I think a lot of people do genuinely want to improve Wesnoth and get frightened away when they are told "that idea is just like every other previous idea on this topic" and "we don't need to waste time or energy on this".

Every person and community needs to make its own calls. But the vibe of a community can be felt as a tangible "thing" by interacting in the community a little while and reading the forum posts. And as I have said and experienced by being involved in a number of communities, open-source or not has little to do with the overall friendliness or vibe of a gaming community. There are many commercial games that have this and many open-source games that don't, and vice versa. And I know more and less "friendly" open-source project communities. I think it all comes down to the interreactions between the players and the developers.

I wish the best for any turn-based fantasy project, but I have decided that I will not be spending time with Wesnoth anymore, despite the promising beginnings. As I said in my original post in this thread:

"Everyone needs to make their own decisions on what they find fun and rewarding, and I will do so too."

And so it will always happen.

Regards,
Steven Aus.
multilis
Posts: 69
Joined: November 27th, 2006, 12:36 am

Re: Bell curves and randomization, and other cool stuff. =)

Post by multilis »

Wish we could have choice as *option* selectable in mainline game setup, but I doubt it is going to happen unless someone forks Wesnoth into a new game with a new forum under different management.

A tweaked era would help somewhat... more attacks with less damage each.

Played number of Civilization variations single player, surprisingly one with *no* luck (c-evo) was often much more fun for me than ones with luck.

"open-source or not has little to do with the overall friendliness" agreed, seen resistance/distain for what large portion of user base wants in both, eg master of orion 3 example in the non-open.
Velensk
Multiplayer Contributor
Posts: 4002
Joined: January 24th, 2007, 12:56 am

Re: Bell curves and randomization, and other cool stuff. =)

Post by Velensk »

The more attacks for less damage was a mod that sauron did a long time ago. I tried that mod, wasn't to fond of it though when it comes to it I still think that it was a better idea than most of the other mods I've seen.

I don't know why anyone would compare a no luck mod for civilization with one for wesnoth though. Though the goal might be the same, the way it would effect gameplay would certainly be entirely diffrent. I don't know how to describe it but being deterministic would make me think more when playing Civ but if Wesnoth became deterministic I would have to think about less.

I find StevenAus's post as a whole amusing though I have no idea why. A bit annoying too because it gives the impression he hasn't read the responces.
"There are two kinds of old men in the world. The kind who didn't go to war and who say that they should have lived fast died young and left a handsome corpse and the old men who did go to war and who say that there is no such thing as a handsome corpse."
Caphriel
Posts: 994
Joined: April 21st, 2008, 4:10 pm

Re: Bell curves and randomization, and other cool stuff. =)

Post by Caphriel »

StevenAus wrote:I felt a bit sad that this suggestion thread inspired by another similar turn-based fantasy game was locked (although it was unlocked)
Oh no, Wesnoth isn't exactly like <other game I liked>! Please make it a clone of <other game I liked>!

I don't mean to be sarcastic (although that certainly was), but that is the general tone of a good number of the suggestions that are repeated constantly and get rejected out of hand. Players come to Wesnoth looking for something just a tiny bit different from some other game they like, and they want all the elements they liked from that game maintained, but a few small changes to things they didn't like made. Wesnoth is its own game, it's unique, and I don't think making it more like other games is a good reason to do something.

I think that overall, the developers of Wesnoth are amazingly patient with the user community at large, given that many of the most vocal and noticeable elements of said community are people who have their own vision for what they want Wesnoth to be, and rather than modding it themselves, they come and ask the devs to do it for them. Reading and understanding the Wesnoth design and philosophy should be a prerequisite to posting ideas, suggestions, or requests.
StevenAus wrote:I think a lot of people do genuinely want to improve Wesnoth and get frightened away when they are told "that idea is just like every other previous idea on this topic" and "we don't need to waste time or energy on this".
Wesnoth cannot be all games to all people. It's not an improvement to Wesnoth if it doesn't help Wesnoth better meet its design goals and doesn't adhere to its philosophy; it's just a change. A lot of people genuinely want to change Wesnoth to better suit their tastes, which, as I said above, are generally based on some other game they liked, or possibly just their first TBS. On the topic of the RNG, Wesnoth is designed to be a game with a significant amount of randomness. The devs have never discouraged people from making mods that reduce the amount of randomness. Open source does not mean "everyone in the world gets input into the design." It means that the people who do the work make the decisions.
Dave
Founding Developer
Posts: 7071
Joined: August 17th, 2003, 5:07 am
Location: Seattle
Contact:

Re: Bell curves and randomization, and other cool stuff. =)

Post by Dave »

@Caphriel & Velensk: Thank you for your replies! You took the words right out of my mouth. :)
Velensk wrote:A bit annoying too because it gives the impression he hasn't read the responces.
I concur. I have thought about the different way to calculate things in great detail and gave a reply to StevenAus's suggestion, explaining why as is it wouldn't work. (Not why I simply disagree with it but why it actually won't work the way StevenAus seems to think it will). For some reason this leads to a non-sequitur response philosophizing on communities and games and how they work.

David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
lmelior
Posts: 116
Joined: June 16th, 2009, 3:30 am

Re: Bell curves and randomization, and other cool stuff. =)

Post by lmelior »

I would also encourage the OP to seek out the various solutions (both user and developer-made) which were linked in the other recent thread about this very same topic. I've personally tried Sauron's mod, but zookeeper's own lessluck era might be easier since it doesn't require recompile. Sauron's mod addresses the issue more in the manner that the OP wants, though.
Sauron
Posts: 221
Joined: January 11th, 2006, 8:51 am
Location: Barad-Dur, Mordor
Contact:

Re: Bell curves and randomization, and other cool stuff. =)

Post by Sauron »

Just sightseeing, I see people are not using search ...
@StevenAus
Refer to my signature. I can see you're interested in some solution - please read the code, give a try to my mod - and contact me if you wish to cooperate.

[USUAL RANT]
By the way - 2 requests:
If you are WELL AWARE of my mod please point to its thread in such discussions; even if you do not want to implement it - at least mention someone who DID
In addition to that - if someone writes I abandoned my mod - better ask me first via PM, OK?
[/USUAL RANT]
Sauron
Customize yourself random factor in game:
GET my mod [available as C++ sourcecode and compiled Windows executable] for wesnoth 1.6.4
at http://saurons-mod.zor.org/
Mod thread
http://www.wesnoth.org/forum/viewtopic.php?t=26803
Post Reply