Settings

Theme

Show HN: SimFic – A multi-agent narrative simulation for interactive fiction

simfic.net

4 points by InitialPhase55 12 days ago · 4 comments · 4 min read

Reader

Hello HN,

I'd like to share a hobby project I'm working on called SimFic: a multi-agent interactive fiction simulation engine. Many of you like to read. But have you wanted to do more than just follow through someone's story? What if you could step into their shoes, and play it out yourself in a simulated environment?

The problem: simply prompting an AI chatbot (e.g. ChatGPT) directly with a world/story-building prompt and expecting a rich, non-linear output is fundamentally flawed; in the real world, information asymmetry, Theory of Mind, non-determinism, etc. affect how people think and act. Asking a single LLM like ChatGPT to mentally simulate these constraints is flawed because of Transformer attention, as it is omniscient by technical design. Furthermore, LLMs are heavily tuned to be helpful and finish things early. If you've tried writing a book with an LLM, you know that the result is laughably short and shallow. If we use an LLM as-is, every action will succeed, every path will be correct, and the narrative degenerates into a dry "happy path".

That's why I built SimFic:

1. The Architect: work with it to envision and define your world, characters, and story before hopping in. It'll ask follow up questions as appropriate but not too many so as to be constraining. When the Architect has enough, it starts concretizing the world, however, it doesn't build everything statically at all once. Instead, it scopes a detailed document that is handed to downstream agents for procedurally generating context-aware new environments (i.e. new environments are created on the spot to suit the mood, story plot, etc.). I call it "Schrodinger's Map" since things don't exist until the user observes them :)

2. The Orchestrator: the central backbone running the story loop and law enforcement (e.g. physics). Manages time and clocks, assigning time cost to player actions to make time pressure real, and advances background world clocks (the world is always living, moving, reacting, even if you are stationary). For example, a bartender NPC may see you take a seat. As you talk with another NPC, the world clock ticks, bartender finishes polishing a glass, and chooses to talk with you. The world is active, not just reactive. Another key design is real RNG and affordance: if you try to wrestle a strong security guard, the Orchestrator queries another AI agent for a probability score of succeeding, then rolls a real random number to decide if you succeed or not.

3. The Director: the omniscient mastermind and driver behind the simulation, working in a two-step process: (1) resolution: Director receives player's input, NPC intents, current world state, outputs JSON to decide what exactly happens next, tracking injuries, changing trust levels, handling pacing. (2) narration: after resolution, Director now receives updated info to write high-quality, coherent prose for the player to read.

4. The Characters: (NPCs) this is a major part of what makes SimFic realistic, engaging, and unpredictable. If you used ChatGPT, all "characters" would be just a single ChatGPT trying to pretend to be each character; inherently flawed. In SimFic, every NPC is its own separate LLM agent with its own isolated context and agenda. Each NPC knows only what it would know in real life, so Theory of Mind and other behavioral features are much more realistic. NPCs have their own feelings, memory, motivation, boundaries, and conditions for creating trust. They can misinterpret your facial expression, panic, or act selfishly. The can also play along with you, cooperate, and read between the lines.

There are actually many more parts of SimFic that I haven't talked about due to the content length limit on HN, and parts I haven't even found yet, as I am only one pair of eyes, and there are infinite possibilities and emergent discoveries to be made. Which is why I'd love for HN readers to give it a try and provide feedback and opinions!

Thanks for reading!

Naxuye 9 days ago

This is a great idea. For someone who loves reading novels, it would be very immersive. But I have a question: what does the user's storyline development rely on? Is there a fixed plot? If there is, wouldn't that just be a linear process? The experience would be much less engaging. Also, if the plot were automatically generated by an LLM, the immersion would be really good—but isn't that difficult to implement right now?

  • InitialPhase55OP 9 days ago

    Nope, the Director agent dynamically generates the world and storyline as you play! (unless you strictly specify an exact plot you want). Nothing is otherwise pre-determined or set in stone, and LLMs make the call/judgment on the spot. You have freedom to do basically whatever you want within reason, and the Director will adapt to keep it engaging and coherent.

    Or at least that's the design intention; I haven't gotten much feedback so not sure if this is true to spec or if emergent oddities occur :)

InitialPhase55OP 12 days ago

Oh, and I'll keep topping up user quotas manually for the next 72h so you can keep experimenting freely, but if I forget, give me your username and I'm happy to give you enough balance for many hours of stories :)

Awesomedonut 11 days ago

This is so cool! I'm super interested in checking it out, as an avid writer&reader

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection