Skip to content

Instantly share code, notes, and snippets.

@TiiaAurora
Created September 23, 2022 23:24
Show Gist options
  • Save TiiaAurora/f6805f232e859ecef78d78cb8bdc5ce7 to your computer and use it in GitHub Desktop.
Save TiiaAurora/f6805f232e859ecef78d78cb8bdc5ce7 to your computer and use it in GitHub Desktop.
Calculating the number of females needed for mutating a specific stat in ARK
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# How many females needed for a high chance of the *right* mutation in ARK?\n",
"\n",
"**Question: How many females are needed if we want to get a mutation in a specific stat?** \n",
"\n",
"For breeders in ARK it is important to know how many females they need or how many eggs they have to hatch in order to get a mutation on the *right stat*. These numbers vary a lot by the mutation chance and the way the breeding is done. With this code we look into all possibilities for unmodded ARK and modded ARK (S+ Mutator) to find the answer to the question above. "
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"# Fixed mutation chances in the game. We use these numbers as the base for our calculations. \n",
"mut_chance_normal = 0.07314063\n",
"mut_chance_one_side = 0.0407\n",
"mut_chance_mutator = 1\n",
"mut_chance_mutator_one_side = 0.5"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Calculation how many females are needed\n",
"\n",
"We print out the amount of females needed depending on the mutatable stats and the accepted failure rate.\n",
"\n",
"- 6 mutatable stats = flyers, Shadowmanes etc\n",
"- 7 mutatable stats = normal creatures like Rexes\n",
"- 8 mutatable stats = Gachas"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Mutation chance, failure rate, num females\n",
"\n",
"6 stats:\n",
" 7.3% 10.0% 188\n",
" 7.3% 5.0% 245\n",
" 4.1% 10.0% 339\n",
" 4.1% 5.0% 441\n",
" 100.0% 10.0% 13\n",
" 100.0% 5.0% 17\n",
" 50.0% 10.0% 27\n",
" 50.0% 5.0% 35\n",
"\n",
"7 stats:\n",
" 7.3% 10.0% 220\n",
" 7.3% 5.0% 286\n",
" 4.1% 10.0% 395\n",
" 4.1% 5.0% 514\n",
" 100.0% 10.0% 15\n",
" 100.0% 5.0% 20\n",
" 50.0% 10.0% 32\n",
" 50.0% 5.0% 41\n",
"\n",
"8 stats:\n",
" 7.3% 10.0% 251\n",
" 7.3% 5.0% 327\n",
" 4.1% 10.0% 452\n",
" 4.1% 5.0% 588\n",
" 100.0% 10.0% 18\n",
" 100.0% 5.0% 23\n",
" 50.0% 10.0% 36\n",
" 50.0% 5.0% 47\n"
]
}
],
"source": [
"import math\n",
"\n",
"print('Mutation chance, failure rate, num females')\n",
"\n",
"for num_stats in range(6,9):\n",
" print(f'\\n{num_stats} stats:')\n",
"\n",
" for mut_chance in [mut_chance_normal, mut_chance_one_side, mut_chance_mutator, mut_chance_mutator_one_side]:\n",
" for fails in [0.1, 0.05]: # 10% and 5% chance of failing a round\n",
"\n",
" # Calculate failure chance\n",
" chance = 1 - (mut_chance / num_stats)\n",
"\n",
" # Calculate number of females needed\n",
" females = math.log(fails) / math.log(chance)\n",
"\n",
" print(f'{mut_chance*100:>14.1f}%{fails*100:>13}%{math.ceil(females):>13}')"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.10.6 64-bit",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "f4bbf7bf54ec28419bb8559d1cc960d3b88e71e092d114e1d36013275ad0f733"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment