
NPCs That React to World Events: Towns That Notice
The player topples a tyrant, rides into the next town, and the first person they meet says "Lovely weather today." Neocortex lets you tell your NPCs what just happened in your world, so the town gossips about the duel, the crew curses the raid, and the next person the player talks to has already heard the news.
What it looks like
Dry Fork is a silver-rush boomtown in an original Western. In the space of ten minutes, two things happen. The railway bridge over the gulch collapses, cutting the town off from the south. Then the player wins a duel on Main Street against Silas Vane, the mining company's hired gun.
The game turns both into events. In the Lucky Dollar saloon, three characters are already in a group chat: Hattie Brooks, who owns the place; Doc Ambrose, who has patched up most of the town; and Ezra Pell, the nervous young telegraph clerk. When the player pushes through the doors, the game adds an event that the stranger who shot Vane just walked in, and requests an ambient turn:
Ezra: That's them. That's the one who did it. Hattie: Sit down, Ezra. Whoever put Silas Vane in the dirt drinks free tonight. Doc Ambrose: Free until the company sends someone faster. And with the bridge gone, they'll have to ride the long way round to do it.
Hattie's line carries a POUR_DRINK action aimed at the player, and the game slides a glass down the bar.
Out at the livery stable, Juniper the stable hand is a single character, not part of any group. She hasn't said a word yet. When the player walks up and asks to buy a horse, the game sends both events with the player's message, and she leads with the bridge: no horse in her stable can get them south now, but she knows a trail through the canyon for the right price.
How Neocortex makes it work
- Events. Add an
eventslist to any chat request, each entry with a priority and a plain sentence: "the railway bridge collapsed", "the player won the duel". The characters fold it into what they say next. - Single characters on every plan. Send events with the player's next message, and the character reacts in its reply. This works on every plan, including Free.
- Ambient turns. In group chat (Pro and Team plans), request a turn with no player message and the cast discusses the news among themselves.
- A dynamic cast. Group chat holds up to six characters, and the cast is the list of IDs you send. Add one and the others greet them; remove one and the rest notice they left. That arrival is often the best moment to request an ambient turn.
- Actions. Reactions can be physical too. Characters return actions like
POUR_DRINK,LOCK_DOORorRUN_AWAYwith a target, and your game plays them. - Emotions and voices. Each line comes with an emotion tag and streamed speech, so Ezra sounds scared and Hattie sounds delighted.
- Session memory. Events arrive as part of a session. Keep the
sessionId, and the talk about the duel is still there the next time the player stops by.
Ideas to build
A town that gossips after a boss fight. After the player kills the marsh witch, your game decides who heard what. The priest gets the event as it happened. The drunk by the well gets "someone says the stranger turned into a crow and flew off." The player walks through town and hears the story change from mouth to mouth.
A stadium crowd that follows the match. In a football game, put three fans in each section of the stands into a group chat. Feed events like "home side scored in the 89th minute" or "the referee sent off the captain" and request ambient turns between plays, so the crowd near the player's camera argues about the decision.
A base crew after a raid. In a colony survival game, raiders burned the greenhouse overnight. In the morning the crew trades blame over breakfast in an ambient turn, the engineer returns REPAIR aimed at the greenhouse, and the cook asks the player what they plan to do about the food.
A city that reads the papers. In a detective game, each morning your game sends one or two headlines as events. Shopkeepers, cab drivers and witnesses all mention them when the player stops to talk, which makes the city feel like it is following the case too.
Building it
Events work anywhere Neocortex does: the Unity SDK, the Unreal Engine plugin, the Godot addon (beta), and the Web API from any engine or web game.
- Pick the moments that matter. List the world changes worth a reaction: deaths, victories, disasters, big player choices.
- Write each event as one short sentence from the world's point of view, the way a witness would put it.
- Decide who hears what. Your game picks which characters get which events, which is how rumours, secrets and missing news happen.
- Send events with the player's next message for single characters, on any plan.
- Request an ambient turn for groups when something big happens or someone walks in (Pro and Team).
- Retire old events once they have been talked about, so the town moves on.
Sending world events with a player's message:
const res = await fetch("https://api.neocortex.link/v3/chat", {
method: "POST",
headers: {
"x-api-key": apiKey, // load from your own config, never hard-code it
"Content-Type": "application/json",
},
body: JSON.stringify({
characterIds: [juniper],
message: playerLine,
sessionId, // empty on the first message, then the one you got back
events: [
{ priority: 1, content: "The railway bridge over the gulch collapsed" },
{ priority: 1, content: "The player won a duel against Silas Vane on Main Street" },
],
}),
});
const { sessionId: next, messages } = await res.json();
playReply(messages); // your helper: voice, emotion, actionsSummarise, don't stream. "The player won the duel" gives a character something to talk about; forty events about individual gunshots give it noise.
World events are one part of our AI NPC, ambient AI and voice command use cases. For the conversations that fill the time between big moments, read ambient NPC conversations, and for live reactions to a race or match, see AI sports and race commentators. The event logging and dynamic characters pages, plus the group chat docs, cover the details. Start with one event and one character who cares about it.
Checked October 2026.
Frequently Asked Questions
How do you make NPCs react to what happens in the game world?
Send it to them. With Neocortex you add events to a chat request as a list of entries, each with a priority and a plain sentence like "the bridge collapsed", and the characters take it into account in their next replies.
Can NPCs react to events without the player talking to them?
In group chat, yes. On the Neocortex Pro and Team plans you request an ambient turn with no player message, and the characters discuss the news among themselves. A single character reacts when the player next speaks to it, on every plan.
Do NPCs notice when someone joins or leaves a conversation?
Yes. In Neocortex group chat the cast is the list of character IDs you send. Add a character and the others greet them, remove one and the rest acknowledge they left.
Should I send every game event to my NPCs?
No. Send short summaries of the moments that matter, like "the player won the duel", rather than every frame of the fight. Fewer, clearer events give Neocortex characters something specific to talk about.
Written by
Neocortex
Date
Oct 24, 2026
Updated
Oct 24, 2026
Read time
6 min






