Show HN: Neural Emotion Matrix for NPCs (github.com)

🤖 AI Summary
Neural Emotion Matrix is a Show HN project that gives NPCs persistent, evolving emotions and personalities using a neural valence–arousal model. Built around Russell’s Circumplex Model, the system maps every interaction to a 2D emotional coordinate (valence and arousal, each −1.0 to 1.0), stores it in an NPC memory, and re-evaluates future responses with memory-weighted context so characters develop distinct likes, dislikes and long-term relationships. It exposes a C API and prebuilt ONNX runtime binaries for easy integration with game engines (Unity, Unreal) and modding tools, and the repo includes build scripts (Docker required), example DLLs, and a contributor workflow. Technically, the pipeline is: input text → Neural Affect ML model → memory retrieval → contextual reevaluation → updated emotional response. Key API functions include initialize_neural_matrix(), create/remove_npc_session(), evaluate_interaction() (512-char English input, optional source_id for relationship tracking), getters for overall or per-source emotion, memory export/clear, and mandatory free_api_result() to avoid leaks. Configs are JSON-driven (identity, personality default valence/arousal, memory.decay_rate), memories decay over time, and the model is an ONNX predictor trained on a 1K+ NPC valence–arousal dataset (100K+ expansion planned). For AI/ML practitioners and game developers this is a pragmatic, embeddable approach to richer NPC behavior, while raising integration considerations around model accuracy, language support (English-optimized), runtime cost, and save/load consistency.
Loading comments...
loading comments...