Procedural Generation

Aug 13, 2011 at 11:52 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
Procedural generation is, simply put, the art of creating unique worlds through programming. Spelunky, Minecraft, Terraria, Nethack and others are all procedurally generated, and that's a large part of their appeal. These games, like many awesome games (Zelda, La Mulana, Cave Story), are based around the idea of dungeon crawling - of exploring places we've never been before and conquering them. What procedural generation offers is a completely new world to explore every single time you start a new game. This, quite obviously, allows for a bajillion funs when done well, but it is often not done well.

So, dear folks, how would you approach procedural generation (both of zelda-like worlds and cavern systems), and what steps would you take towards making sure it was still fun?



PS: I know this is different from the normal sort of thread on these forums. I just figured that if we have a new section, why not use it? Another note is that even if you have no programming experience, you should totally still make your ideas known. Usefulness!
PPS: I do have a sort of iterative offering. I'm still working on it though, and I'm not sure when it will be done (due to remaking my computer from scratch sometime soon).
 
Aug 14, 2011 at 12:54 AM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
I would use a nutrient system.

In a procedurally generated world, nutrients are not limited to "foodstuffs for animals/humans/biological things". Instead, a nutrient would define what objects are allowed to exist in a region and what objects are not.

For example, there can be rock nutrients (which spawn rocks wherever they are located) and tree nutrients (which spawn trees wherever they are located). The ratio and concentrations of these nutrients in an empty world can be taken into account in order to affect the landscape in even more ways.

Nutrients can also be active, as if they were microorganisms. Each nutrient will have properties that may define which item(s) they will spawn. If nutrients are allowed to compete for space, move, mutate, and reproduce over time, then the world will be far more interesting.

After letting these nutrients sit around and "cook" for a while, those nutrients can be frozen and set to spawn whichever items/objects they are supposed to spawn. Then the world is finally created. As a finishing step, the game engine will look around at the world (let's assume the map shall be a cavern system) and make adjustments to let the game be more playable. For example, the game engine may connect tunnels that would normally be inaccessible to give more chances for exploration.

To keep the game fun, there should also be predefined tools that allow the player a decent amount of freedom to overcome a variety of obstacles. Your typical roguelike dungeon-crawling kit, complete with ropes, flares, shovels, bombs, jetpacks, grappling hooks, and so on should be made available to the player in some way. The player could earn such rewards by exploration (finding the items) or using surrounding resources to build the tools.
 
Aug 14, 2011 at 2:52 AM
I don't anymore.
"I'm sorry Mario, but your princess is in another castle."
Join Date: Aug 9, 2010
Location: Greener Pastures
Posts: 1190
Age: 30
I'd make the world have the same basic layout, but each general area would be different.

For instance, you always start off in a particular town, but that town looks different every time you play. The random generation would be a bit restricted, but it would make for a unique adventure game.
 
Aug 14, 2011 at 2:58 AM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
Ah, interesting. Carrotlord's post reminds me of the Game of Life, but with more than one type of playing piece. It's an intriguing idea, but ultimately I suspect it would be a) too time-consuming and b) if it's really as much like the Game of Life as it sounds, too predictable. The latter isn't hard to fix, but the time? I think it could be quite significant. Waiting even 5 minutes for a world to generate would, I think, be much too long.

For Minecraft, I think it uses a noise generator to determine the terrain height; I think this helps give it a more "natural" feel. Once it has the basic terrain (not entirely sure what's basic, but certainly not much), it goes back through and adds special features such as dungeons, lakes, and trees. It works well for Minecraft, certainly. I expect it would work for a more traditional 3D game as well, using a noise generator to get a height map and then throwing in objects on the resulting terrain. Of course, that's if you want something natural-ish. If you're generating cities and such, you may not want a noise generator, and generation would likely be significantly less random (though still somewhat random).

I'm not sure how the above sort of method would work for a 2D game. It might be possible to adapt the principles to one less dimension; frankly I haven't really given a whole lot of thought to terrain generation in general, so I can't be certain.
 
Aug 14, 2011 at 2:59 AM
In front of a computer
"Man, if only I had an apple..."
Join Date: Mar 1, 2008
Location: Grasstown
Posts: 1435
HyMyNameIsMatt said:
I'd make the world have the same basic layout, but each general area would be different.

For instance, you always start off in a particular town, but that town looks different every time you play. The random generation would be a bit restricted, but it would make for a unique adventure game.
Castle of the Winds is a bit like this. More precisely, the towns and countryside are fixed but the dungeons are randomly generated. I didn't play it that much, though, so I can't really say anything beyond "it's been done, here".
 
Aug 14, 2011 at 3:05 AM
I don't anymore.
"I'm sorry Mario, but your princess is in another castle."
Join Date: Aug 9, 2010
Location: Greener Pastures
Posts: 1190
Age: 30
Celtic Minstrel said:
Castle of the Winds is a bit like this. More precisely, the towns and countryside are fixed but the dungeons are randomly generated. I didn't play it that much, though, so I can't really say anything beyond "it's been done, here".

That means you get the same old towns. I mean EVERYTHING, "except for maybe rooms in towns, but they're randomly placed". In each new game you have to relearn the landscape, figure out where the upgrades are, and maybe I would throw in a variety of enemies and make the map's selection of enemies random. In some games you get spiders running around the forest, in others you get hopping mushrooms. It would give the game alot of replay value. Damn, I wanna do this now.
 
Aug 14, 2011 at 3:48 AM
Only Love, Maximum Love, Forever
"Life begins and ends with Nu."
Join Date: May 6, 2009
Location: somewhere new
Posts: 2137
Age: 29
I would love Minecraft's procedural generation more if it had an aging engine, which is used quite well in Dwarf Fortress. In DF, you can even choose when to stop aging, which is viable via overwrld view. However, if Minecraft had world-wide age values that are randomly applied to each world, then nice things happen, despite it being less noticeable. It could determine frequency of dungeons (older maps would have fewer dungeons or dungeons that had already been looted years ago), development of cities (frequent tribal areas/basic small towns compared to more sparse, more advanced castles and cities), amount of grass spread over dirt and stone, etc.
It would add a whole new level of complexity to the world.
 
Aug 14, 2011 at 4:08 PM
Pirate Member
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Dec 26, 2007
Location: Lithuania
Posts: 1946
Most of you will right copious amounts of texts in this thread, and that's good because the original post raises discussion easily. Kudos to Lace for that one. Anyways games that have randomly generated maps are fun to play, but they never leave an emotional memory. Not to me at least. They lack soul. They lack love. When you play cavestory, each tile is put there manually. You can actually feel Pixel's personality engraved in that game. Minecraft and Spelunky, sure they're fun for a while. The same way that physics simulation games are fun.

Many people look for freedom in games, but what they fail to realise is that there is no freedom there. Randomness doesn't bring freedom either.
 
Aug 14, 2011 at 6:35 PM
Only Love, Maximum Love, Forever
"Life begins and ends with Nu."
Join Date: May 6, 2009
Location: somewhere new
Posts: 2137
Age: 29
WoodenRat said:
Most of you will right copious amounts of texts in this thread, and that's good because the original post raises discussion easily. Kudos to Lace for that one. Anyways games that have randomly generated maps are fun to play, but they never leave an emotional memory. Not to me at least. They lack soul. They lack love. When you play cavestory, each tile is put there manually. You can actually feel Pixel's personality engraved in that game. Minecraft and Spelunky, sure they're fun for a while. The same way that physics simulation games are fun.
You raise a valid point, woody, but I personally disagree with you. Though each map may not be as specifically designed, each world feels like your own.
In fact, that's one of the reasons Minecraft is so adored. It's massively wide-spread, so you can find many fans, but each person has a vastly different experience based on their world (past the first week of playing, where players figure out what do).
Read this article, it explains my standing pretty well.

WoodenRat said:
Many people look for freedom in games, but what they fail to realise is that there is no freedom there. Randomness doesn't bring freedom either.

Genius sounding, but ultimately untrue. there is total freedom in Minecraft, but, as you said, it's not because it's random. It's because there are no rules, no goals. Each player develops their own goals, be it build a shit-bricks awesome castle, explore your world until your computer runs out of space, or creating a replica of Middle Earth for everyone to enjoy.
The player makes his own goal, so they have total freedom :D
 
Aug 14, 2011 at 6:40 PM
Creating A Legacy...
Bobomb says: "I need a hug!"
Join Date: Sep 6, 2009
Location: The Balcony
Posts: 852
Age: 29
I strongly agree with Woodenrat.. I like to remember certain places as they were designed to be.. where every single aspect was put there for a reason...

I do really like generated maps such as Terraria though.. there a lot more fun in Building/Construction games.. In games such as Zelda, everything you do in a dungeon makes something else happen elsewhere.. Like putting all the pieces of the puzzle together.. In a Generated dungeon, You find yourself solving puzzles which you solved earlier on and it becomes and ease..
 
Aug 14, 2011 at 6:43 PM
Member Title
"All your forum are belong to us!"
Join Date: Mar 9, 2011
Location:
Posts: 629
I would probably incorporate something similar to Terraria, where you have to search for life crystals or other useful gear. Also, I would incorporate rare biomes (Like Terraria's floating islands or underground jungles, but a tad bit harder to find).
 
Aug 14, 2011 at 7:13 PM
I don't anymore.
"I'm sorry Mario, but your princess is in another castle."
Join Date: Aug 9, 2010
Location: Greener Pastures
Posts: 1190
Age: 30
Alot of good ideas here. Someone should take a few of these into consideration. Not Woodenrat's though.
 
Aug 14, 2011 at 10:16 PM
Only Love, Maximum Love, Forever
"Life begins and ends with Nu."
Join Date: May 6, 2009
Location: somewhere new
Posts: 2137
Age: 29
I think people are missing the point of this thread.
It's about good parts of Procedural Generation in general, not just Minecraft.
 
Aug 14, 2011 at 10:25 PM
I don't anymore.
"I'm sorry Mario, but your princess is in another castle."
Join Date: Aug 9, 2010
Location: Greener Pastures
Posts: 1190
Age: 30
cultr1 said:
I think people are missing the point of this thread.
It's about good parts of Procedural Generation in general, not just Minecraft.

I've noticed that going around too, I just don't care. Although Minecraft is kinda the first thing that somes to mind when discussing it.
 
Aug 15, 2011 at 3:16 AM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
HyMyNameIsMatt said:
Alot of good ideas here. Someone should take a few of these into consideration. Not Woodenrat's though.
I dunno. He has a valid point, and even if you disagree with him, that's no reason to dismiss his ideas completely. Procedural content generally does seem to lack a soul. It doesn't leave an emotional impact on the player, and those parts that do are generally not things created by the computer but rather those handmade by the designer. That's one of the main things that's the 'next step' - how can you make the game feel like it was dreamed up, rather than mashed together out of different pieces?

Carrot I'm interested in how you would implement (eg code) that idea of yours. It's pretty interesting and not something that immediately came to my mind.

Also I made an island generator! I'll post the code if anybody wants it. It is based on the square-diamond algorithm.


Lastly, what are your thoughts on the placement of enemies, obstacles and treasure, rather than simply the creation of terrain? Ultimately I think those are what make games challenging or easy, interesting or uninteresting. They're also things that I, as a designer, would know more about placing than a computer.

Thanks for making this thread awesome guys.
 
Aug 15, 2011 at 3:56 AM
I don't anymore.
"I'm sorry Mario, but your princess is in another castle."
Join Date: Aug 9, 2010
Location: Greener Pastures
Posts: 1190
Age: 30
Oh no, he is entitled ton his opinion, but that's not neccesariky something you can implement. I mentioned my adventure game type generation to a friend and now he's trying to make an engine for it. To add the artists touch I was thinking of premaking all the chuncks and assigning labels to each side which determin which pieces can go together. It would be work, but it would certainly be more original. It's more proof of concept than anything else so I'll let you guys know how it goes.
 
Aug 15, 2011 at 4:50 AM
Senior Member
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Nov 17, 2009
Location:
Posts: 232
The problem with procedural generation, to me, seems to be not that it makes things feel false and soulless. It is that the randomness still feels the same. Maybe I'm just too uncreative to make goals for myself. I don't know. But I'd like for there to be more of a randomly generated FOCUS, ya know?
In Dwarf Fortress' Adventurer mode, for example, while you can do many things, there is no goal for you. You do everything and it still feels pointless because you're still going to be killing night creatures and titans and things rarely deviate from that. He's putting in something that allows you to take charge of a historical figure to be part of a random plotline, solving that.
Wait, now I know the problem. It all feels the same because randomly generated worlds tend not to have the flexibility, oddly enough, to recognize your goal and change the world accordingly. Adventurer mode, again as an example, has you going to kill monsters, but in the end your recognizable impact on the world is little. In the space-trader Elite, you can go and trade to get rich, kill pirates, BE a pirate, and what have you. You'll still be flying around in a world that changes little. You cannot take charge of anything, control and shape the world. It's like a physics simulator, where you can prod the pieces but not really change the game. Again, Toady is striving to change that in Dwarf Fortress by allowing you to lead and control and take charge. Allowing you to SHAPE the world.
(I'm not mentioning Minecraft because I haven't played it and I don't want to pirate a game I have no excuse to)
As for how I would do random generation? I'd randomly generate the enviornments in a way like Minecraft and DF do. BUT, I would go waaay more in depth on the development of civilizations. Each person would have a randomly generated personality (again like DF does. I really like DF okay) and a sort of goals and aspirations system kind of like the sims. There would be an extensive list of goals with points assigned for different personality traits, and through some equation (okay I haven't exactly done much planning for this) goals would be assigned to the person. Each goal would have a sort of "power requirement" that would be roughly how much power a person needs to feel they have before setting out on the goal (which could be more or less according to personality). Maybe have different power levels for different types of power (physical, mental, political, etc.) People try to accomplish goals in an order determined by a satisfaction amount, which would probably be a computation of the similarity between the personality of that goal and the person and a satisfaction factor or something. Goals, by accomplishing them, should increase the power of a person and/or their skill in something (which is a different kind of power). Or something. Many of these goals should be in relation to other people, such as say impressing important people with music or getting elected. Perhaps people should be able to switch between goals by getting discouraged, which happens more or less easily with personality. This SEEMS like it would model a society, given enough fine-tuning, other components added in, and complete overhaul.
This isn't exactly THOUGHT OUT per say, so don't read too deep into it.
EDIT: Oh yeah. The thing about randomly generating a society: When you have randomly generated characters to interact with, you can create a randomly generated plotline and a much more realistic focus for yourself. You'll be able to gain and lose power by interacting with the society.
 
Aug 15, 2011 at 4:56 AM
Only Love, Maximum Love, Forever
"Life begins and ends with Nu."
Join Date: May 6, 2009
Location: somewhere new
Posts: 2137
Age: 29
I gotta say, that was brilliant.
I agree, but the only problem is the amount of programming it would take just to create just one if those personalities, which is why most games don't have it.
 
Aug 15, 2011 at 4:20 PM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
One difficult thing about procedurally generating personalities is creating dialogue that sounds unique yet still makes sense as part of a plotline.

Fortunately there's been some research in the AI dialogue department, but it's nowhere near perfect.
 
Aug 19, 2011 at 1:13 PM
Pirate Member
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Dec 26, 2007
Location: Lithuania
Posts: 1946
I'm glad that my post brought discussion. Though I'm offended that Matt thinks my opinion should be completely dismissed. He doesn't justify why.

We can go deeper and deeper, thinking that minecraft is something big. But when we simplify it, then really it's just a virtual version of lego. Then again a house is just a pile of bricks, but if you inject imagination in your perspective then it becomes a house. That's the magical thing about the human mind. Imagination.
 
Top