So, after some pondering, tweaking and bug-fixing (thanks alberts2!), here's a brand new, better and hopefully more fun version of SpecializedCities!
(sorry about the lack of

,

etc. icons, there's a limit per message

)
How does it work?
There are now 26 specializations grouped into 4 "tiers" (see below for the full list). Each specialization (called "Focus" because it's shorter

) brings a few bonuses/penalties but more importantly unlocks a wide range of buildings that formerly had no prerequisite. Think of "focus" as specialized districts in/around the city - a mining district, a craftsmen district, a farming district, etc.
Some buildings require several different focuses to be present in the city. This is true for many wonders (especially religious wonders, which usually require 3 different focuses), so that the civ leading in tech won't be as easily able to build them all.
Unlike in the previous version,
any city is able to build any number of specializations. So, what's the catch?
* The first catch is the
opportunity loss.
You simply have to invest some hammers to "build" a focus, which could have been otherwise invested into something else.
* The second catch is the
increased cost of expansion.
Think of it as, if you build new districts, you'll start filling easy spots, then each additional one will be more difficult and require more work.
In game terms, you suffer a significant hammers penalty to every focus in a tier for each focus you've already built in the city.
Note that Tier 1 focuses are very cheap so even with the penalty you'll be able to easily build 3 of them, and the 4th shouldn't be too difficult to reach. Focuses in higher tiers are more costly, so with the penalty it'll be very costly to try to build them all.
Remember that building focuses has no effect on the cost of focuses from other tiers (though this may change in the future).
* The third catch is that a
jack of all trades is master of none.
Each focus gives a slightly worse bonus than the associated penalty, so if you build too many focuses, the net result will be a net penalty everywhere.
Let's consider first tier focuses. One gives +10% food, -10% hammers and -10% commerce. Another gives -10% food, -10% hammers and +10% commerce. This means that if you build both, the bonuses will cancel each other and you'll end up with a net -20% hammers penalty.
* Finally, the fourth catch is the
spread of skill in your empire.
Each focus you build in a given city will grant a hammers penalty to every other city trying to build the same focus. Think of it as spreading your most skilled citizens everywhere instead of keeping them together in a few places.
The penalty is relatively minor, but as you have more and more cities building the same focuses, it'll start to matter. Incidentally, it'll be a limit to over-expansion since at some point new cities just won't be able to build focuses at all. At least until you get new sources of hammers.
(note: it'd probably have been better to increase the cost of buildings instead of reducing hammers output for them, but it does not seem possible with the current tags)
Can I still have generalist, "good-at-everything" cities?
Yes you can. The downside is that if you do that, building focuses in new cities will be very expensive, so you'll end up with some very good cities and some bad cities.
On the other hand, if your spread your focuses among your cities, you won't get (or less) extremely good cities, but many average cities that are good in one or two fields. In theory, both strategies should be viable (and I intend to keep it that way).
One interesting detail: your capital has a +50% to the construction of any focus. It'll thus be very possible to build many focuses there even with the multi-focus hammers penalty, including in the early game where you don't have that many cities to play with. Ultimately it'll probably turn out as a generalist "super-city". I'm considering adding the same bonus to pseudo-capital (Forbidden Palace, Versailles...).
What are the different focuses and their effects?
Tier 1
* Production
Fields
|Basic production, building construction
Direct effect
|-10%food, +10%hammers, -10%commerce, -20%hammers for military units
(cumulative with the +10%hammers for a net -10%hammers)
Unlocks
|Basic +hammers early buildings as well as +hammers% later buildings (pulley, etc.)
* Commerce
Fields
|Commerce, communication, early traditions
Direct effect
|-10%food, -10%hammers, +10%commerce[/I]
Unlocks
|Some basic commerce buildings (roads...) and importantly for the early game the science and tradition buildings (myths, sand paintings, etc.)
* Food
Fields
|Food scavenging, gathering and preparation
Direct effect
|+10%food, -10%hammers, -10%commerce[/I]
Unlocks
|Some basic +food early buildings, granaries
* Military
Fields
|Military units production
Direct effect
|-10%food, -10%hammers, -10%commerce, +20%hammers for military units
(cumulative with the -10%hammers for a net +10%hammers)
Unlocks
|Early military buildings, later used together with other focuses for many buildings (stables...)
Tier 2
Tier 2 focuses require that the city is level 3 as well as a specific tier 1 focus.
* Raw materials
Requires
|Focus tier 1 Production
Fields
|Resource gathering (excluding food and plant products)
Direct effect
|-10%food, +5%hammers, +5%commerce, +2:sick:, +2unhappy[/I]
Unlocks
|Mines and other raw resources gatherers (bamboo, bark, salt...)
* Intermediate products
Requires
|Focus tier 1 Production
Fields
|Production of intermediate products
Direct effect
|-10%food, +5%hammers, +5%commerce, +2:sick:, +2unhappy[/I]
Unlocks
|Buildings crafting "unfinished" goods such as gems, leather, ingots...
* Craftsmanship
Requires
|Focus tier 1 Production
Fields
|Production of finished goods
Direct effect
|-10%food, +5%hammers, +5%commerce, +2:sick:, +2unhappy[/I]
Unlocks
|Manufactured resources such as toys, scrolls, metal wares...
* Agriculture
Requires
|Focus tier 1 Food
Fields
|Growth and harvest of plant
Direct effect
|+10%food, -5%hammers, -5%commerce, +2:sick:, +2unhappy[/I]
Unlocks
|Farms, orchards, plantations, groves... (the buildings, not the improvements!)
* Hunting and Fishing
Requires
|Focus tier 1 Food
Fields
|Hunting, fishing
Direct effect
|+10%food, -5%hammers, -5%commerce, +2:sick:, +2unhappy[/I]
Unlocks
|Animal camps, fish nets, harbor...
* Herding
Requires
|Focus tier 1 Food
Fields
|Breeding animals, herding
Direct effect
|+10%food, -5%hammers, -5%commerce, +2:sick:, +2unhappy[/I]
Unlocks
|Animal farms, animal breeders, megafauna trainers (with Military focus)...
* Education
Requires
|Focus tier 1 Commerce
Fields
|Basic research, education
Direct effect
|-5%gold, +10%science, -5%culture, -5%espionage
Unlocks
|Basic +science and +Education buildings (library, grammaticus, stargazer's hut...)
* Business and Trading
Requires
|Focus tier 1 Commerce
Fields
|Trade, business, shops
Direct effect
|+10%gold, -5%science, -5%culture, -5%espionage
Unlocks
|Non-crafting +gold or +commerce buildings (bridges, bazaar...)
* Arts and Culture
Requires
|Focus tier 1 Commerce
Fields
|Culture, arts
Direct effect
|-5%gold, -5%science, +10%culture, -5%espionage
Unlocks
|Most buildings related to culture or arts (music/dance hut, fresco...)
* Units training
Requires
|Focus tier 1 Military
Fields
|Military and non-military units training
Direct effect
|+1XP to every unit created there, -5% great general emergence, -10% city defense
Unlocks
|Most buildings providing XP bonuses or free promotions to units
* Defensive doctrine
Requires
|Focus tier 1 Military
Fields
|Offensive units
Direct effect
|-5% great general emergence, +20% city defense
Unlocks
|Defensive buildings (traps, walls...)
* Offensive doctrine
Requires
|Focus tier 1 Military
Fields
|Offensive units
Direct effect
|+10% great general emergence, -20% city defense, +10% military units production
Unlocks
|Few buildings unlocking specific units (siege workshop, knight's stable...)
Tier 3
Tier 2 focuses require that the city is level 6. There are no additional focus prerequistes.
* Port
Fields
|Sea
Direct effect
|+20 crime (I'll probably add more things here later)
Unlocks
|Coastal buildings (except the small ones related to fishing)
* Religion
Requires
|Any religion in the city (not necessarily state religion)
Fields
|Religion
Direct effect
|-10%gold, -10%science, +10%culture
Unlocks
|Religious buildings (except basic temples which don't require anything)
* Health
Fields
|Health, medicine, cleaning
Direct effect
|+4

, +20% city maintenance, -10% food
Unlocks
|Many buildings providing +

or -Disease
* Leisure
Fields
|Entertainment, happiness
Direct effect
|+4 :happiness:, +20% city maintenance, -10% hammers
Unlocks
|Festivals, buildings providing +:happiness: (theater...)
* Police
Fields
|Law-enforcement
Direct effect
|+20% city maintenance, -20 Crime, -10% commerce
Unlocks
|Crime-fighting buildings
Tier 4
Tier 4 focuses require that the city is level 13. Some have additional focus prerequistes.
* Manufacturing
Requires
|Focus Tier 2 Intermediate products or Craftsmanship
Fields
|Standardized production, power generation
Direct effect
|+10%gold, -5%science, -10%culture
Unlocks
|Not yet implemented - factories, power plants...
* Finance
Requires
|Focus Tier 2 Business and Trading
Fields
|Advanced finance
Direct effect
|+10%gold, -10%science (I'll probably add more)
Unlocks
|Not yet implemented - banks, insurance office...
* Research
Requires
|Focus Tier 2 Education
Fields
|Science, technology
Direct effect
|-10%gold, +10%science (I'll probably add more)
Unlocks
|Not yet implemented - labs, universities...
* Airport
Fields
|Air
Direct effect
|(TBD)
Unlocks
|Not yet implemented - airports, space buildings...
* Diplomacy
Fields
|Spying
Direct effect
|-5%gold, -5%science, -5%culture, +10%espionage
Unlocks
|Not yet implemented - espionage buildings
Does it already work?
Sure! Just extract the attached file into My_Mods/SpecializedCities.
From my playtest, the AI seems to handle it well and different civs choose different specializations (though Production appears more often and in time their capital city tend to develop every focus). Most rivals civs are ahead of me in my game...
I've sorted out about every building for the first three eras (further buildings just don't require any focus); if you want to try it, I'm very interested to get feedback!
View attachment SpecializedCities v2.7z