Neural emotion matrix for NPCs
Hey! I built this system to humanize NPCs by giving them emotions using Rust and ML. The system provides emotion coordinates (based on Russell's circumplex model) from text input or actions, with persistent emotional memory per entity. Think NPCs that remember how they feel about specific players or events. I pre-trained a DistilBERT model on ~1k video game dialogues (Skyrim, Cyberpunk, etc.) and plan to extract and evaluate 100k+ dialogues soon. However studio/team can manually add dialogues to enrich their own dataset. The matrix doesn't generate dialogue, it only analyzes content.…
In plain words
Neural Emotion Matrix for NPCs is a Rust-based system that analyzes text and actions to assign emotional states to video game characters. Built using DistilBERT machine learning, it maps emotions onto Russell's circumplex model, tracking valence and arousal levels while maintaining persistent emotional memory per NPC. The system is designed for game developers and studios seeking to create characters with consistent emotional responses to player interactions and events. It analyzes content rather than generating dialogue, and teams can add their own training data to customize emotional recognition.
written from the facts on this page · September 2026
From the sources
In the maker’s words, at launch
Hey! I built this system to humanize NPCs by giving them emotions using Rust and ML. The system provides emotion coordinates (based on Russell's circumplex model) from text input or actions, with persistent emotional memory per entity. Think NPCs that remember how they feel about specific players or events. I pre-trained a DistilBERT model on ~1k video game dialogues (Skyrim, Cyberpunk, etc.) and plan to extract and evaluate 100k+ dialogues soon. However studio/team can manually add dialogues to enrich their own dataset. The matrix doesn't generate dialogue, it only analyzes content. When you pass text or an action, it returns emotion coordinates on the valence (pleasant/unpleasant) and arousal(energetic/calm) scale. For example: - [0.00, 0.00] = neutral - [0.29, 0.80] = excited - [-0.50, -0.30] = sad/tired I made a quick visualizer here to help understand https://valence-arousal-visualizer.vercel.app/ The system helps select which dialogue/action to play based on emotional state: - Player says something bad to NPC → system detects negative valence → game picks from "angry dialogue pool" - NPC remembers past positive interactions → system returns positive valence → friendlier responses available So, the devs still write the dialogues or choose the next actions, but the matrix helps manage NPC emotional states and memory dynamically. Here's the project structure to better understand how it works: - src/config: Helper utilities for NPC configuration setup - src/module: The core engine with emotion prediction, memory storage, and entity management - src/api: FFI layer with pub extern "C" to bridge our modules with C/C++ game engines and modding tools (Unity, Unreal, etc.) To implement it, just call `build.sh`, it will create DLL files that you can use to call the matrix functions directly in C++/C/C#. I'd love feedback on code quality and overall architecture. Feel free to be honest about the good, the bad, and the ugly. PRs welcome if you want to contribute!
More ai this month
the category →
I trained a 125M-parameter transformer to autocomplete piano performances in real time (~108 notes/sec on an iPhone 15). The idea is basically GitHub Copilot or Tabnine, except instead of prompting it with code, you prompt it by playing a few notes on a MIDI piano. The model then continues what you played, entirely on-device. The app is free if anyone wants to try it. Happy to answer questions about the model, training, Core ML, or the many things that didn't work.
AI · 17d ago · simedw.com
Astute▲585Automate your B2B brand going viral, with new media creators
AI · 18d ago · company-app.joinastute.com


Hey HN, Henry from Cactus here! We previously released Cactus Needle, a 14MB agentic LLM for tool call, device use, and structured extraction for phones, wearables, smart homes, small robots and microcontrollers. We got really great feedback here, and have now incorporated the suggestions to release Needle 2. The whole model is a single 14MB binary that runs a full session in 28MB of RAM; 45m parameters at 2bit compression. Needle hits 500 tokens/sec decode speed on a Raspberry Pi 5, sits between 400-1,500 tokens/sec on VR devices like Meta Quest 3S and Apple Vision Pro, and ranges…
AI · 27d ago · cactuscompute.com


Launched alongside, September 2025
the whole month →
- AS
Commerce · Sep 2025 · anycrap.shop
- TE
I made a built-from scratch Wayland Compositor to display any GUI app* in the terminal! I think there is a lot of unexplored potential in custom Wayland compositors, a lot of really cool things you can embed existing applications into! So, I started with embedding apps into the terminal because that is the easiest input/output (output is just utf-8 and I use the great `chafa` library for that, and I just read from stdin for the input). If you have any other ideas for cool Wayland compositors, let me know. I purposedly wrote 80% the app in Typescript to appeal to the most developers and…
Dev tools · Sep 2025 · github.com
- IR
Years ago I stumbled across a basic version of this concept and it stuck with me. I knew if I was ever going to take on such a project, it would need to be flawless, but without coding experience it was just another idea that would never happen. By the end of 2024, as AI coding tools exploded everywhere, I finally had a way to make it real. I started from zero knowledge and spent months collaborating with AI agents as a learning experience. Every pixel and every function went through me. The AI translated what I asked for into code, but every decision was human. I didn't use existing OS…
AI · Sep 2025 · mitchivin.com

