Suggested tweaks to the random civ picker

Hello!

Recently I’ve made a post about how I was getting the same civilizations on a row. Decided to take a step further and made a little experiment where I did the following:

  1. Create a skirmish lobby with 1 player and random civ.
  2. Launch the game and store the results in a sheet
  3. Repeat 1&2 500 times.

Here are my results below:

This graphs details the pickrate of each civ

There were 14 instances of choosing the same civ twice in a row.

The conclussions I got from this experiment were as follows:

  • If we were to suppose that the civ picker was fair, then each civ should have a 1/42 (~2.38) chance to be selected. The graph clearly shows that some civs are more likely to be selected than others.

  • Some civilizations weren’t chosen at all, this is related to the first point, since the random pick generator isn’t fair, 7 civs didn’t get picked (Berbers, Bulgarians, Byzantines, Cumans, Goths, Saracens and Tatars).

There were times that the civ picker wouldn’t repeat civs in a row but do Italians → Hindustanis → Italians → Sicilians → Italians.

SUGGESTIONS:

  1. Add a “repetition protection” random option, each time you get a civ, it will get removed from the pool of possible civs you’re able to randomly select, that way you won’t be able to get repeated random civs in the same game session.

  2. Let me choose the pool of random civs I want to play, this is already an option on lobbies where you’re able to select a group of random maps to play. Since the current random option doesn’t allow us to play with repeated civs between players, this setting should work like full-random in that regard (i.e. you select a random pool of just Franks and the enemy picks Franks, you get to play with Franks).

This is what the random map pool option looks like:

Thank you for taking the time to read this!

4 Likes

This is actually how Probability works, all of them have the same probability of being chosen. But that doesn’t mean for 500 chances, each civ would be picked the same number of times.

The Law of Large Number states, “As a sample size grows, its mean gets closer to the average of the whole population.” This is due to the sample being more representative of the population as the sample become larger. I’m pretty certain if this was done 100000 times, the graph would become uniform, that is each civ would be selected near equal number of times. Increase the test numbers and it will keep increasing until all of the civs reach the same value.

However, I completely agree with this idea. In fact, I once proposed this idea to this community too. Post Link.

2 Likes

Thank you for the reply!

I definetly see what you mean with your 1st and 2nd paragraphs, and if I really wanted to check that every civ has the same random pickrate I need an even bigger sample size.

But there’s one thing that I don’t manage to understand, if we suppose that the probability to pick each civ is the same (1/42) and in 500 games 7 civs didn’t get picked at all.

The probability to not get a civ in 500 games should be: (1 - 1/42)^500 = ​0.00000585171492838 which seems extremely low to me.

If I were to continue with this test then I should keep repeating this experiment over different game sessions and an even larger amount of games. I could even keep playing ranked with random enabled then at the end of the year review my stats.

(Math below are directly out of my mind, probably there would be some errors but whatever)
That sounds reasonable, the expected number is around 499/42 ~= 11.8 times and 14 times are not too far from that,
Tho the prob of (7) civ not appearing in 500 games are (1-35/42)^500, which is extremely small (as you noticed its rare for even one civ to not appear).

I think skirms may not be a good testing around (I recall some weird random behaviour when I test something vs AIs), and I definitely recall randoming into tatars more often than this.

Perhaps it would be easier to stick to some pros that are using random, and filter out the times where they are not randoming into a civ.

1 Like

This is actually wrong; or rather, it is only true in a relative sense but wrong in an absolute one.
The larger the sample, the bigger the difference (in absolute numbers) between the most and the least picked civilzation. Only the relative difference shrinks.

No, thats the probability of not getting one specific civ (e.g. huns).

1 Like

no, that’s the probability of Berbers, Bulgarians, Byzantines, Cumans, Goths, Saracense and Tatars not appearing. the probability of any 7 civs not appearing is way higher

4 Likes

but you are right, i ran some random number generator in excel and getting that many civs to not appear at all in 500 games is very strange.

it’s also interesting that there are 7 civs which have been added through DLC. so maybe there is a bug where it has a random(35) function or something like that

did you use ‘random’ or ‘full random’?

I used random (I use the same option on ranked).

42C1 * (1/42)^0 * (1 - 1/42)^500

Picking One Civ out of 42: 42C1
Not getting that Civ for once in 500 Games: (1/42)^0
Getting other 42 Civs in 500 Games: (1 - 1/42)^500
So, the probability of a random civ not getting picked would be = 42C1 * (1/42)^0 * (1 - 1/42)^500 = .000245

Edit: Wrong math below
So, summation of the 7 cases where the one civ was not picked would be = 7 * 0.000245 = .00172

I hope I am correct with the math .11

What I meant was, the civ picked distribution will get more uniform over more sample size. I hope we both mean the same thing?

This is an interesting oversight on my end. If I am not wrong how the Random works is, if your enemy has selected a certain Civilization, the probability of you getting that same Civilization in the same game becomes 0. So, if you were using Random, and not Full Random. The Civ Selection distribution would no longer be uniform based on the civs your opponent picked. So, yes, in those cases the civs selected by your opponent(s) will be excluded from the distribution.

Yes, i think we mean the same, i just found your wording (“all civs reach the same value”) very inprecise, as the value diverges more and more, only the percentage converges.

1 Like

i dont think it is correct, because those probabilities are not independent. Try the same approach on “probability to not get a vic in 10 games”, it should return 1. because you can’t get all civs in 10 games.

But with your formula you would get 42* (1-1/42)^10 which is way bigger >1
similarly at 42 civs the chance should be high, but <1, but it’s still >1 with your formula

I’m not 100% sure how to calculate it accurately though

The weird part is that I did this test with only 1 player, I should try again with “full random” instead.

If you want to actually do this properly:

this reminds me why I dropped all stats courses and went for pure maths in uni instead

2 Likes

I was skeptical about it. I treated each of them as independent events. Which is not correct. I think the correct math would be:

The 7 Civs I won’t get out of 42: 42C7
Not getting those Civ for once in 500 Games: (7/42)^0
Getting other 42 Civs in 500 Games: (1 - 7/42)^500

So, the probability of 7 civs not getting picked would be = 42C7 * (7/42)^0 * (1 - 7/42)^500 = 6.924 * 10^-33.

Which indeed is very very low. However as per my last reply, since the OP used Random civ, it was not uniform distribution to begin with.

1 Like

Understandable 11. I am still in Uni, and Statistical Analysis is one of the courses I have this semester.

this looks good. I think it would be slightly more accurate to look at “7 or more civs never getting chosen”, but the difference should be tiny

The way i interpret the description of “random” is that it takes into consideration how often each civ hast been played by you.
The 7 civs that you didnt get with random arent by any chance the civs you picked/played a lot so far?

Ya I should multiply by 42C7… proof that my math is running elsewhere