NPC mind simulation + quest generation
As zesterer mentioned in a comment in #576, we should split NPC behaviour into a 'mind' and a 'body', where the body is the entity that you see as it currently exists in the game, and the mind is the part that persists when the NPC goes out of view distance.
So what's on NPCs's minds?
-
Needs
NPCs should have a system of wants and needs based on real psychological models. These should include needs such as food, safety, friendships, wealth, education, culture, etc. NPCs should try to satisfy these needs on their own, but will ask the player for help via the quest system.
-
Relationships
NPCs should remember who their friends and enemies are. This includes both players and other NPCs. We should model these relationships on both a group level and an individual level. Obviously, NPCs shouldn't be friendly to a player or faction who's just attacked them or their fellow villagers. This gives consequences for player action, but also consequences for player inaction: you didn't help the NPCs resolve a dispute peacefully? well now they're fighting each other.
-
History/lore
NPCs should remember basic biographical information like where they live and who their family is. NPCs should remember important life events such as conflicts, births, moves, and festivals. NPCs should remember their interactions with the player and with other NPCs. This will round out the world and give NPCs depth.
-
Data
The NPC's body gets destroyed whenever the player moves out of view distance. We need to be able to restore the NPC's body, position, stats, and related information.
What's the point of modeling NPC needs?
Quests can be generated based on NPC needs: minor quests satisfy NPCs's needs; major quests involve resolving conflict between NPC needs. For example:
- Satisfying subsistance needs: NPCs will ask players to fetch food + water
- Satisfying protection needs: NPCs will ask players to defeat monsters attacking the village, or protect them from bandits along trade routes
- Satisfying affection needs: NPCs will ask players to find them a pet
🐕 - Satisfying understanding needs: NPCs will ask you to fetch an artifact from a dungeon or ask you to do some exploring
- Satisfying participation needs: maybe NPCs can ask to accompany you on quests?
- Satisfying idleness needs: ?
- Satisfying creation needs: NPCs will ask you to find crafting materials
- Satisfying identity needs: ?
- Satisfying freedom needs: NPCs will ask you to help them establish new villages
Generating major quests based on conflict between needs may be difficult to implement, but could work something like:
- Village A wants to clear some plot of land for growing food, Village B needs it for hunting
- Village A wants to cut down a grove of trees to build new houses, Village B sees those trees as an important part of their culture
- NPC A took the last of the Village's stone supply to build a store room, NPC B needed that supply to build a well.
The major quests could be considered "completed" by satisfying A at the expense of B, satisfying B at the expense of A, or finding a way to satisfy both.