I promised to post a thread about my procedural quest generator. This is one of two threads describing it. I haven’t done anything beyond implementing its functionality because I haven’t been able to “find the fun” yet.
It has two parts: a judgment system and a quest generator. The other thread covers the generator.
This thread covers the judgment system, which tracks how NPCs feel about other characters by judging their actions. This determined which NPCs offer quests and the types of quests they offer.
Every NPC has a Faction.
A Faction consists of:
- Motivations: Such as Security, Justice, and Pleasure, with an importance value assigned to each.
- Deeds: A record of actions a character has done to another character, ranked by magnitude (murder > teasing) and relevance to motivations.
- Affinities: How the character feels toward other factions.
- A set of parent Factions.
So Aragorn has his own faction (motivations, memory of deeds) and also belongs to the Fellowship and Gondor factions. If Aragorn doesn’t have a specific affinity toward Dwarves, he uses his parent factions’ affinity values.
A single action, such as the player reporting his corrupt partner to the police chief, can result in different deed memories and affinity values. The partner loses affinity for the player; the chief gains affinity.
The current implementation only judges actions the player has taken, but it could be expanded to judge other NPCs.
When NPCs meet, if they have positive affinity for each other, they exchange their deed memories (i.e., exchange gossip).
(I won’t claim any of this as my own invention. Full credit goes to all four volumes of AI Game Programming Wisdom and some papers on BDI modeling.)