I've found what I believe to be the best way at present to remove district cost scaling from extractors, and I'd like to show you how. The big issue with doing this through any means is that the only relevant variable we have access to when defining district cost scaling is ExtensionDistrictsCount, with no further specificity of what kind of districts we're accessing. So, we'll have to make do with this information.
Step 1: Removing extractors from the district count
Remove the one property Settlement.ExtensionDistrictsCount.Add(1).
In the ConstructibleCommonExtensionDescriptor collection, create a new Descriptor called something like Tag_Extension_CostScaling. Add the same property which we removed from Tag_Extension_Urban, Settlement.ExtensionDistrictsCount.Add(1 ).
Import these definitions from Settlement > ConstructibleCommonExtensionDefinition: Extension_Prototype_BaseEconomy, Extension_Prototype_BaseMilitary, Extension_PrototypeBaseEmblematic.
In these three definitions, add the tag we created. Go to Own Descriptor References, click the plus, and add Tag_Extension_CostScaling.
This immediately produces favorable results, however, there are still some things that need taken care of. Notably, extractors will still count for Builder Era Stars. despite the fact that they are no longer counted as districts in the settlement. You probably don't want that, so here's how to fix it.
Change the Evaluator type from DeedEvaluator_SImpleAccumulator to DeedEvaluator_PropertyEvaluator.
Change the Path to MajorEmpire.Settlements.
Under Property, set Entity to Settlements, set Property to ExtensionDistrictsCount, and set Evaluation Method to Accumulte.
Under Score, change Scoring Method to Set.
That will make sure that completing an extractor, or any other district you don't want to increase scaling, will not increment the Builder Era Stars district requirement. If you build and play though, there are still some problems. Notably, on founding your first city, you will notice that you already have 1 out of 6 Districts required for the first Builder star. That's because the Main Plaza inherits from Extension_Prototype_BaseEconomy, and increases our district count, and this type of Deed Evaluator simply counts the ExtensionDistrictsCount property in all of our settlements. So there are a couple things left to tweak, if you so desire.
Step 3: Preferences
It's up to you which district types besides extractors do or do not count towards district cost scaling, but here are my recommendations. We don't want Main Plazas or Administrative Centers to count as districts, as this will mess up our builder stars
To remove Main Plazas and Administrative Centers from the district count : Import Settlement > ConstructibleCommonExtensionDefinition > {Extension_Base_CityCenter, Extension_Base_AdministrativeCenter}. Change their Prototype from Extension_Prototype_BaseEconomy to Extension_Prototype_Base.
Add the tag Tag_Extension_Urban to Extension_Base_CityCenter and Extension_Base_AdministrativeCenter.
This also has the nice effect of making it so that attaching a territory does not increase your district cost, so you don't have to wait for your district to complete to attach a territory. You want to make sure to add the Tag_Extension_Urban tag or else your main districts will not work for adjacencies.
There are some districts that do not inherit from the prototypes we changed that you may want to count for district cost scaling, including Commons Quarters, Harbors, and Train Stations. Additionally, there are some districts which you may not want to count for cost scaling, such as Nature Reserves. Their respective data paths are Settlement > ConstructibleCommonExtensionDefinition > {Extension_Base_PublicOrder, Extension_Base_Harbour, Extension_Base_TrainStation, Extension_Base_NaturalReserve}.
If you want a district to count for scaling: Make sure that it uses Extension_Prototype_BaseEconomy, Extension_Prototype_BaseMilitary, or Extension_Prototype_BaseEmblematic as its Prototype, or manually add the tag Tag_Extension_CostScaling to its definition
If you do not want a district to count for scaling: Set its Prototype to Extension_Prototype_Base, and make sure to add Tag_Extension_Urban if you want it to benefit from generic district adjacency bonuses.
Lastly, if you run the game, you will see that on every district which does count for district scaling, the game has added the tooltip effect "+1 District". If you'd like to keep this effect to be explicit about exactly which districts do and do not increase scaling, then go ahead. If you'd like to remove this and make the district tooltips display as normal, do the following:
To remove "+1 District" on tooltips: Create a new collection of type EffectMapper > DescriptorMapperCollection named DescriptorMapperExtensionCollection, if you do not have it already. In this collection, add a new DescriptorMapper called Tag_Extension_CostScaling. Select it and check the "Hide Descriptor" box.
IMPORTANT NOTES
UNLESS ALTERED, THIS WILL MESS UP YOUR DISTRICT COST SCALING.The default district production cost formulas in Settlement > RpnIndustryDefinition > ProductionCost_Extension_Base_X, where X is Medium, High, Emblematic_EraN, etc. expect that the Main Plaza counts as a district, and so include the term (Target.ExtensionDistrictsCount - 1) where checking for how many districts are in your city.
Change all instances of the term (Target.ExtensionDistrictsCount - 1) in all of the ProductionCost_Extension_Base_X definitions to just Target.ExtensionDistrictsCount, or districts will be much cheaper than normal. Which is probably a good thing, but since you all probably changed the district cost scaling formula for your mods anyways, make sure you adjust your terms accordingly or you will encounter unexpected behavior, including 0 or negative district production costs in some cases.
THIS WILL AFFECT THE BEHAVIOR OF SOME BONUSES. Some Districts/Constructibles/Wonders/Legacy Traits/etc. have an effect that scales with the number of districts - the only ones I can think of right now are the Ming Grand Teahouse, the Mausoleum at Halicarnassus, and Saint Basil's Cathedral, all of which give an effect of "+X per District". These have a Path to Settlement and simply read the ExtensionDistrictsCount property, which, if you're following along no longer counts Extractors, City Centers, or Administrative Centers.
You may choose to keep this behavior and increase the effects of these bonuses to reward investment into scaling districts, or you may want to change their effects entirely. Or, if you want to keep the effects and include Extractors or any other districts which you removed from scaling costs, do the following:
To count non-cost scaling districts as districts for bonuses: Import any descriptors you want to change that give "+X per District". Change the Path from ... > Settlement to ... > Settlement > Districts. Change the Property from N * ExtensionDistrictsCount to N.
This will iterate through al Districts in the Settlement and add N resources each time, preserving the effect. And, handily enough, the tooltip works too! I don't know all the effects in the game that work like this, and I can't account for whatever you've changed in your own mod, so make sure you review your assets carefully.
Conclusion:
So that's the best way I've found to control which districts count for scaling until Amplitude expands the modding tools and exposes more possibilities. It's a bit of a hack, but it works perfectly. The only side effect is that your cities will only display how many districts they have that account for scaling, so they will appear to have fewer districts than they actually have. But other than that, I haven't found any bugs or issues with this implementation.
Please use this as you see fit in your mods; no credit needed unless you're feeling especially generous. I would put this feature in a mod myself, but I'm busy making a much more encompassing mod which uses it, so be my guest if you want to do that.
I think I covered all the steps here, but if anything is unaccounted for, or If you do find any bugs inherent to this implementation, please comment below.
Heads up: it turns out I missed something, which is that districts that increase cost scaling display with the tooltip effect "+1 District". I added a section to Step 3 that tells you how to remove it.
I am reading with Unity open to look at the files at the same time.
Step 1.
Tag_Extension_Urban: I knew there was a place somewhere that says you add a counter to the district count. But I was sure it was not accessible in the mod tool for the moment.
Great job! It's a feat to have found this. I had searched a bit but gave up quickly.
Prototype: I look at the other Extensions, and they use prototypes. And that's where the Urban tag is shown for some. Others, like Military use the Prototype_Base which in turn uses the Urban tag. The extractors use the Base_Extractor which also uses the Urban tag.
Ok, I see how the object model links all this.
Step 2.
Ok, maybe the extractors can be left and counted to build star, too bad. But it's amazing that you were able to come up with this. Especially by changing the values here. Nothing obvious. I would have gone crazy testing this.
Step3.
Ok, linking to the modified Urban Tag (which doesn't count districts), this avoids putting this in the era star build.
Tweak mapper: My brain has already exploded!! ahah.
All this need to make a test mod, many interactions.
Notes.
It's honest that the additional effects don't interact with the "fake districts". Especially keeping those districts counted for builder stars.
I saw a post from a developer on this forum. Apparently they are going to change the cost of districts soon in a patch. I think they will do something similar to this. Mmmh, I'll test if I have time (and it's going to take a while!), otherwise I'll wait for the update and look at what their new code looks like.
Yeah I saw that they were adjusting district costs shortly after posting. Better late than never I guess! I'll still leave this post here as I think it's instructional in other regards.
I'm looking forward to what other changes they have in mind for the upcoming patch. Amplitude always surprises me with the creativity of their balancing.
Keep the code as it is but just add a Tag like Tag_DistrictCountAnnulation.
Then add this tag where it need to. It just do a "districtCount -1".
So, for some districts, the game add +1 then remove -1. It look silly, but as I don't know the impacts of removing the original tag, and as it is maybe used somewhere in the game code in a hidden way, it's more safe.
Then look if there is a way to use a Tag as inverted filter for the Builder Star. Then it's possible to say in a more direct way to not count a district.
Keep the code as it is but just add a Tag like Tag_DistrictCountAnnulation.
Then add this tag where it need to. It just do a "districtCount -1".
So, for some districts, the game add +1 then remove -1. It look silly, but as I don't know the impacts of removing the original tag, and as it is maybe used somewhere in the game code in a hidden way, it's more safe.
Then look if there is a way to use a Tag as inverted filter for the Builder Star. Then it's possible to say in a more direct way to not count a district.
I actually tried this during the development of this method. Now I could be wrong here, as I changed many things over the course of figuring this out, and there's a chance that some other confounding factors may be at play, but I believe this will not work. I ran into an issue where I was getting builder stars after building extractors because the game was counting that I had "added" one district before it was being removed. However, if you're inclined, I am very interested to hear if this does work. It would be a slightly more efficient and transparent way of doing things if so.
I actually tried this during the development of this method. Now I could be wrong here, as I changed many things over the course of figuring this out, and there's a chance that some other confounding factors may be at play, but I believe this will not work. I ran into an issue where I was getting builder stars after building extractors because the game was counting that I had "added" one district before it was being removed. However, if you're inclined, I am very interested to hear if this does work. It would be a slightly more efficient and transparent way of doing things if so.
I'm ready to work on this now. I made a big worksheet with costs calculation and a classification of all districts.
As it's maybe tricky, for now I won't touch Era Stars.
In the best case : If a district don't add districtCount and trigger the Star, it's ok.
But if it's the other way, it will be a problem.
So maybe what you say now could help. If adding then removing still trigger the star, it's better for now.
I know it's maybe not fair to count easy to build district for stars, but in another way:
- everyone can build it, so it's fair for all players. the number of room is limited (number of ressources and so on).
- it can push the player to use a strategy about building. Example: it need 4 more building to get the star, but it have to be done quickly, then build easy building. If the player was smart, they keep some easy to build districts in the pocket for this kind of urgent situation.
- my main mod have already a setting for changing difficulty to get the stars.
THere is another difficulty: I would like to not touch the differents districts definition. Because other modders often need to touch that.
So, if I find a way to touch only districts other don't touch, it's better. Aka : the basic ones.
I maybe will have to change the classification of districts I made before.
When modding amplitude games, often, you don't do what you wan't, but what you can.
Guidline:
Ranking of districts for the mod.
Districts with scalable cost, and increasing the cost of other districts:
Farmers, Makers, Market, Research.
Districts with flat or low scalable cost, and increasing the cost of other districts:
Emblematic district.
Districts with flat or low scalable costs, and not increasing the cost of other districts:
Nature Reserve, Resource extractors.
Districts with scalable cost, and not increasing the cost of other districts:
For simplicity of implementation, this classification also corresponds to the importance of costs, for which the game already has a file by level of importance.
Low cost: for districts with low scalability, and not increasing the cost of other districts.
Medium and high cost: for districts with scalability, and not increasing the cost of other districts.
Special Cost, 4 Basic Districts: for districts with scalability, and increasing the cost of other districts, with the special formula for each.
Special Cost, 6 Eras of Emblematic Districts: Each era cost can be defined.
Special Cost, Commons Quarter: this district is currently too expensive for what it produces.
Flat cost: all resource extractors. Differents costs each Era and type (luxury/strategic).
Glad to hear it's helping with your mod! Regardless of the specifics of what tags or methods you use to achieve the effect, I think it's better than the default district scaling right now.
Glad to hear it's helping with your mod! Regardless of the specifics of what tags or methods you use to achieve the effect, I think it's better than the default district scaling right now.
Hello. I also found a way to do what do the new cost, but without suffering Slots impact. I need to make new calculations so. I just got the idea during the night. So simple.
The formula will use :
- RealDistrictsCount, some districts don't up the scale. I still have some doubts about the list of districts increasing the scale. I don't know if I should add Commons to that.
- Build the same basic district cost more, but more balanced than vanilla, and with a method that reduce external Slots impacts a lot.
I'll consider doing more tutorials like this on helpful tricks like this since this one seems to have been useful, or I might just explain some of them in my mod's documents whenever I get around to releasing it.
I don't know how the game work, but it look like at some point, there is a division using this tag value.
So it should happen like that: when conquering a city, there is like a reset of the value, and the game need to get at least ONE as the total of urban_tag.
So, my method for the mod was to modify base_economy, because it's used by a lot of districts. It was a nice way to do, so it was compatible with any new content.
But obviously, it was generating the bug.
It was a bit painfull to identify the source of the problem. I first made another correction (that is don't lost). Then, I had to make a real game, time consuming, and siege and conquest a city.
So now, my mod just work with adding a tag "-1 district cost" on each of other Districts, except extractor and military ones, because they have a Prototype where I can set here.
I can't do the same with the prototype Base_Economy of course, because it's used by city_center. And I suppose if city_center get a districtCount zero during a conquest, it break.
shasho
Space Dust
shasho
Space Dust
24 100g2g ptsReport comment
Why do you report shasho?
Are you sure you want to block shasho ?
BlockCancelAre you sure you want to unblock shasho ?
UnblockCancelshasho
Space Dust
shasho
Space Dust
24 100g2g ptsReport comment
Why do you report shasho?
Are you sure you want to block shasho ?
BlockCancelAre you sure you want to unblock shasho ?
UnblockCancelEnchanteur
Senior
Enchanteur
Senior
24 700g2g ptsReport comment
Why do you report Enchanteur?
Are you sure you want to block Enchanteur ?
BlockCancelAre you sure you want to unblock Enchanteur ?
UnblockCancelshasho
Space Dust
shasho
Space Dust
24 100g2g ptsReport comment
Why do you report shasho?
Are you sure you want to block shasho ?
BlockCancelAre you sure you want to unblock shasho ?
UnblockCancelEnchanteur
Senior
Enchanteur
Senior
24 700g2g ptsReport comment
Why do you report Enchanteur?
Are you sure you want to block Enchanteur ?
BlockCancelAre you sure you want to unblock Enchanteur ?
UnblockCancelshasho
Space Dust
shasho
Space Dust
24 100g2g ptsReport comment
Why do you report shasho?
Are you sure you want to block shasho ?
BlockCancelAre you sure you want to unblock shasho ?
UnblockCancelEnchanteur
Senior
Enchanteur
Senior
24 700g2g ptsReport comment
Why do you report Enchanteur?
Are you sure you want to block Enchanteur ?
BlockCancelAre you sure you want to unblock Enchanteur ?
UnblockCancelEnchanteur
Senior
Enchanteur
Senior
24 700g2g ptsReport comment
Why do you report Enchanteur?
Are you sure you want to block Enchanteur ?
BlockCancelAre you sure you want to unblock Enchanteur ?
UnblockCancelEnchanteur
Senior
Enchanteur
Senior
24 700g2g ptsReport comment
Why do you report Enchanteur?
Are you sure you want to block Enchanteur ?
BlockCancelAre you sure you want to unblock Enchanteur ?
UnblockCancelshasho
Space Dust
shasho
Space Dust
24 100g2g ptsReport comment
Why do you report shasho?
Are you sure you want to block shasho ?
BlockCancelAre you sure you want to unblock shasho ?
UnblockCancelEnchanteur
Senior
Enchanteur
Senior
24 700g2g ptsReport comment
Why do you report Enchanteur?
Are you sure you want to block Enchanteur ?
BlockCancelAre you sure you want to unblock Enchanteur ?
UnblockCancelNingauble
Inspired Sentient
Boats aren't real.
Ningauble
Inspired Sentient
37 300g2g ptsReport comment
Why do you report Ningauble?
Are you sure you want to block Ningauble ?
BlockCancelAre you sure you want to unblock Ningauble ?
UnblockCancelEnchanteur
Senior
Enchanteur
Senior
24 700g2g ptsReport comment
Why do you report Enchanteur?
Are you sure you want to block Enchanteur ?
BlockCancelAre you sure you want to unblock Enchanteur ?
UnblockCancelVIPdocktorkain
Confirmed Blue
VIPdocktorkain
Confirmed Blue
15 800g2g ptsReport comment
Why do you report docktorkain?
Are you sure you want to block docktorkain ?
BlockCancelAre you sure you want to unblock docktorkain ?
UnblockCancelshasho
Space Dust
shasho
Space Dust
24 100g2g ptsReport comment
Why do you report shasho?
Are you sure you want to block shasho ?
BlockCancelAre you sure you want to unblock shasho ?
UnblockCancelEnchanteur
Senior
Enchanteur
Senior
24 700g2g ptsReport comment
Why do you report Enchanteur?
Are you sure you want to block Enchanteur ?
BlockCancelAre you sure you want to unblock Enchanteur ?
UnblockCancel