V0.9.1p4 - Spirituality amount calculated incorrectly

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 :slight_smile:

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.

2 Likes

Would need to see that town save please.

Saves are located in:

C:\Users\USERNAME\Documents\my games\Farthest Frontier\Save

Zip up the entire TownName_###### folder along with the .map file and .sav that reproduces the issue. If the files are too big, you can use a service such as Google Drive to share it with us.

Thanks!

Sure thing! Here’s the save

难怪我的城市精神一直是60%,而且到后期移民人口永远是1~2人,不知道是不是跟这个有关 :rofl:

Need the .map file as well please.

Apologies. Here it is :slight_smile:

So what appears to be happening here is two-fold:

First, your temple only has 1 relics assigned. Each additional relic is a significant boost to Spirituality. With 3 relics assigned, your spirituality jumps up to 90%. That isn’t clearly explained though so we’ll have to add a note somewhere to those benefits.

Second, altars are simply not providing enough spirituality to support a town this large/old. Given that you have 100% saturation of altars on your homes, it’s not possible to get any more spirituality without the values being increased.

First, your temple only has 1 relics assigned. Each additional relic is a significant boost to Spirituality. With 3 relics assigned, your spirituality jumps up to 90%. That isn’t clearly explained though so we’ll have to add a note somewhere to those benefits.

Here’s a screenshot of my spirituality percentage of my temple with only one relic:

It’s 100% with one relic. 3 relics for a 90% might not be implemented yet? The maximum is 3 relics, yet we are going to get capped at 90%, Like this it will be impossible to reach a global score of 100.

Second, altars are simply not providing enough spirituality to support a town this large/old. Given that you have 100% saturation of altars on your homes, it’s not possible to get any more spirituality without the values being increased.

The current town’s score is calculated using the average of all the shrines + the temple. The problem is that when the ranges of shrines overlap the percentage of coverage decreases. Then when performing the total amount, we are using innaccurate data and the result is incorrect. So as long as range’s overlap with each other, there is no way to increase the values, we are being penalized for making sure there are enough shrines and they overlap, which is what is causing this bug.

If you have seen my map, you have seen that every house has coverage. And the temple is at 100%. If you were to calculate by checking if a house is within the range of a shrine instead, you would get the actual real amount. But right now you are averaging incorrect values.

Calculating the average of houses that are within the range of a shrine will give you the correct value, not averaging out shrines + temple because these values do not represent the actual truth.

I can see two ways to get this fixed:

  • Allow overlapping. Allow a house belong to every shrine that is within reach. This wil give you the real percentage for every single shrine and then your current implmentation of averaging out shrine percentages will be correct.
  • Calculate the average based on homes within reach of a shrine. That will give you the correct answer as well.

The % you are looking at is the multiplier for the building. If it has less than the number of required residences, it provides reduced Spirituality. That % and the % spirituality for your town are different things.

As I said, if you add 2 more relics to your temple, your % Spirituality happiness will shoot up to 90%. Because 90% is the max for your town, the value each Altar gives is simply too low since it’s not mathematically possible to reach 100% currently for this town.

The % you are looking at is the multiplier for the building. If it has less than the number of required residences, it provides reduced Spirituality. That % and the % spirituality for your town are different things.

The reason they have less than the number required is because many houses fall under the umbrella of other shrines as well. Houses get allocated to one shrine only, and once this happens a house will no longer be counted even if is located right next to it, this is where the percentages start to sink, and the root of the problem.

I know that shrine % is not the same as town %. I acutally talked about it in my post. And found the way it is being calculated for both scenarios. This is what allowed me to show the flaw in your current implementation.

As I said, if you add 2 more relics to your temple, your % Spirituality happiness will shoot up to 90%. Because 90% is the max for your town, the value each Altar gives is simply too low since it’s not mathematically possible to reach 100% currently for this town.

The temple I’ve shown you a screenshot where you can see it has 100% spirituality with only one relic.
And why would 90% be the cap for this town?
I have explained why the shrines values are low, and proven facts, numbers and screenshots. The current implementation is not correct and I have provided two options on how you can fix this, but you are free to leave it as is.

And for this town it is definitely possible to reach 100% if you used another method for counting, like the two options I’ve shown you.

Let me ask you something, I have 127 homes, all 127 homes are within range of a Shrine. Mathematically speaking this turns out to be 100%. On the other hand shrines get a lower count for each house assigned to another shrine, reducing the percentage, which in turn this number is used to calculate the total that gives an incorrect value. One method works, the other does not.

Again…the 100% spirituality for the temple is the multiplier from how many residences are nearby. The temple provides X spirituality, where X is a base value plus a bonus Per relic inside it. You are getting 100% of X because there are enough homes within its range. But, because you only have 1 relic inside of it instead of the maximum 3 allowed, X is much lower than it could be.

If you add 2 more relics to your temple, your Spirituality happiness will shoot up another 30%. Which means an optimized temple + all the altars in your town adds up to 90% Spirituality happiness. Because there are no shelters left in your town to cover with altars, 90% is effectively the maximum you can achieve. Thus Altars need a buff to their spirituality value.

“Again”? If you get tired of answering by all means, pass this topic to a colleague.

The shrines require a minimum of 18 houses to reach 100%. I have more than 18 houses within reach of each shrine. The problem is that all the houses within reach of altars are divided by the number of altars and since these houses fall under the reach of more than one altar the amount is reduced.

The bug occurs when one house is within reach of more than one shrine

If you are actually reading and understanding what I am writing and you have looked at my save then you should understand what I am trying to explain here and why the way you calculate this is incorrect.

About the temple, I understand what you are saying, but it’s irrelevant here. My temple gives 100% which when averaging out the percentages of each shrine gives you the same exact number you have for total spirituality score. These numbers are maths facts and proof of what I am saying to be true. And just to indulge you, have placed all the relics, the percentage keeps being 100% and it does not affect the overall score at all. The amount is solely affected by the reach of residences (100), nothing to do with relics. If that was your intention as designers you got yourselves another bug.

You don’t need to re-explain to me how it works, I understand it. What you don’t seem to understand is why the bug is happening = houses under the reach of more than one shrine are not counted towards houses within reach of a shrine. I can have 18 (100%), but if I place a shrine nearby this shrine will “steal” 9 houses which will decrease the percentage to 50% each, while all houses are in fact covered by a shrine, which is 100%.

The bug is there, is clear, I explained it as much as I can, get a colleague to read this if you can’t understand it. No need to reply again explaining how the mechanics currently work because I do understand it, and I am pointing out where the flaw is.

Here’s a screenshot with 20 houses with 1 shrine:

100 spirituality. Fine.

This is what happens when I add an extra shrine:


The houses are divided by the amount of shrines. Lowering the spirituality percentage to an average of 50%, which is how the overall score is calculated.

By all means set this bug to “Won’t fix”, it’s ultimately you call, but you will still be having a bug in your game.

Done explaining this issue to you.

All the best.

There is only so much a developer can do to explain a mechanic and still be told by a confident player there is a bug.

Best of luck in life.

I think maybe the confusion here is that town-level spirituality score, found under village happiness, is a different value than the “current spirituality value” shown on individual buildings, which provide spirituality.

This UI could probably use some refinement at some point to make that more clear.

Basically though, your villagers have certain needs for spirituality that increase over time based on population size and the advancement of your town. The happiness score is a measure of how well you are meeting these needs, based on the spirituality generated by all your buildings / relics.

Current spirituality value is only a measure of how much spirituality an individual building is generating relative to its potential.

If you have a shrine surrounded by 18 houses, it is providing 100% of the spirituality that it can. Currently a maxed out tier-1 shrine provides 32 spirituality. Say your town though wants 64 spirituality, based on its size, years of existence, etc, then your town’s spirituality rating under happiness will be 50%.

Just for the sake of being thorough, I added a bunch of shrines to my town, so that I had many overlapping shrines and it had no effect on my town’s spirituality score, even though the individual score of the shrines all went down as houses got divided between them.

I will say though, this is a semi-recently added feature that we are still tuning, so, while it seems to be working correctly, it’s possible that it may just be too difficult to attain 100% spiritual happiness in a maxed out town, so we will keep tuning it based on feedback and playtesting.

1 Like