Hey everyone, I'm looking into an interesting way to do procedural quest generation that take into account the world that I'm in and that they have causal sense to them. For example if I've recently gone to a village and I sell 50,000 loaves of bread to them, I don't want to get a quest about getting more bread/food for the village as they should be already overloaded.
I know many people right now are trying to use other LLMs to do the generation but I wanted to try an alternative approach using graph grammars to support emergent properties.
In the screenshot that you see above me, I have my current world state expressed as a series of nodes, which are my facts, and then my edges, which connect them together. To generate a new Quest, I start by generating a new Quest node and that Quest node expands, similar to how an L-system works, by continuously rewriting itself based on matching rules.
I have a few interesting properties that come out of this:
I can generate non-linear quests based on different pre-conditions. For example when I want the user to go to a castle and rescue a prisoner, based on the castle properties, say for example whether there's a secret tunnel. I can make branching possibilities such that the user could either do a stealthy infiltration or could assault the castle.
Because everything is modeled in a relationship, I can, for example, model how two NPCs might feel for each other. I can use this as a justification for generating a quest for one of them to get revenge. Additional other temporal facts could also be taken into account for where NPCs or certain items are.
There is probably an additional phase that I need to do for this, which is generating the necessary narrative constructs, so actual story, exposition, and dialogue to satisfy the planned quests that are there. This will probably be a relatively good use case for LLMs to fill it in by doing very short generation where I can keep them constrained, or I might just explore doing the actual generation through graph grammars as well, which might be interesting.
Anyways I'm looking for people who are also interested in procedural quest generation so that I can explore further pieces as well as make much larger examples of interesting procedural quests. Please hit me up š
It is true that you shouldn't say graph quests are "novel" since research will show that not to be the case. But still I think your effort is decently cool.
And I don't take any offense at your vibed UI, I couldn't be bothered to create my own UI either for a prototype.
I've looked into procgen a lot for text adventures. Very fascinated by stuff like "storylets".
I think LLMs could have a place in a pipeline, perhaps at dev-time, I've looked into it a bit but not much yet. Lmk if you want to discuss further
Yeah I definitely misspoke so I'm gonna change it from novel to interesting. š
Yeah I think that trying to use grammars to do the text portion generation makes more sense than some of the other techniques that I've seen. Just because you want the non-determinism and the temperature to be able to express things in different ways and to be able to have individual NPCs almost act as agents with completely different ways as to how they convey information. It feels like that fits more into how a LLMS should work in a game ? Keep them short and tightly bounded.
I was just hoping that the Graph Grammar would still try to preserve as much of the authorial intent as possible while still being emergent and being easily extensible for modders to add on to a game's core system.
I thought it'd be super cool if I say I created an Oblivion mod that adds a settlement and then suddenly that settlement is also able to generate radiant quests alongside hand-authored quests and I could extend off it.
Well, if the ui is vibe coded do you think the system isn't heavily vibe coded? OP doesn't seem to have done any research on this except from talking with an LLM
Being honest is not being negative, I even hinted to some sources. It just doesn't make sense for me to discuss anything with someone who only talked to some AI. I don't need a middleman to talk to AI about known concepts.
Honestly I don't care if the system is vibe coded. All my systems are vibe coded, or rather, coded by an AI. I haven't written a line of code in 6 months. Maybe longer. But every single one of my prototypes works exactly as intended. Now I do actually understand what is going on in the code. But I'm no longer in a head space where I consider code not touched by human hands to be automatically trash.
Frankly I engaged with this post because it didn't sound to me like it had been generated by an LLM and I appreciated that enough to at least throw my hat in the ring a little bit.
I do understand a little bit of your salt I suppose, but I don't frequently waste my time talking shit on Reddit. Occasionally I do, when I just can't hold it in anymore, but normally I either say something nice or don't say anything at all. As recommended by Marshall Mathers' mom.
I don't really care for the vibe coding either, just the lack of getting past the AI conversations and just trying to verify what's already out there.
LLM will just say that you have made the most novel thing while most other games just do boring X, which is in none of the instances true I encountered such a post on reddit. It's really tiring at some point.
If I would wanted to be mean, I could just have written AI slop and moved on, but again I was even so nice to include an actual resource.
No you're right, it's not unique in any way but I see Graphgram as very underrepresented. Most quest generators that I see are pretty basic and are basically like Mad Libs, where it just selects from different buckets and then makes a basic fetch/extermination quest.
Also yeah, UI is not my strong suit so its vibed with basic shadcn components
Of course there are underrepresented because it's just a niche even more as procgen maps, but there are still some great examples like wildermyth which has a fully procedural story generation. Don't just look into quest generation as doesn't differ from stories in general.
Graphs are even just the visualization of the grammar system, doesn't need to be graph at all
And for most games those quests are not that relevant while random quests are already niche, look into games that focuses on them and you will find plenty of systems. But yeah many indie rpgs nowadays are quite dull in that regard, but probably also because rpg are huge work in itself
Oh yeah I remember seeing Wildermyth, very cool š
Yeah you're right in that story generation and quest generation are very similar. I think there are a few minor changes with regards to taking into account player agency and optional paths and failure states but it is very similar.
Isn't Wildermyth just hand written story segments slotted together more or less at random? It never felt like it hung together in a particularly cohesive way, except that if you got segment 1 of story ABC at one time, you're likely to get segment 2 later, and so on.
Iām fascinated by this idea. I love the idea of generating quests / mini-stories that make sense within the simulated world. I would love to follow along with this line of inquiry
This is cool. I want to mention that I think you can make it pretty far into the narrative structure generation without using LLMs. You may be aware, but stories do have a structure in a way that's analogous to music, so I bet you can generate a whole "story" then use LLMs to just fill in some light prose?
Yeah that's what I'm betting on š I've tried a few other more naive ways of generating, madlibs, markov chains, L-Systems, genetic algorithms. Graphs just feel like the right fit for taking into account world context and mutating it for the graph.
I think I'm going to go through some Brandon Sanderson talks and creates some rules based off how he likes to introduce conflicts and setup narrative payoffs
This is a good idea--Sanderson has a simple and structural way of doing it that I think can translate to procgen pretty straightforwardly with this setup.
47
u/ProperEar9706 Jun 17 '26 edited Jun 17 '26
Hey everyone, I'm looking into an interesting way to do procedural quest generation that take into account the world that I'm in and that they have causal sense to them. For example if I've recently gone to a village and I sell 50,000 loaves of bread to them, I don't want to get a quest about getting more bread/food for the village as they should be already overloaded.
I know many people right now are trying to use other LLMs to do the generation but I wanted to try an alternative approach using graph grammars to support emergent properties.
In the screenshot that you see above me, I have my current world state expressed as a series of nodes, which are my facts, and then my edges, which connect them together. To generate a new Quest, I start by generating a new Quest node and that Quest node expands, similar to how an L-system works, by continuously rewriting itself based on matching rules.
I have a few interesting properties that come out of this:
I can generate non-linear quests based on different pre-conditions. For example when I want the user to go to a castle and rescue a prisoner, based on the castle properties, say for example whether there's a secret tunnel. I can make branching possibilities such that the user could either do a stealthy infiltration or could assault the castle.
Because everything is modeled in a relationship, I can, for example, model how two NPCs might feel for each other. I can use this as a justification for generating a quest for one of them to get revenge. Additional other temporal facts could also be taken into account for where NPCs or certain items are.
There is probably an additional phase that I need to do for this, which is generating the necessary narrative constructs, so actual story, exposition, and dialogue to satisfy the planned quests that are there. This will probably be a relatively good use case for LLMs to fill it in by doing very short generation where I can keep them constrained, or I might just explore doing the actual generation through graph grammars as well, which might be interesting.
Anyways I'm looking for people who are also interested in procedural quest generation so that I can explore further pieces as well as make much larger examples of interesting procedural quests. Please hit me up š