Before I start know that before I go into explaining what the bug is and how it came to be I needed to test a few things to make sure my calculations were correct. So this post is quite long, but here is the short version:
BUG: The total spirituality for the town is calculated by averaging out the percentages of all the shrines (and temple) instead of the total actual amount of housing coverage. The problem arises when more than one shrine overlaps a house and this house is assigned to one shrine, bringing the percentage down of the other shrine and therefore lowering the total score.
Now the tests and more detail:
First assumption for The Shrine is based on the following information:
To maximise its influence, place this building within 80m of 18 residences.
I am unsure if this means “a minimum or a maximum of 18 residences within 80m” or not so I am going to test it.
I created a shrine with a bunch of houses in 1 quadrant. This is what we have:
If we count the amount of houses highlighted by the Shrine’s reach we get 22, just as the tooltip says. We can also assume that with 4 quadrants a total of 88 residencies could be reached.
So the number 18 is not the maximum amount. Let’s bring down the amount of houses to 14 to see if the percentage goes down to around 78%.
Now we have 14 houses with a 78% of spirituality.
So confirmed, 18 is the minimum amount of housing needed within 80m to reach 100%.
Now that I clarified that to myself, I’ll go to my actual map and check the numbers.
Here it is, a grid of 27 x 27 containing a total of 41 houses.
If you look at the screenshot, there are a total of 24 houses highlighted which is above 18 and therefore should give me a score of 100% spirituality. But instead I get a score of 56%.
Now the reason for this is that within the same grid there are 3 other Shrines, for a total of 4. The way this is layed out, a house can be reached by more than one Shrine, and what happens is that houses get allocated amongst the Shrines and they can belong to one Shrine only. So the residences in range gets reduced by the amount of residences than have been assigned to the other nearby Shrines. To verify this I check the residences within range of each Shrine (the 4 that I have): 10 + 10 + 11 + 10 = 41. Which is the total amount I had in the grid earlier on. So, with my 4 Shrines I reach 41 out of 41 homes, so 100%, BUT, individually, each Shrine percentages are 56%, 56%, 61% and 56%.
Just like this grid, I have another two with the same layout, bringing the total number of Shrines to 12 and every single home within the range of a Shrine, for a total of 100% coverage. BUT individually, each Shrine percentage ranges between 50% and 61% due to overlapping.
Now, my current spirituality score for my whole town is calculated to be 60% when it should be 100%.
So I am thinking that instead of calculating the percentage based on the actual coverage, they are getting the number by averaging out the percentages of all the Shrines instead. So I calculated the average for my Shrines and my upgraded temple and it turns out to be 61%. It’s not 60% but I am guessing there was some rounding done in the percentages displayed in the individual Shrines so yeah, it’s a match. The actual town’s score is calculated by averaging out all the Shrines and the Temple instead of calculating the actual real coverage. So we got ourselves a bug.
So at the moment, the more shrines you add, once their range starts overlapping homes, the lower your score will be.
And that’s it. We’ve found the problem after some digging. Let’s hope it can be looked into
Thank you for reading through this loooong explanation but I had to go into details to fully understand it myself and make sure I got it right.