Battle Brothers

Battle Brothers

View Stats:
Lilltiger Aug 12, 2021 @ 11:59am
How is the radoms calculated in this game?
What type of RNG is the game using, is it jusing a plain rand() or some more advanced RNG like mersenne twister?
And how and how often is the reseeding of it done?
< >
Showing 16-30 of 36 comments
JCSato Aug 17, 2021 @ 11:57am 
Something to keep in mind - "in a row" can be misleading if you're just looking at the combat log. The log doesn't include damage rolls, head hit rolls, morale checks (e.g. when engaging in melee), and so on. There are cases where several attack rolls are truly "in a row", but they're even rarer than they appear.
Lilltiger Aug 17, 2021 @ 6:29pm 
Originally posted by LDiCesare:
Originally posted by Lilltiger:
From my tests it seems to be a roll of 100, is there any mods or things that changes this to a roll of 20?
I find it just boring and annoying to have 80% chance to hit and miss 5 times in a row just because the roll is 1d100. For a game like this to be designed that way makes no sense at all, there is a reason to why roleplaying games used 1d20 or 3d6 etc. for rolls.
Care to explain the difference between 1d20 and 1d100? I mean, it's exactly the same but multiplied by 5 for me. 3d6 is a completely different distribution, though.
I mean, if you generate a number between 0 and 1, then mutliply by either 19 or 99 and add 1.5, then round to the lowest number, you get numbers between 1-20 or 1-100, but the scaling changes nothing to your results. Particularly if you round 87% to 17/20.
Also, a lot of RPG used 1d100, Call of Cthulluh being a prime example.

As for missing 4 times in a row with 5% chances, the probability of that happening is 1 in 160,000. So it should definitely happen if you roll a hundred thousand times or more. Considering a combat has around 12 bros vs 12 enemies (usually more) who swing probably ten times each, each fight is around 120 rolls. So after a thousand combats, this should probably happen at least once. Considering a fight a day, if you play 1 thousand days, you should see that happen. Considering there are thousands of players, some players should see that on day 1. If it's really random.
4 misses are 80% are obvioulsy to be expected very often. That should happen every 625 tries on average, which means one fight out of 5. If not, it would mean the RNG is rigged.

The differense is in the distribution set generated, if you roll 1d20 you get numbers between 1-20, each have an equal chance to appear on the first roll, but each number get an statistcaly less chance to appear again for each time it get's rolled untill all numbers on the dice have been rolled.
So for the 80% range you have 4 numbers that would be misses. Each time you roll one of these 4 numbers the chance for it to appear again before the other numbers decreses.
So if you roll 1,4,3,1,2,3,1,4 The chance for rolling one of these numbers again are extreamly unlikly, but the most likly of them is a 2.

Now on a d100 there are 20 numbers it has the exhaust, making a big difference on small amounts of rolls, as evry one of those numbers have the same chance to appear as any other number.

The reason to why do did not notice any issues with it when playing CoC RPG is because you did not roll a 1d100, you rolled 2d10 with one with power of 10 to the values. This gives a very different distrubution set to a single d100.

A good way to visualize this is to generate let's say 2000 numbers using the different sets, and then analyze them in chnuks and see wich set's include the longest chunks of numbers outside the 80% hit range.
It should not come as a suprise to anyone that the plain d100 contains far longer chunks of this.
bulbatrs Aug 17, 2021 @ 11:19pm 
I'm not sure what sort of math they teach in Sweeden, but that's not how the math works.
Lilltiger Aug 18, 2021 @ 3:08am 
Originally posted by bulbatrs:
I'm not sure what sort of math they teach in Sweeden, but that's not how the math works.

You could try it out at home, as I said, generate those sets of numbers and start looking at them to see where you find the longest chunks of values corresponding to the condition.

Probability averages out over large sets of numbers, but smaller chunks will not adhere to it the same way.
suejak Aug 18, 2021 @ 4:25am 
Originally posted by Lilltiger:
The differense is in the distribution set generated, if you roll 1d20 you get numbers between 1-20, each have an equal chance to appear on the first roll, but each number get an statistcaly less chance to appear again for each time it get's rolled untill all numbers on the dice have been rolled.
You are confusing the concept of dependency with the likelihood of specific series.

Every die roll is independent, in Battle Brothers and in real life. If you are rolling a D20, you have a 5% chance of getting any particular number. If you roll a 10, you had a 5% chance of getting 10. Your chance of rolling 10 on the second roll is still 5%, even though the outcome 10,10 is relatively unlikely (0.25%).

If you roll the die 20 times, you have an independent 5% chance of rolling 10 on each individual roll, regardless of whether you rolled a 10 the previous single roll or not.

The reason for this is that the probability of any given specific combination in a specific order is equally likely. The likelihood of rolling 10 and then 2 is also 0.25%, just like 10 and then 10.
Last edited by suejak; Aug 18, 2021 @ 4:26am
Kuattro Aug 18, 2021 @ 4:26am 
Gambler's fallacy strikes again, the scoundrel.
hudd Aug 18, 2021 @ 5:20am 
Missing 3 90% chances in a row for example is just a 1000:1 shot.
But considering how many "dice" are rolled each battle, and the almost infinite range of possible coincidences, its not really that surprising that you notice these sequences quite often.
Fatbill Aug 18, 2021 @ 6:52am 
Originally posted by hudd:
Missing 3 90% chances in a row for example is just a 1000:1 shot.
But considering how many "dice" are rolled each battle, and the almost infinite range of possible coincidences, its not really that surprising that you notice these sequences quite often.

Yes, but missing 3 95% shots in a row is an 8000:1 shot or 4 X 90% is 10000:1 and both have happened to me more than once, and yet, if what the devs say is a true 1000:1 shot, finding a 3x3* BB, most people have not seen once. I've seen it once.

So, there what the math is supposed to be, and then what actually happens.

Last edited by Fatbill; Aug 18, 2021 @ 6:57am
Calandro Aug 18, 2021 @ 8:23am 
Originally posted by Fatbill:
Originally posted by hudd:
Missing 3 90% chances in a row for example is just a 1000:1 shot.
But considering how many "dice" are rolled each battle, and the almost infinite range of possible coincidences, its not really that surprising that you notice these sequences quite often.

Yes, but missing 3 95% shots in a row is an 8000:1 shot or 4 X 90% is 10000:1 and both have happened to me more than once, and yet, if what the devs say is a true 1000:1 shot, finding a 3x3* BB, most people have not seen once. I've seen it once.

So, there what the math is supposed to be, and then what actually happens.

I mean the obvious answer is that
A. You've made FAR more attacks than hired brothers
and
B. As Sato said above, it's not "3 95% shots in a row" or "4 X 90%" in a row, since you tend to ignore all of the random rolls you don't see behind the scenes, such as damage rolls, resolve checks, or even simply just the the random numbers generated for things like checking if an arrow should go astray, or what sound to play.
Marty Chonks Aug 18, 2021 @ 10:34am 
Originally posted by Calandro:
B. As Sato said above, it's not "3 95% shots in a row" or "4 X 90%" in a row, since you tend to ignore all of the random rolls you don't see behind the scenes, such as damage rolls, resolve checks
Why/how exactly should a miss generate resolve or damage roll? Does the game roll for damage or resolve, even if it's a miss? (i m just curious if it does or doesn't)
Calandro Aug 18, 2021 @ 10:52am 
Originally posted by Marty Chonks:
Why/how exactly should a miss generate resolve or damage roll? Does the game roll for damage or resolve, even if it's a miss? (i m just curious if it does or doesn't)

I didn't say they did, I said people ignore them.

But to answer your question, they won't cause those specific rolls, but often there are other uses of the Math.rand method, be it selecting what sound effect to play when the skill is used or misses, the random element of AI for the enemy, etc.
Last edited by Calandro; Aug 18, 2021 @ 10:56am
LDiCesare Aug 18, 2021 @ 11:25am 
Originally posted by Lilltiger:
The differense is in the distribution set generated, if you roll 1d20 you get numbers between 1-20, each have an equal chance to appear on the first roll, but each number get an statistcaly less chance to appear again for each time it get's rolled untill all numbers on the dice have been rolled.
No. That is not randomness at all. If you roll real dice, you can see it. If you were right, every time you spin a coin for heads or tails, you would know the next result: Head. Head is exhausted, thus the next soin will be tails and you'll never have 3 heads in a row.
There are some games that offer such variants of randomness. I suggest checking this Colony Ship thread https://steamcommunity.com/app/648410/discussions/0/5805689546860220887/ where they discuss true random vs lightly adjusted vs heavily adjusted. You describe a "heavily adjusted" scheme, which results in bad results, probably because it's a set of 100 values as you point out. However, unless you use this (very non-random) pseudo-random generator, the number in the sets doesn't matter.
Lilltiger Aug 18, 2021 @ 1:15pm 
Originally posted by LDiCesare:
Originally posted by Lilltiger:
The differense is in the distribution set generated, if you roll 1d20 you get numbers between 1-20, each have an equal chance to appear on the first roll, but each number get an statistcaly less chance to appear again for each time it get's rolled untill all numbers on the dice have been rolled.
No. That is not randomness at all. If you roll real dice, you can see it. If you were right, every time you spin a coin for heads or tails, you would know the next result: Head. Head is exhausted, thus the next soin will be tails and you'll never have 3 heads in a row.
There are some games that offer such variants of randomness. I suggest checking this Colony Ship thread https://steamcommunity.com/app/648410/discussions/0/5805689546860220887/ where they discuss true random vs lightly adjusted vs heavily adjusted. You describe a "heavily adjusted" scheme, which results in bad results, probably because it's a set of 100 values as you point out. However, unless you use this (very non-random) pseudo-random generator, the number in the sets doesn't matter.

Actually you can see it perfectly well in coin-flip, as a coin-flip have a small set of distributed numbers, and a high liklyness for repeated numbers.
So if you flip a coin you will quite fast reach a 50/50 result, because it's a small set, but you will also see a lot of long repeats of the same numbers.
The larger "dice" you choose the longer time it will take to get to 50/50 and you will also see shorter and shorter repeats of the same number.

So insted of the coin, randoms over a set of 1 centillion, and see how fast you reach a 50/50 parity.
Cat® Aug 18, 2021 @ 8:13pm 
How does a d20 give "50\50" distribution? Unless you assign 1-10 as "A" and 11-20 as "B": in which case it is equivalent to flipping a coin as to whether you get A or B outcome.

Unless you mean getting an even distribution of numbers, as in a d20 takes longer to roll 1, 2, 3, 4, 5, etc one time than it takes a coin to flip head or tails 1 time each; in which case, yeah; but that's because you're rolling it 18 times more at minimum. If you flipped a coin 20 times and counted the distribution of outcomes looking for 10 instances of heads, and 10 instances of tails; you'd take just as long.

The equivalent to "1d2 reveals 1 and 2 frequently" is equivalent to "1d20 reveals 1-10 and 11-20 frequently", same for d'centillion.

Why... Why am I even writing this...
DT Aug 19, 2021 @ 3:08am 
Some people who still to dumb to different between 'Probability' and how 'Normal Math' are the kind of people that likely gone bankrupt if they go to gamble house because the have a though like...

After they lost there bet with 1d10 for 9 times in row in gamble house, they put everything + borrow from loanshark to play there 10th bet because they though they going to win this time... that how math work (for them). :steammocking:

After he lost everything then he going to make a ruckus threatening to sue gamble house for cheat him. Because he should win that 10th game accord to how 'Math' work.
Last edited by DT; Aug 19, 2021 @ 3:25am
< >
Showing 16-30 of 36 comments
Per page: 1530 50

Date Posted: Aug 12, 2021 @ 11:59am
Posts: 36