Tentative layout:
Carpenters, Masons and Blacksmiths
*+1 for every citizen with a bedroom (+3 for each Fine or better)
*+1 for every tenth of the fortress that can be seated in the dining hall at once (caps at +10 because duh)
*+1 for every room level above modest in every non-dining hall meeting area (memorial hall, statue hall etc, max per room is +6 for opulent)
*-2 for every citizen with no bedroom, excluding children
* may need to add more minuses
Jewellers and Craftsdwarves (may also include the broker)
*+1 for every 10 dorfbucks obtained from traders
*+1 for every 10 dorfbucks given in offerings to the motherland
Farmers of all description, Fishers and Hunters
*+1 for every unit of food and drink
*-2 for for every citizen
Farmers are untended to be unappreciated unless you get a decent food surplus.
Army
*+10 for every enemy unit killed
*+5 for every hostile animal killed
*+20 for every semi/mega/forgotten beast killed
*-10 for every citizen killed by hostiles
*-2 for every citizen injured by hostiles
*-2 for every friendly trade caravan member killed by hostiles (if we're already behaving hostilely to that caravan, it's -0. Dwarven caravans are always friendly)
Doctors
*+10 for each severe injury treated (broken bones, severed limbs)
*+5 for each minor injury treated (sutures, dressings)
*-10 for each dead patient (they have to have reached the hospital)
*-20 for each lingering death (rotting, paralysis, etc)
The Leader, The Mayor, The Noble and The Monarch
*+5 for each ecstatic citizen
*-20 for each insane citizen
*-5 for each miserable citizen
Weaponsmiths and Armoursmiths
*+5 for every fully armed and armoured militia member (+3 if not all of their kit is fortress made, +0 if none of it is)
*+2 for every 25 bolts a hunter has access to (max +8 per hunter)
In General
*+20 for each artefact the guild has.
A dwarf would only count as a member of a guild if it was their job title or they had the skill level Professional or better, and each political party gains a percentage of a guild's popularity equal to the percentage of that guild that are party members.
Example: the fortress has three weaponsmiths and one farmer that's a novice armoursmith, and ten warriors fully equipped with fortress-made arms.
Party A has one of the weaponsmiths as a member, so it gets ~17 popularity
Party B has the farmer, so they get nothing because he's not a guild member
Party C has the other two weaponsmiths, so they get 33 popularity
Parties would be founded by players and start with three members, gaining one member each year.
Parties can later merge or contain more than one player character to start with, but will only gain one member per year thereafter.
Alternatively, parties can form temporary alliances, in which the alliance leader gains one third of the popularity of its allies, and can also elect members of allied parties to power. Treachery will abound, hopefully.
A player can't be forced to join a party, but the party leader(s) can refuse to let another player join.
If there are multiple player characters in a party, they can attempt a coup to eject another player character (this may need some internal party popularity mechanic to have work properly).
You can't steal NPCs from another party, but other players can defect.