I gave NPCs a graph database. Now the whole village knows I stole an apple.
说明与用途
Hearsay 使用 FalkorDB 为 NPC 提供基于图的记忆模型,记录事件、谣言、信任和来源,实现在游戏中更真实的社交互动与可解释的信念。
问题
Game characters forget everything and cannot trace how reputation or gossip spreads, making in‑game social interactions unrealistic.
结果
Hearsay demonstrates that a graph‑based memory model can give NPCs realistic gossip dynamics, including trust‑based propagation, confidence decay, exaggeration, and provenance tracking, enabling in‑game explanations of beliefs.
工作流
- 1. Create a read‑only template village graph.
- 2. For each player, copy the template to a per‑player graph (hearsay_
<playerId>). - 3. Every in‑game hour, match villagers in the same place who trust each other to identify gossip opportunities.
- 4. When a teller tells a listener a story, create a new Rumour node for the listener with confidence, severity, and provenance via HEARD_FROM and ORIGIN relationships.
- 5. Update confidence based on trust and hops, adjust severity if the teller exaggerates, and merge rumours if already known.
- 6. Provide a query that, given a villager, returns the shortest provenance chain to the true event.
- 7. Use the provenance chain to answer “Why do you think that?” questions.
- 8. Render the game world and allow players to interact with NPCs whose memories evolve over time.
证据
Game characters forget everything. The shopkeeper greets you warmly five seconds after you robbed them.
Each player gets their own graph (hearsay_<playerId>), created with GRAPH.COPY from a read-only template village.
When A tells B a story, B gets their own version: … CREATE (b)-[:HOLDS …]->(r)...
MATCH (v:Villager {id:$villager})-[:HOLDS]->(r:Rumour)... RETURN [n IN nodes(path) WHERE n:Rumour | n.id] AS rumour_ids, e.base_text AS what_happened
- 记录日期: 2026-10-17T12:56:08.250Z