While it's a lot of work, my personal favorite to help fix the issue would be to add a ton of buildings (or increase prices) that it becomes impossible to build them all. Without completely changing how the happiness system works, you still have a few options on how to "specialize" cities. Idea that just came to mind is having every building give a yield, and reduce unhappiness of another. For example, You have markets, caravansaries, customs houses, etc. massively increase gold income (and merchant specialists) but also have a bunch a flat reduction to illiteracy, boredom, and distress. The library, university, public school, etc. massively increases science yields (and science specialists) while giving flat reduction to boredom, poverty, and distress. That way the city makes a bunch of a yield, but still stays relatively happy. Granted, this requires going through every building in the game and readjusting it to work this way, it's probably faster/easier to make adjustments to the happiness system. I don't actually expect us to do this, but it was a neat enough idea that i needed to share