EDIT: It's since come to my attention that this whole thing might be poining in the wrong direction, in which case the example will be less useful, but at least there's a repro case for the weights being wrong. Oh well... post edited to remove now irrelevant info.
Description
AI Ascension Perk Weighted Random Abnormalities
Game Version
3.4.5
What version do you use?
Steam
What expansions do you have installed?
All of them
Do you have mods enabled?
No, but modifications were made to show the issue, detailed below
Please explain your issue is in as much detail as possible.
When an AI chooses an ascension perk, it picks a random choice, weighted by the weights specified in the definition of the perk. The results do not match the given weights, resulting in an incorrect distribution of perk picks.
Initially during modding I was experiencing an issue where I could not get the AI to pick a perk, no matter how high the weights were. This led me to investigate possible causes, and eventually led me to making a single modification to the vanilla ascension perk file to test the behaviour in as simple way as possible.
To that end, I commented out the requirements for Galactic Wonders, and matched its weight to the 10000 of the ascension path finishers. This should make the chance, when weighted against the other perks available at the start, roughly 10000 in 10160, around 98.5%.
I then ran ten test games, observing the order in which an AI picked its perks. In all but one case (a gestalt), it was picked between second and seventh, most often fourth, despite the apparent 98.5% chance to be picked at each step. At this chance, being picked fourth should be a 1 in 241000 occurance, and seventh should be 1 in around 86 billion.
I worked the weights manually in a spreadsheet for the first two test games, and then went on to assume a rough 1.5% chance for other perks to be picked after that as each instance was roughly the same. A screenshot of the spreadsheet is attached.
Results:
1. 3rd perk
2. 4th perk
3. 4th perk
4. 4th perk
5. 1st perk (this game was a gestalt, and I believe it happened because several other early perks are unavailable to them)
6. 6th perk
7. 4th perk
8. 2nd perk
9. 7th perk
10. 6th perk
These results, assuming that the weights were being calculated correctly and a 4th perk pick being 1 in 241000, were unlikely to say the least, so something's definitely up. The attached perk file has the modifications.
Steps to reproduce the issue.
Use the changes to galactic wonders listed above or in the attached 00_ascension_perks.txt file to alter the perk and observe the AI failing to pick it despite the apparent overwhelming chance.
Upload Attachment
File(s) attached
Description
AI Ascension Perk Weighted Random Abnormalities
Game Version
3.4.5
What version do you use?
Steam
What expansions do you have installed?
All of them
Do you have mods enabled?
No, but modifications were made to show the issue, detailed below
Please explain your issue is in as much detail as possible.
When an AI chooses an ascension perk, it picks a random choice, weighted by the weights specified in the definition of the perk. The results do not match the given weights, resulting in an incorrect distribution of perk picks.
Initially during modding I was experiencing an issue where I could not get the AI to pick a perk, no matter how high the weights were. This led me to investigate possible causes, and eventually led me to making a single modification to the vanilla ascension perk file to test the behaviour in as simple way as possible.
To that end, I commented out the requirements for Galactic Wonders, and matched its weight to the 10000 of the ascension path finishers. This should make the chance, when weighted against the other perks available at the start, roughly 10000 in 10160, around 98.5%.
I then ran ten test games, observing the order in which an AI picked its perks. In all but one case (a gestalt), it was picked between second and seventh, most often fourth, despite the apparent 98.5% chance to be picked at each step. At this chance, being picked fourth should be a 1 in 241000 occurance, and seventh should be 1 in around 86 billion.
I worked the weights manually in a spreadsheet for the first two test games, and then went on to assume a rough 1.5% chance for other perks to be picked after that as each instance was roughly the same. A screenshot of the spreadsheet is attached.
Results:
1. 3rd perk
2. 4th perk
3. 4th perk
4. 4th perk
5. 1st perk (this game was a gestalt, and I believe it happened because several other early perks are unavailable to them)
6. 6th perk
7. 4th perk
8. 2nd perk
9. 7th perk
10. 6th perk
These results, assuming that the weights were being calculated correctly and a 4th perk pick being 1 in 241000, were unlikely to say the least, so something's definitely up. The attached perk file has the modifications.
Steps to reproduce the issue.
Use the changes to galactic wonders listed above or in the attached 00_ascension_perks.txt file to alter the perk and observe the AI failing to pick it despite the apparent overwhelming chance.
Upload Attachment
File(s) attached
Attachments
Last edited:
- 3