What do you think of the idea of using RNG functions whose output shows Gaussian distribution instead of the standard uniform distribution for things like damage?
Gaussian distribution means that the results in the middle of the range will be most common with extremes being rare (i.e. the infamous bell curve).
I never thought about this before but it seems to me this makes more sense than uniform distribution for most game mechanics. I mean very good hits and very bad hits should be rarer than average hits, right?
> What do you think of the idea of using RNG functions > whose output shows Gaussian distribution instead of the > standard uniform distribution for things like damage?
> Gaussian distribution means that the results in the > middle of the range will be most common with extremes > being rare (i.e. the infamous bell curve).
> I never thought about this before but it seems to > me this makes more sense than uniform distribution > for most game mechanics. I mean very good hits and > very bad hits should be rarer than average hits, right?
I never really thought of that but I guess that does make sense. I'd just be wary of making combat too consitent and boring.
Sir_Lewk wrote: > On Jan 6, 6:02 pm, copx <c...@gazeta.pl> wrote: >> What do you think of the idea of using RNG functions >> whose output shows Gaussian distribution instead of the >> standard uniform distribution for things like damage?
>> Gaussian distribution means that the results in the >> middle of the range will be most common with extremes >> being rare (i.e. the infamous bell curve).
>> I never thought about this before but it seems to >> me this makes more sense than uniform distribution >> for most game mechanics. I mean very good hits and >> very bad hits should be rarer than average hits, right?
> I never really thought of that but I guess that does make sense. I'd > just be wary of making combat too consitent and boring.
Well, its a matter of perspective you could either call it "consistent and boring" or "realistic" :P
Nate879 wrote: > D Notation (http://nethack.wikia.com/wiki/D_notation) approximates a > Gaussian Distribution. It's common for Roguelikes to use it. Nethack > uses it extensively.
Depends on how you implement your dice roller.. In Warp Rogue I implemented it so that something like dice(2,6) translated to random_int(2, 12) because its faster, and I wasn't even aware of the distribution issue back then.
But yeah, if you actually let your dice roller roll separate dice than the result gets closer and closer to gaussian distribution as the number of dice increases.
On Jan 6, 6:09 pm, Sir_Lewk <SirL...@gmail.com> wrote:
> I never really thought of that but I guess that does make sense. I'd > just be wary of making combat too consitent and boring.
This isn't actually a problem if you make your standard deviations large enough. As long as you can produce a wide range of values for each roll you can still make tests against a target number that is significantly higher than your average. For instance, if you distribution is mean 20 and standard deviation 10 you will still hit 30 target numbers 15% of the time.
Using a gaussian is not much different from games where you use a sum of multiple dice for each test. Gurps, which is very similar to D&D/ d20 except that you roll 3d6 instead of 1d20, comes immediately to mind. In these systems the average is far more likely than the outliers (a classic example is how much more common it is to roll a 7 on 2d6 than a 2 or 12).
You will have to balance your game a bit around it. Games with uniform number generators have a property that weak enemies in mobs can pose a threat because they can gamble on getting a few lucky hits (think of 10 goblins with no to-hit bonus swinging at a player with an AC of 18.... on average one will still hit every turn). Its not bad to lose this, but you do have to be considerate of it when you design the game.
> Using a gaussian is not much different from games where you use a sum > of multiple dice for each test.
There is a substantial difference even if the pdf is close: sums of "dice" fall within a predetermined and controllable interval, while a gaussian distribution isn't bounded. Any value can be produced with a very low probability; in particular, negative values are possible. This is the sort of unlikely special case that can cause complications.
On Jan 7, 9:20 am, Lorenzo Gatti <ga...@dsdata.it> wrote:
> There is a substantial difference even if the pdf is close.
Well, statistically, yes, but practically, no. I don't think that the fact that gaussian is continuous (as opposed to discrete) and can produce very high or low values (relative to the standard distribution) has much practical impact on game design.
> What do you think of the idea of using RNG functions > whose output shows Gaussian distribution instead of the > standard uniform distribution for things like damage?
> Gaussian distribution means that the results in the > middle of the range will be most common with extremes > being rare (i.e. the infamous bell curve).
> I never thought about this before but it seems to > me this makes more sense than uniform distribution > for most game mechanics. I mean very good hits and > very bad hits should be rarer than average hits, right?
I'd be very careful before summoning the ghost of 'realism' and inviting it over the threshold of the Roguelike House. That way lies madness and flame-wars.
Implementing a Gaussian distribution would blunt the fangs of the RNG to an extent, which may or may not be such a good thing.
In article <gk0nto$a6...@inews.gazeta.pl>, c...@gazeta.pl says...
> What do you think of the idea of using RNG functions > whose output shows Gaussian distribution instead of the > standard uniform distribution for things like damage?
> Gaussian distribution means that the results in the > middle of the range will be most common with extremes > being rare (i.e. the infamous bell curve).
> I never thought about this before but it seems to > me this makes more sense than uniform distribution > for most game mechanics. I mean very good hits and > very bad hits should be rarer than average hits, right?
Gameplay is more important than realism. That is the most important thing to remember. If Gaussians give better gameplay, use Gaussians. If lat distributions work better, use them.
It's also not true that everything tends towards a Gaussian distribution. The sum of multiple random variables does, but their product, for example, does not.
And I wouldn't expect the damage done by a sword in practice to be either a Gaussian or any of the distributions used in roguelikes. in practice it would do massive damage occasionally (i.e. when blocking failed). This would be bad for roguelike gameplay, so it doesn't happen.
> I never thought about this before but it seems to > me this makes more sense than uniform distribution > for most game mechanics. I mean very good hits and > very bad hits should be rarer than average hits, right?
Is there any way to test or quantify whether the effect is actually perceptible to the player and if it is, how does it make the actual gameplay feel different?
For what it's worth, out of the well-known pen & paper RPG systems, D20 uses an uniform distribution and Gurps approximates a Gaussian distribution with 3d6. Here are some notes on converting D20 to use 3d6 for resolution: http://www.d20srd.org/srd/variant/adventuring/bellCurveRolls.htm
I'm not sure that a Gaussian distributions would necessarily be a good thing from a gameplay viewpoint. A distribution clustered around the center (boring) with the odd outlier (oneshotted by a kobold) doesn't initially seem as fun as a building things around an uniform distribution where the unusual things happen more often. Then again, it might make the outlier events more memorable and interesting.
copx wrote: > What do you think of the idea of using RNG functions > whose output shows Gaussian distribution instead of the > standard uniform distribution for things like damage?
For damage, most roguelikes already use near-gaussian distributions in the forms of sums of die rolls. But most use a linear distribution when determining hits.
Anyway, you'll need to chop off the "long tail" of the Gaussian distribution to avoid generating negative damage numbers, or else fix your combat routines to ignore or use them. If you want to use Gaussian distributions for hit rolls, maybe negative numbers correspond to fumbles? It's up to you.
> Gaussian distribution means that the results in the > middle of the range will be most common with extremes > being rare (i.e. the infamous bell curve). > I never thought about this before but it seems to > me this makes more sense than uniform distribution > for most game mechanics. I mean very good hits and > very bad hits should be rarer than average hits, right?
I dunno. If your priority is realism about battle wounds, talk to an army doctor about what the range of "typical" combat trauma is like. It may look nothing like gaussian distributions. But if your priority is making a good game, your time may be better spent talking to players about what they liked and disliked and observing what keeps them engaged in the game.
>Sir_Lewk wrote: >>I never really thought of that but I guess that does make sense. I'd >>just be wary of making combat too consitent and boring. >Well, its a matter of perspective you could either >call it "consistent and boring" or "realistic" :P
Since when was realism a good thing, and since when was average damage realistic? If you want realism, most wounds in single combat should be either trivial or fatal (inasmuch as any serious injury will cause your opponent to finish you off if there's no-one around to help you). -- David Damerell <damer...@chiark.greenend.org.uk> flcl? Today is First Olethros, January - a weekend.
IIRC, 97.5% of the values that occur are within the range [-3*deviation, +3*deviation]. So you can easily make an attack that most of the time deals values between 10 and 20 hp, with the odd critial hit/critical failure. Also I like the idea of negative values representing bad failures! But maybe it would be too harsh on new characters.
On the subject of alternate distributions for random number generation, I've seen a system used that isn't quite Gaussian but is food for thought. The game makes the player aware of a probability to hit between 0% and 100%, but in reality, it generates two random numbers between 0% and 100% and compares their mean against the target value, making unlikely outcomes less likely and likely outcomes more likely.
On Wed, 7 Jan 2009 06:20:31 -0800 (PST), Lorenzo Gatti
<ga...@dsdata.it> wrote: >On Jan 7, 1:19 am, msal...@gmail.com wrote: >> Using a gaussian is not much different from games where you use a sum >> of multiple dice for each test.
>There is a substantial difference even if the pdf is close: sums of >"dice" fall within a predetermined and controllable interval, while a >gaussian distribution isn't bounded.
True, although you can easily create a wrapper function that ensures that no value is beyond ~3-4 standard deviations if you sense a small stick could take out a DeathStar in one hit.
This is "safe" since anything past 4 standard deviations is too rare to consider, and probably could result in a form of scumming.
In article <cb39987b-f70c-4619-b172- a1144f007...@s9g2000prm.googlegroups.com>, BongoB...@gmail.com says...
> On the subject of alternate distributions for random number > generation, I've seen a system used that isn't quite Gaussian but is > food for thought. The game makes the player aware of a probability to > hit between 0% and 100%, but in reality, it generates two random > numbers between 0% and 100% and compares their mean against the target > value, making unlikely outcomes less likely and likely outcomes more > likely.
That's the same as using two dice - it gives a triangular distribution. It's a step in the series leading towards a Gaussian distribution -
1 die gives a flat distribution 2 dice give a triangular distribution with a peak in the middle 3 dice give a distribution that already looks a bit bell-shaped
Indeed, the triangle is probably quite adequate for most games in which the uniform distribution is too flat.
There are other systems. In my game weapons do a flat 50% of damage plus a uniformly distributed fraction of the remaining 50%. My logic was that in a game with no free health regeneration, it was good to allow the player situations in which he can be certain of a kill.
On 10 Jan, 16:22, Gerry Quinn <ger...@indigo.ie> wrote:
> That's the same as using two dice - it gives a triangular distribution. > It's a step in the series leading towards a Gaussian distribution -
> 1 die gives a flat distribution > 2 dice give a triangular distribution with a peak in the middle > 3 dice give a distribution that already looks a bit bell-shaped
> Indeed, the triangle is probably quite adequate for most games in which > the uniform distribution is too flat.
That makes sense. Actually now I'm convinced that a "triangle-shaped distribution" is even better than white noise or gaussian noise.
> There are other systems. In my game weapons do a flat 50% of damage > plus a uniformly distributed fraction of the remaining 50%. My logic > was that in a game with no free health regeneration, it was good to > allow the player situations in which he can be certain of a kill.
This is the same as shifting your distribution to the right.
I think that the most intuitive way to go about it is to define a mean value (average) and a max variation value. With a system like "50% fixed damage, 50% roll" you still have to run some calculations off the top of your head, but with mean+variation you know you can score 40dmg (mean) most of the time, plus or minus 10dmg depending on your luck.
---
A related topic is how should the distribution vary with the gameplay? Should we always use the same distribution for every calculation?
Maybe regular weapons could use triangle or gaussian (reflecting natural distributions), and magic tend more towards extreme values, using plain random values within wide ranges (feeling a bit more unpredictable). I didn't give much thought to other actions like lock- picking, or ranged combat vs. melee. Anyway, players are good at estimating the variance of an effect given a few samples, and magic would feel much more unpredictable than standard weapons.
Another thing is how damage evolves with the player's level. Advancing in level could not only increase the average damage dealt, but also reduce the variation. Skilled fighters can deal the same damage repeatedly with small chance of mistake, while inexperienced fighters will have either lucky breaks or complete failures.
"Jotaf" <jota...@hotmail.com> wrote: > A related topic is how should the distribution vary with the gameplay? > Should we always use the same distribution for every calculation?
One thing that comes to mind is changing the distribution based on the skill of the player. If a player is unskilled with a weapon or magic or whatever, use a linear distribution to reflect the wild variance you have with a rookie. As the player advances in skill switch over to triangular and finally Gaussian to reflect the the mastery the player has with the weapon or spell.
You could actually mix and match this with the same character. If he is proficient with a sword, you use Gaussian. However, he isn't that good with a Halberd so you use triangular. He's terrible with a flail so you use linear.
If you really want pseudorandom Gaussian numbers, the Box-Muller transformation takes two independent values x1, x2 from a uniform (0,1) distribution, and returns two independent values from a normal (0,1) distribution
But as others have indicated, the extreme outliers in the Gaussian might be difficult to balance. If you want to directly specify a mean and a maximum range of scatter, something like mean + 1d(scatter) - 1d (scatter) works.
On Jan 13, 6:19 pm, "rdc" <rickclar...@gmail.com> wrote:
> If a player is unskilled with a weapon or magic or whatever, > use a linear distribution to reflect the wild variance you have with a > rookie. As the player advances in skill switch over to triangular and > finally Gaussian to reflect the the mastery the player has with the weapon > or spell.
You don't want to do it this way, but it is a neat idea. What I don't recommend is using different distributions like this. The problem is, when you use linear for 'bad' and normal for 'good', then a player that is bad has a better chance of getting very good rolls (if you are not careful). But if you are using a distribution like a normal, you can instead increase the mean and reduce the variance of your roll as you become more skilled.
I play with a similar system when I write my roguelike vaporware. Basically, each skill point increases the average of your skill rolls by 1, but also decreases the variance. I use something like the following formula:
0: 2d10 (mean 11 max 20) 1: 2 + 2d9 (mean 12 max 20) 2: 4 + 2d8 (mean 13 max 20) 3: 6 + 2d7 (mean 14 max 20)
It would be easy to do something similar with normals if you wanted to (I initially was going to but went with this for ease of explanation).
In article <a14d68e0-541e-406d-8746- fa4d80486...@p2g2000prn.googlegroups.com>, jota...@hotmail.com says...
> On 10 Jan, 16:22, Gerry Quinn <ger...@indigo.ie> wrote: > > There are other systems. In my game weapons do a flat 50% of damage > > plus a uniformly distributed fraction of the remaining 50%. My logic > > was that in a game with no free health regeneration, it was good to > > allow the player situations in which he can be certain of a kill.
> This is the same as shifting your distribution to the right.
> I think that the most intuitive way to go about it is to define a mean > value (average) and a max variation value. With a system like "50% > fixed damage, 50% roll" you still have to run some calculations off > the top of your head, but with mean+variation you know you can score > 40dmg (mean) most of the time, plus or minus 10dmg depending on your > luck.
Yes, but in Lair every class has a weapon type they never miss with, and if they have such a weapon that does 10 damage, and there is a nearby mob with 5 health, they know for sure it will die from one blow and not be able to hit back. That can matter a lot if you are down to the wire and have no healing potions or abilities. It matters most to warriors and archers, obviously.
Not knocking your system, just telling you the way mine works.
<msal...@gmail.com> wrote: > You don't want to do it this way, but it is a neat idea. What I don't > recommend is using different distributions like this. The problem is, > when you use linear for 'bad' and normal for 'good', then a player > that is bad has a better chance of getting very good rolls (if you are > not careful). But if you are using a distribution like a normal, you > can instead increase the mean and reduce the variance of your roll as > you become more skilled.
Very good point. I hadn't thought of that. Your method sounds much more consistent.
In article <a14d68e0-541e-406d-8746- fa4d80486...@p2g2000prn.googlegroups.com>, jota...@hotmail.com says...
> Maybe regular weapons could use triangle or gaussian (reflecting > natural distributions), and magic tend more towards extreme values, > using plain random values within wide ranges (feeling a bit more > unpredictable).
Or vice versa... in my game wands always do exactly X damage, unlike weapons which have a random element.
It's actually an interesting facet of game design when you think about it - if your character is going to be on the edge of survival, deterministic behaviour is a big factor in the value of an item / spell etc. If instead he can take a few hits before dying, it is much less important.
My game leans towards determinism, but this is not intrinsically better or worse than leaning towards randomness, just something that should match the game style.