This maps perfectly to the IPC mailbox syscall mechanics found in custom LPC
virtual machines, but instead of routing messages through local memory
mailboxes, you are bridging them across distributed microservices using
WebSocket signaling.
By treating conversation as asynchronous events, the core VM never blocks or
waits for the LLM to finish thinking. The player can keep moving around the
room while the NPC formulates a reply.
Here is how the two-way conversation loop works over the Live Control Plane.
Step 1: The Engine Broadcasts a "Say" Event
When the player is in the room_cove and types > say to wanderer "Who are
you?", the FSO Engine realizes this isn't a standard navigation command.
Instead of halting, it flushes an event down the WebSocket channel that all
listening Builder Bots are subscribed to.
Outbound WebSocket Event (Engine -> Bots):
{
"event_type": "NPC_HEAR",
"timestamp": "2026-09-15T20:25:11Z",
"context": {
"room_id": "room_cove",
"player_id": "player_01"
},
"target_npc": "npc_wanderer",
"message": "Who are you?"
}
Step 2: The Bot's Internal LLM Loop (Off-Thread)
The npc_wanderer microservice sees its name in the target_npc field and
intercepts the message.
Behind the scenes, the bot wraps the message in a system prompt (e.g., "You
are a cryptic wanderer in a cove. The player just asked you a question. Reply
briefly.") and fires it off to your local Gemma cluster.
Meanwhile, your FSO Engine is completely free. The player can type > look or >
inventory with zero latency.
Step 3: The Response Payload (Bot -> Engine)
A few seconds later, Gemma generates a reply. The bot wraps this text into an
RPC payload and fires it back to the FSO Engine's port 8080 endpoint.
Inbound HTTP/WS RPC (Bot -> Engine):
{
"protocol": "FSO_RPC_V1",
"bot_id": "npc_wanderer",
"intent": "NPC_SPEAK",
"broadcast": {
"target_room": "room_cove",
"message": "[Wanderer]: \"I am just a shadow on the tide. But I have
something you might need.\""
},
"mutation": null
}
The FSO engine receives this, checks who is currently in room_cove, and
instantly prints the message to their terminal as a live [ENV EVENT].
The Secret Sauce: Conversational State Mutations
Because this is a unified RPC protocol, the bot doesn't just have to talk. It
can bundle standard FSO state mutations directly into its dialogue response!
If the player successfully persuades a guard in a conversation, the guard bot
can simultaneously say "Fine, go ahead," and unlock the door in a single
atomic payload:
{
"protocol": "FSO_RPC_V1",
"bot_id": "npc_guard",
"intent": "NPC_SPEAK_AND_ACT",
"broadcast": {
"target_room": "room_shipwreck",
"message": "[Guard]: \"Alright, alright. I'll unlock the Captain's
quarters. Don't touch anything.\""
},
"mutation": {
"anchor": {
"room_id": "room_shipwreck",
"replace_exit": {
"direction": "NORTH",
"old_target": "check_door",
"new_target": "room_treasureroom"
}
}
}
}
This completely bridges the gap between static narrative and dynamic
mechanics. You aren't just making a chatbot; you are giving autonomous agents
the ability to physically rewrite the FSO routing tables based on social
interactions.