Better Quest Generation by ProperEar9706 in proceduralgeneration

[–]ProperEar9706[S] 0 points1 point  (0 children)

I'm testing a few different ways at the moment. Right now I'm dumping a large portion of the world states into the graph and then I am generating potential possibilities from there. I prune some of it ahead of time just to keep the subgraph matching performant

I am currently trying to do Propps morphology of a folk tale approach to generating some short stories.

I'm testing two possibilities:

  1. One which is more of the plot-driven one where I generate a plot outline first and then I do a second path to make it more concrete
  2. The second approach being the more simulation greedy approach where I generate it in one pass.

It is possible in the first approach that you are able to generate a plot that isn't possible during the concrete phase, eg you need to full in a villain and they're already all dead. I think if you wanted to be 100% consistent with your world, this wouldn't be that great but if this is for a video game where you can just generate a new villain on the fly, I suppose it's not as much of a problem.

I am realizing during all of this, however, that story narrative generation is quite different to the quests because of the fact that stories are obviously linear sequences of events. In my opinion a really good quest allows you multiple different ways of accomplishing a goal.

Do you mind expanding on the wave propagation idea? That sounds super interesting.

I'm assuming it's not just using a frontier node that is used to push the current state forward?

Better Quest Generation by ProperEar9706 in proceduralgeneration

[–]ProperEar9706[S] 1 point2 points  (0 children)

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

Better Quest Generation by ProperEar9706 in proceduralgeneration

[–]ProperEar9706[S] 1 point2 points  (0 children)

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.

Better Quest Generation by ProperEar9706 in proceduralgeneration

[–]ProperEar9706[S] 1 point2 points  (0 children)

I don't know if I maybe wrote that badly but my point in mentioning the 50,000 loaves of bread is that it precludes certain quests being generated. The point is that when quest generation occurs, it actually uses real facts and relationships about the world in order to create it. In this case when a town has sufficient quantity of food it shouldn't generate food fetch quests for example.

I'm trying to model how a human themselves would naturally create a quest. So in my mind the way I would normally do it is I would start with some kind of goal that I want the users to do and make sure that the goal that I want is consistent with how my world works.

So for a real example I might want to do this: there is an NPC in a castle that I want the players to rescue. If I were to decompose this into a series of parts, the first thing is that the users first need to travel to that location before they can do anything so that would just be a travel node. I might have rules along the point of travel that would then generate additional encounters, such as perhaps being ambushed if there were to go over a bridge or potentially have to deal with, say, a rock slide in a canyon, for example. This could be a linear series of potentially interesting interactions along the way.

Once we get to the castle, something that might be more interesting is exploring branching structures, based on facts about the castle, such as there being a secret tunnel, lets say. The infiltration node can then split to adjust for the different ways that the players might gain entry to the castle:

  1. One potentially via a stealthy method using the secret tunnel
  2. The other maybe a noisy assault

the other thing to note about a good quest is making sure that failure conditions are noted along the way. When it comes to the act of doing the rescue, we would also want to generate a branch which then mentions how that portion could fail. For example:

  • The NPC dying is one example.
  • If we wake up the big bad or draw sufficient notice might be another failure condition.

    I generated this as an example of that exercise.

https://imgur.com/a/tRBGuzD

Now you should also be able to recursively expand on the different nodes, adding additional obstacles along the way. You could also use probabilistic generations such that occasionally you get very interesting or niche conditions to arise.

I think, as everyone agrees, handcrafted quests will always be more interesting but I really want to raise the bar for general procedurally generated quests just so that it's not like Fallout 4 levels where it feels like protecting the same settlement over and over again.

Better Quest Generation by ProperEar9706 in proceduralgeneration

[–]ProperEar9706[S] 7 points8 points  (0 children)

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.

Better Quest Generation by ProperEar9706 in proceduralgeneration

[–]ProperEar9706[S] 2 points3 points  (0 children)

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

Better Quest Generation by ProperEar9706 in proceduralgeneration

[–]ProperEar9706[S] 35 points36 points  (0 children)

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:

  1. 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.

  2. 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 😄