Procedural Generation

I've noticed that procedural generation is being mentioned in people's posts much more than it was last Pyweek. To those that have mentioned it, why is it on so many people's minds?

(log in to comment)

Comments

For me, it's a good source of content considering my games' simple requirements. Because I've done it a few times before, I can probably manage it for my stuff, so it'll hopefully go well for me. I'm not sure about others here, though.
One of the most time consuming things during the week involves making the actual game. Yes, the bug hunting can eat up time too, but when the bug hunting is done, you are often left with a very short game, or one that doesn't actually explore the possibilities that might be in the mechanics. For example, if I make an rpg, and spend the entire week on the combat engine, but no time actually making a world to explore, it will probably be a very bad rpg (or maybe not what I was going for). Put a little bit of that coding time to have the world generated and suddenly its a viable game. I think people are attracted to the idea that they can add a little bit more time to the coding, and cut out the content creation almost entirely.

It also helps as a creator to not have foreknowledge of what exactly a playthrough of the game will be like. With traditional methods, making the game can be fun, but playing a game you created is pretty awful. With procedural stuff it can be almost as exciting for the dev as for another player.
I plan generate the game levels instead of designing them by hand. The reason to do that is basically because I don't think I'll have the time to write a game engine... and then the game on top of the engine.

I think the best solution would be that the game engine it's the game itself. For example: Monopoly; once you have the game engine -the board, the rules, etc- the game is done... the dice and players' decisions it's the changing element over the time. But that means that you NEED a very good game idea.

Instead of having a very good game idea, I'll try to get an average idea with some procedural generated levels ;)
I think board games are a good inspiration that computer game devs should use more often. Not in the "lets make a computer game version of a boardgame" variety, but a stronger focus on game concepts and less on the bits in between that link the game together.
That makes more sense...

Thanks for clearing it up for me!
Procedural content generation is an attractive idea, but it can be a two-edged sword. I've used it in a couple of my games (Quest for the Holy Grail and Hark! I Impale Weasels!), and I found that it can take considerable effort to devise an algorithm that generates acceptably good levels -- ones that look interesting, are interesting to play, and most importantly, are solvable! It's hard to be sure that I wouldn't have been just as well off spending the time creating some levels manually.

Possibly a hybrid approach might be fruitful -- use a randomly-generated level as a starting point, and then make manual adjustments to it.
You could also make a game of infinite length by generating a new level every time it's played, perhaps with a "cave" generator or something. For Pyweek, I guess it depends on how long it takes to make a good generator.

A procedural generation wiki I found: http://pcg.wikidot.com/
for me theres something really elegant about procedurally generated content. the information density is really high compared to manually generated content... or something like that. someday i would like tomake a game that has the holy grail of procedural generation... a completely empty data directory. or maybe it can contain a single number thats used to seed your random number generator. the whole concept is pretty cool i think.

on the other hand it doesnt confer a whole lot of benefits when it comes to actually making your game fun or interesting... except maybe to other programmers. it can reduce your file size... especially procedurally generated music... but a few megabytes is no big deal these days. its essential if you want a practically infinite world... but most games dont need this. the benefit if your game world is moderate in size is questionable.

but like i said... i think its elegant. actually i want to go a step further. the real holy grail should be that your engine is nothing but a physics simulator. it generates and simulates an entire universe and automatically populates it with creatures and objects. all you need to do is tell it a point in time and space where the game will begin and specify an end condition. now wouldnt that be awesome

ps. sorry about the lack of punctuation. im on my android phone and this text input box is badly broken on this browser....
the real holy grail should be that your engine is nothing but a physics simulator. it generates and simulates an entire universe and automatically populates it with creatures and objects.

You're kind of almost descibing Minecraft there. :-)

This can work well in a sandbox-style game where it's entirely up to the player to make something interesting out of the raw material provided. Probably not so good if the player expects to be provided with ready-made challenges and surprises.

There's an analogous debate that recurs every so often in the interactive fiction community, where some people believe the holy grail would be some kind of automatic narrative generator. But so far all attempts to produce such a thing have more or less been failures. Creating a story that humans find engaging appears to be an AI-complete problem.
Here's the problem I see with a story generator. As a writer, I would say I spend approximately half of my story design phase trying to see how to make my story different from other stories I have read. Maybe more. The second my story plans feel too similar to something else, too recognizable, I have to backtrack. It seriously takes many brain cycles to put an original spin on things. Nothing is truly original, but you try, you know?

Whereas for procedural generation, you are almost always trying to make something that fits an existing pattern, something that DOES look recognizable. When generating a mountain, you don't try hard to make it NOT look like a mountain, you try very hard to make it look exactly like a mountain. Maybe not 100% the same in every detail as this other mountain, put pretty close. There is similar structure in stories, but not the kind that is easily made into a function, and part of the fun in writing is knowing when to break out of the structure.
i havent played minecraft but from what i understand its sort of what i have in mind but not quite to holy grail levels. for my holy grail even the audio and the textures would be generated using physics within the game. and as i understand it minecraft has a large list of items with recipes that had to be written manually.... and a list of monsters whose behaviors had to be written manually. so theres still a lot of manual generation goin on. not as much as most games but more than is theoretically neccesary.

but yes minecraft is a great example of how far you can get by relying on a few simple procedural rules to generate most of the gameplay. an older example would be simcity. but i think that even if you want a game with a story and progression it may be possible with procedural generation. i agree with saluk it probably wouldnt be good enough for interactive fiction... but maybe you could write a metroid or starfox with a procedural story.
I have heard many stories come out of minecraft. People will tell their experiences and the strange thing that happened which was actually a combination of the interesting random terrain, the hand-crafter monster behavior, and the games internal logic. None of this is a result of the designer trying to generate a story generator. I think the future of dynamic stories is out there, but it lies in a combination of these other types of ideas: strong gameworld physics, generated environments and inhabitants, and interesting behaviors; rather than trying to come in from the top and make some algorithm that can generate a story.

Starfox, for example, could simulate a war, with the outcomes of each battle having an effect on the overall scope of the war and the potential success by your side against andross. Other shooters I think have taken this approach, though I'm not sure how far they took it.

I guess a game like civilization is probably the best story generator I've seen.

It's harder to pull off in other types of games though. Metroid for example thrives on how well crafter the levels are with regard to upgrades. I mean the story barely matters at all, but what upgrade you get and when, and when you fight specific enemies, matters a lot. I think you could get close with a generator. For another contest I made a zelda style generator, with mountains needing climbing gear, rivers needing rafts, etc. But at best it just feelt like a potentially good zelda setup which has had all the parts jumbled up.

Look at yoda stories for a good example of that idea :)

Ultimately I think the answer lies in more internally consistent and function gameworlds where gameplay and story are literally the same thing.
I would say the main thing though is that with all of these games that are being described it is a randomly generated environment but the story is created entirely though the players actions and imagination this applys to virtually all of the procedurally generated games i have played, minecraft, DWARF FORTRESS and a bunch of others.
Procedurally generating landscapes is a whole lot different from generating NPC behaviour or plotlines or dialogue. Not that I'd be confident of doing any of them well.

An interesting facet of online games is that as a developer you have access to the behaviour of many human players. So maybe you could generate believable NPC interaction or plot development in one world from the human interactions in another.

Maybe it would be possible to set up some kind of 'human entropy' server based on, say a Jabber MUC. The interactions between people in a chat room who conform to certain personas could be used to prompt 'autonomous' activity by a NPC in a game world.
I think procedural content does allow you to significantly broaden the scope of the game with less work, but everything that you generate will be devoid of intelligence. For landscapes and textures that's fine, but if you want your game to have any kind of human element - the planning of settlements or conurbations through to political background - then the limitations will become apparent very quickly for the reasons saluk outlined - that unless there is a human writer, there can't be any interesting stories woven into the world.

For example, Transport Tycoon had procedural worlds with procedural place names but all of the places it generates are soulless. You don't think what it might be to live in "Micheldon" versus "Tambourne" because apart from the layout, they seem identical except perhaps in wealth. Procedural generation just works for Transport Tycoon, enough to give you challenges in moving things around, but those challenges are pretty generic. There are not that many news stories to indicate why prices are fluctutating; there's not much to indicate why one region wants lots of one type of goods, and another region doesn't, or why this is produced here and that is produced there, and so on. As long as the player doesn't think to ask those kinds of questions, you're OK.
I haven't played Transport Tycoon, but it sounds like it needs some randomization.

On the procedural story idea, there could be a large repository of story elements and the game randomly chooses how they fit together. Then the developers could add more story elements to the game, but the story would still be procedurally generated.

Another question: is procedurally generating a story similar to placing random dots in a game of Conway's Game Of Life?
PCG is a means to the end.

You *can* fake anything with a computer, as long as you tell it exactly what to do.

I"m just not sure if PCG is right for PyWeek. PyWeek doesn't have time to justify a really good PCG. You can write a story-telling generator in 3 days, or write a story in 1.
Agreed with comments by wisty and gcewing: procedural generation sounds attractive, but tweaking it just right can take an enormous amount of time you may not be able to afford to waste during pyweek. I know, as I've had projects that went tremendously out of scope during pyweek before that resulted in no game at all: one involved simulating the history of a world using cellular automata (you can call that procedural generation), and one involved evolving "steering behavior" for agents that needed to navigate a 2d landscape.

I gave a lightning talk about this last year at EuroPython:

https://blip.tv/europythonvideos/lt-martijn_faassen-_how_to_fail_at_pyweek-3999788

By no means let that discourage anyone from experimenting with stuff like this; it'll be a lot of fun and quite educational (I certainly had a *lot* of fun with those projects), but you may run into the same kind of trouble I did and produce no actual game. :)
@fassen: very interesting (and funny), it's a pity you didn't have more time to properly finish the talk.

Are the slides available?

Thanks for sharing!
Well, me not being able to finish it made it *more* funny, so that was good.

I've dumped my slides online here:

http://startifact.com/pyweekfail/pyweekfail.html
Actual clickable link:

http://startifact.com/pyweekfail/pyweekfail.html

Actual clickable link for the europython video:

https://blip.tv/europythonvideos/lt-martijn_faassen-_how_to_fail_at_pyweek-3999788
@faassen: Thanks!
I remember that lightning talk. It was teh AWESOME! :-)