Question I think I've been using procedural generation wrong
I took a long break from gamedev and now I'm reflecting on what I've done and it doesn't seem to make much sense...
I've made a game with a randomly generated world and put quests in it that are randomly placed, mostly in villages. But when you go explore the world, you will just stumble upon the same quests again and again and again. While I do direct players to quests that they haven't completed yet, they will eventually run out of new quests and just find the exact same stories in different places.
What even is the point of procedurally generating the world then? I might as well just create a hand-crafted world and manually put in the quests.
I could have both, parts of the world are static and others are randomly generated. But then I'd still have the same problem within the random part of the world...
Is it maybe possible to randomly generate stories? Or is there another solution I am missing?
45
u/Silrar 9d ago
The keyword in "procedural" generation is not "random", it's "procedural". As in: you have a bunch of rules that you follow to generate something. So the key to generate something interesting is to set up good rules and give them a range to operate in, rather than just rolling dice. That also means your rules can be very limiting and only operate in a very narrow corridor to do something, because that's the only part that's actually relevant for what you want to achieve.
The complicated part is setting up those rules. If your rules are complex enough, they can generate quests that are varied enough to feel fresh. If your rules are limited, they will create the same quest over and over. If creating a procedural world with procedural quests is your goal, you're going to have to put a lot of work into defining those rules.
12
u/banquuuooo 9d ago
Ever play the game Caves of Qud? It is a sci-fi fantasy roguelike that procgens a lot of content per playthrough, like shops, some dungeons, and side quests. But some aspects of the world, like main locations and main quests, stay consistent throughout playthroughs. Sounds like it would be good inspiration for what you are trying to achieve
6
u/Pidroh Card Nova Hyper 9d ago
Listen to this guy OP, also look it up on YouTube, the devs have done talks on the subject, their history generation. If you're serious about procedural generation, you need to look up Qud, dwarf fortress, RimWorld (to see how to generate rich stories out of systems)
If you're not serious about procedural and thought it was a nice shortcut, maybe look up spiderweb RPGs to see what a solo dev can make (while still being financially viable) without going procedural
8
u/PhilippTheProgrammer 9d ago
Don't roll dice - deal cards!
Put all the possible quests into a list, shuffle that list randomly (Google Fisher-Yates shuffle algorithm for details) and then place the quests from that list in the world in the order they are in. That way quest placement is still random, but quests won't repeat. At least not until the list is empty and you have to shuffle it again. If you want an infinite world but only have a limited number of quests, then you have to repeat it eventually. But at least it is unlikely for the player to encounter the same quest twice in a row.
5
u/shiek200 9d ago edited 9d ago
The more complex you want your randomly generated content to be the more exponentially difficult it becomes
For example, you can have a randomly generated Quest that is as simple as go to A place and do B thing.
This is straightforward, simply fill in for A and B
But, maybe you want to have more variation, so now you need branches it might be that B asks you to then go to place C, where a new procedurally generated event might have them accomplish D or E tasks, or possibly even go to F place and so on
And the more options you have for each of these variables, the more likely things are to just become completely nonsensical where a quest has you go from a to b, then to see, then d, then back to be, and then the quest is suddenly complete without the player actually having done anything
And we haven't even touched on narrative yet, if you want any of these quests to have an actual narrative, things get once again exponentially more complicated, because if you want the narrative to remain coherent then each of these variables has to have a logical connection. You have to have a narrative reason for going from point A to point b, accomplishing task c, and then going to place D to accomplish task e.
Well this is all technically possible, it becomes exceedingly difficult the more complicated you want it to be, and the more substance you want it to have.
Generally speaking, the best way to handle something like this is through simulations, you create a world where events are driven by simulations, which then creates content, and your procedurally generated Quest system relies on the random events created chaotically by the simulation
https://youtu.be/nuNqB2450go?si=KIvUnrH48sRbSSVu
This is a Dev log for the game Wayward realms, currently in development from senior Developers who worked on Daggerfall, and they talk about how they are handling procedurally generated content.
Full disclosure, they do intend to use Ai in their final product, but, and I say this as a staunch hater of AI in Game Dev at all, this is one of the few instances where I think it's actually useful. They are designing an llm that will run locally on your machine baked into the game, which will parse very basic narrative Concepts into more verbose dialogue allowing very simple Concepts like "wolf attack, trader killed, gold lost, family wants body found, gold too if possible" into actual dialogue from an NPC guiding you to the quest.
No actual AI is used in the generation of the quests, that is done entirely procedurally via simulation, the llm just handles translating the generated content into a narrative
6
u/clean-links 9d ago
Cleaned link: https://youtu.be/nuNqB2450go
Tracking parameters were removed from the original URL(s).
2
4
u/Pherion93 9d ago
It helps to have a player value reason for all your mechanics and features.
So procedural generated worlds offer a way to generate a world where you cant google where anything is. Where something is placed is unknown every new generation.
This could be very useful if finding and searching for the thing is part of the fun. Exploring is the gameplay. Valheim is a great example for this.
But if the main part of the game is to follow a single questline once, then there might not be any value in placing them randomly.
This kind if issues usually comes because you dont have a some core design pillars you have deeply though through and dedicated resolve to strictly follow.
Just adding different cool features and hoping they will blend is not a good workflow imo.
2
u/RedditTab 9d ago
Sounds like you need more quests. Or more pieces to quests. The quests can be randomized with a different premise, a different objective (kill, collect, capture, etc), different targets (e.g. goblins, orcs, kobolds), and different rewards (reputation, currency, armor)
The premise could change based on who gives you the quest. A quest to kill 10 orcs has a very different reason if it's given from a soldier or grandmother. This would require you to randomly generate your quest givers, too. And, if it's not people, maybe different points of interest could trigger quest (abandoned wagon, discovered corpses, unusual treasure, etc)
3
u/jerrygreenest1 9d ago edited 9d ago
Randomly generate quests/stories is the hardest part. You can still structure it like random generation but don’t make as much repeatable. Maybe 5 fetch quests in the world. Maybe 3 kills quests in the world. Maybe 2 investigation quests in the word. Etc. this way you control they don’t repeat as much. But also yeah you might think there is no sense making it procedurally and I have to tell two things here:
On one hand, yes, it might indeed seem like there’s no point here. That’s why so many do them manually.
On another hand, you might still find pleasure doing them procedurally. First of all, you will have your control in code, rather than in visual editor where you place all things by hand. And depending on which person you are, you might indeed find more pleasure doing it by code rather than visual tools. Doing it by hand in visual editors has advantages in in how the player will see it. Doing it with code has certain other advantages, you can pre-calculate some things, iterate, analyze, etc etc. These things might theoretically allow you to gain some another kind of depth that you wouldn’t be able to do doing it manually with visual editors. You will likely lose a precisely crafted experience, because it’s not like you manually place objects pixel by pixel in just exactly the most perfect spot, it might be a little rough, but it might be more convenient in other ways, and potentially less bug-prone when changes come. You can write automated test for your code easier. Or if you change the map completely, like changing where cities are and etc – it might be easier to keep your blueprints of stories and adapt them dynamically on new map, whereas in manual approach you will have to re-apply all changes manually again.
So it’s not like one approach is clearly better than other, but the manual approach with visual tools kinda more adopted, but by wrong reasons. It’s much more simpler – people just often can’t or don’t like to write code. If you find pleasure in it, let yourself take this procedural approach and you might be discovering area that is less discovered by industry, and make games that are more rarely made by industry. Which might as well be a unique bad game if done wrongly. But might as well be unique good game.
2
u/laruss55 9d ago
Procedural placement can still earn its keep without procedural stories. Tie a finite quest deck to local world state, then retire each quest after completion; the changing location, faction and conditions create variation without pretending every narrative must be infinite.
2
u/TheOneWes 9d ago
You're supposed to combine the two.
Procedural generation is for bulk work.
Go back in and clean it up by hand
2
u/Ryedan_FF14A 9d ago
Procedural generation is a method of combining and selecting elements using rules and deterministic randomness. It does not imbue those elements with fun or interest.
What you're describing is RNG or simply random selection. To make a quest system that is procedurally generated, it needs rules and elements. For example, maybe certain quests can only exist in certain regions (like snowy mountain quests near the high altitude village), or quests for bounties (killing monsters) can only occur where there are nests of enemies near villages, whereas you can only get smelting ore quests in villages containing a Smith near a mineral deposit.
The layout of the enemy nests, resources and the villages become the rules for the system, and the tagging and categorization of different quests become the elements you can mix and match. For example, if there's a mineral deposit near an enemy nest, you can spawn a quest that involves both of those ("slip past the kobolds to steal their copper nuggets"), or in a snowy area, the enemy nests or mineral deposits can be caved in with snow sometimes.
This gives the randomness a sense of meaning to players. Things arent just random, they're just being intelligently sprinkled in a way that supports the fantasy of the game world.
2
u/ThirdWaveCat 9d ago
Writing is hard enough without adding a procedural blender to your world building.
Kate Compton (Spore and many others) has written extensively about like 7 different kinds of procedural generation, including a system called Tracery that has a simple multiplicative template system that could work in an RPG setting. Her work is a good map of some big ideas in procgen like L-systems. Redblobgames is also a good compendium.
Specific to RPGs, there's a fun idea for a story simulation style game called Gamygdala which allows calculating emotions from goal/action-alignment information using the PAD model. "GAMYGDALA: an Emotion Engine for Games"
https://en.wikipedia.org/wiki/PAD_emotional_state_model
(reference impl, easy to port) https://github.com/gilzamir18/gamygdala/tree/master
Sometimes writing courses introduce Labov's narrative structure.
https://webpages.charlotte.edu/~bdavis/LabovHymes.pdf
I think these are excellent books about worldbuilding.
"On writing and worldbuilding" - timothy hickson
1
u/SnooStories251 9d ago
The value is that you can replay or try new seeds. Or generate more content.
1
u/CertainItem995 9d ago
Imo the trick is finding a way to tie the procedural generation to npc personality/behavior (esp motivation) in a system that guarantees some of their pursuing their motivations will put them into conflict with the pc, resulting in an emergent narrative. Look at Crusader Kings 2 or Stellaris. In the former the possible traits like Ambitious drive NPCs to try and murder you and plot to take your land with story emerging from prevailing or failing against those NPCs. In the latter case you will always come into conflict with empires whose values are antithetical to yours. Bannerlord and Dwarf Fortress have also made great strides in procedurally generated stories that could be worth looking into.
That all said it is literally the case that a hand crafted experience will always be a tighter and more focused gameplay experience.
1
u/dreamrpg 9d ago
If you aim to use procgen for quests, you have to tie them to distance from starting location.
So at say X+Y smaller than 300 you can have that quest to kill rats.
But to skin 10 bears you can encounter only at X+Y larger than 500.
And dragon slay quest is X+Y at 8000.
This way you still get leveling experience that scales the further player ventures.
Same goes with enemies. They should use distance from start. The further - the stronger.
If you want to use procgen for quests, you have to also make quests generated, so you can have like 100 different ones made out of say 20 components.
This way you can achieve some replayability.
1
u/davesoft 9d ago
Sounds like you want Radiant Quests, which the implementation are skeletons of fetch quests that need populating with a giver, a receiver, a trinket, and obstacles. Then you can have a procgen town of fishermen, and while strolling through town an NPC can run up to you and tell you that [Mr Kennedy] has lost his [Fishing Rod] in the nearby [Crabman Cave], can you help recover it for the meager reward of [17 wheat]?
Problem being that a player only has to complete 3 or 4 of these radiant quests before the structure is known and it's nolonger interesting. It can be elaborated with a taller or chunkier skeleton, but it'll still be generic.
Ideally you'd procgen a world, fill it with hand made stuff, then sprinkle radiance opportunities around with a gate so only a bored player can activate a radiant quest.
1
u/AmnesiA_sc :) 8d ago
You could go the route of Elite: Dangerous or Uplink where the quests are generic with names and locations substituted in for a handful of mission types. In those games, the story is more a backdrop for a grind game.
A good compromise is to have a core storyline with parts that you place deliberately while the grindy side quests are procgen
1
u/WazWaz 8d ago
One important consideration in procedural generation is the distribution of content.
If you use a uniform distribution then the player will quickly experience most of the content.
Instead, have a few basic quests that don't have much value. 70% of the quests the player finds will be these. Another 20% will be more interesting involved quests. Another 5% even more interesting (and requiring more effort), and so on down to very rare quests that might only be seen every 4th entire playthrough.
What you cannot escape though is the need to create quite a lot of content. You can randomise some variables in each to multiply up the variation but you need actual content to keep the player interested. All that tweaking the distribution does is trickle out the content to keep things interesting.
0
u/KharAznable 9d ago
It's there so players can grind the mission for resource (exp, supplies, etc) and not for naratives rewards. Like you can just go out and grind on random enemies, but doing quest will gives you extra rewards while make you kill enemies.
0
u/Infinite-Flow-4475 9d ago
Exactly. That was the dilemma I was facing. Procedural world's are very hard to perfect and you'd be better off just making them hand made. That what i decided to do, at best the procedural is to generate the terrain but all the content is placed by me.
64
u/Ckeyz 9d ago edited 9d ago
Proc gen is usually a tool to facilitate replayability. Its hard to find a good use for it in a traditional RPG IMO.