Framework for procedural content generation - ideas

SiWi

04-07-2007 13:45:16

A few people from the community had the idea to make a community made framework for procedural content generation. I think there are many people who would be interested in it and might want to help. So I want everyone to post his/her ideas for an procedural content generation framework in this thread.
Please post:
-Your ideas
-We don´t have to reinvent the wheel -> post existing solutions we could integrate
-Papers, websites and other information sources

Also I think we should make differnet topics:
-Basics about the framework
-Physics
-Animation
-Models
-Textures
-Sound
-Landscape/Terrain
-etc.

And should i list all ideas in the first post?

SiWi

04-07-2007 13:59:57

So i start with my ideas(posting ideas from another thread and other persons also)
1.Making animals and humans:
Spore
http://www.youtube.com/results?search_q ... dc&search= like
The animals should consist of bones
We should be able to define via functions how the body part around the bone is made. So only the bones would be connected and manipulated but the body around it would always be created around the bone with the same rules.
Also we could auto generate the convex hull of a animal, because simply every bone would get a primitive around it.
2.Textures:
There are already existing solutions, but i don´t remember the name.
3.Models:
Basically don´t save the product but save what an artist does and make rules with it.
4.Physics:
We should find a way to auto generate convex hulls.

bharling

04-07-2007 21:25:57

Yeah, this sounds quite cool :)

Heres some thoughts on your ideas:

1. I can see an effective way to do this, convex mesh generation is actually not that hard to do, you could set up bones so that they have skin radius and falloff options to define how fat the body is around the bone, and how that fatness interpolates to the next bone. You can make these adjustable with a gui (much the same way as spore). This part of character generation is not too much hard work. Theres no real need to use primitives, as ogre provides plenty of mesh generation features which can be easily used (see the bezier patch demo).

2. Textures - werkkzeug3 texture edition http://www.theprodukkt.com/ is great, but requires a license to use the procedural rendering dll. There is also mapzone 2.5 http://www.allegorithmic.com , again I think this requires a license to use the texture system in a project (however both of these allow you to use the bitmap output for free).

3. I kind of disagree here, a procedural modelling system should work in a parametric fashion eg: you never actually move or create a polygon manually, but rather you set parameters and run them through an algorithm which creates the result. If the algorithm is good enough, then it should be possible to create any type of model. Again, see werkkzeug1 for an example of a simple procedural modelling method. I think spore uses the basic principle of a spine to serve as a base for generating a mesh, again I think this is all done by assigning properties to bones, and letting the program create a mesh around it.

4. Well, generating a convex hull is again not too hard, a good space filling algorithm can be used to get a picture of the space a model occupies, which can then be filled with collision primitives. However, there is often no need to generate a complex collision mesh, in the arachnid walking paper I saw, they just attach collision spheres to the feet (to get a callback for foot placement), there was no other colllision used.

I really think the most challenging part of a procedural content kit is to produce an animation system. If you think of all the possible creatures that could be created, you would need a pretty clever bit of software to work out how a creature should move just from its bone structure and shape. That is certainly beyond my skillls at the moment, but there are papers floating around the web that give some useful clues.

there, thats my 2 cents :)

SiWi

08-07-2007 11:54:35

2./3.Tried .werkzeug. I think its the right way to do textures and models.
We should do something like this. So i agree with you that all meshes should be created with bones. But my problems with this are:
A. Are there any texture generation features?
B. Wher are those plenty much mesh generation features. It doesn´t seem that there are many in the MeshManager class where bezier patch is. If there are really so much features I think that would be a good point to start off.

4. I think for the beginning it would be ok if we use something like collision spheres like you use in the techdemo. Hopefully this feature in the techdemo will work sometimes. :)

Little_Bob

08-07-2007 19:47:09

this guy is working on procedural generation in his game and he seems somewhat generous (its in c++ though).

http://www.fl-tw.com/Infinity/

check the forum.

I dont know if he would tell too much since he is planning to make it commercial.

bharling

08-07-2007 22:35:58

ah yeah i remember seeing that game, it looks truly awesome, they've updated the site since last i looked. For planet scale procedural generation this has to be the best i've seen.

Yes indeed it would be nice to get this in the demo somehow :)

I think there are plenty of mesh manipulation / creation features in ogre, but they are a bit hard to use admittedly. I reckon we'd first have to start by making a custom api to the mesh creation tools (in python of course), to automate creation of hulls given a few inputs. There is some really good example code on the blender3d wiki in fact, which creates these kind of meshes through loops or recursion, I'm sure it could be adapted to generate ogre style vertex arrays. Alternatively, a starting point could be the block creatures you see in genetic algorithm demos, just start with primitives and link them in a chain with random scales and characteristics. That shouldn't be too hard using a predefined cube mesh and OgreNewt. Theres also several python neural net examples to generate behaviour.

thing i'm not too sure about is skinning manually through code, dont know how or even if you can assign bone weights to new vertexes in ogre, but i think i have seen it done in some demos.

For textures, I think some procedural-ness could be achieved in shaders. I've just added triplanar texturing to the techdemo for the landscape (another blatant rip-off from the showcase forum). This is procedural in the sense that it blits certain textures depending on the face normal. A variant of such a shader could skin a creature, or a shader could be generated at run-time with some parameters and texture inputs. I guess further down the line, you could incorporate some fractal / noise generation via an imaging module, but that kind of stuff is generally faster in C++.

what do u reckon?

SiWi

09-07-2007 19:19:20

You say we should adapt the examples. I personally could live with the idea of doing the model part in Blender. It would provide an powerful api exactly for this use and an gui. Of course i think we should first look at the mesh generation features of Ogre. We should eventually ask Sinbad & co. for them.
If there are enough features I think it wouldn´t be too hard to make an gui for it.

bharling

10-07-2007 09:22:55

Well, I have started sketching out a very simple framework for creating the block creatures (randomly). I've just based it on the sampleframework for now, will release it as soon as it works!

I'm designing the system very simply, but it should serve as a starting point for more.

on another note, anyone got a PS3? if so, and you want to program in python on it (using the full power of the Cell Broadband engine) Your dreams are answered with corePy, which is python for Cell processors ( OMFG .. )

www.corepy.com

bharling

11-07-2007 23:06:07

Aha!, here ya go then :)

very very simple random box creatures, trying to waddle around

download here and extract the 2 files into the demos/OgreNewt folder:

http://www.zerofilter.com/SimpleCreature_Leg.zip

it aint great, and is put together real quick, so please forgive :)
tested on win32 py2.5 only so far (rc2 of course)


heres a screemie

SiWi

12-07-2007 13:50:38

cool cool cool 8) . Wow, very good work, now make a convex shape around it and involve a human in the box creation process.
*Looking at your code*

bharling

12-07-2007 15:28:07

Cool, thankz!

As you can probably see from the code, the walking is a cheat really (all I am doing is applying forces to blocks randomly at regular intervals). I need to re-write that bit using the proper Newton force callbacks. And yes of course add some design elements in.

bharling

12-07-2007 17:52:36

Dammit, sorry forgot to mention, press 'R' to spawn a new creature

bharling

13-07-2007 17:23:53

Update:

http://www.zerofilter.com/SimpleCreature_Leg.zip

This version has the concept of legs, and therefore a more natural looking walking gait. Its still essentially cheating ( the feet drag the body forward when they move forward, instead of properly 'stepping' on the surface ) but the walking does look more natural. Also, made the creature configuration a bit more random, so you end up with some more variation.

BEWARE: some creatures have far too many limbs and can make the framerate drop drastically!, pressing R will generate a new one if you see the FPS start to drop (occasionally it causes a crash instead, sorry!).

bharling

21-07-2007 10:12:27

I've updated the little creature test with some new features :)

- Changed walking action to use OgreNewt callbacks instead using setVelocity(), seems more stable. started working on a spine motion (cant see it yet)

- Added an ease factor to the camera for smoother movement

- Added beginnings of gui (can select 'bones', clicking them causes them to go mental :cry: )

http://www.zerofilter.com/SimpleCreature.zip

Keys are:
'R' spawn a new creature
'K' toggle walking
ARROWS move
right-shift or right mouse button to rotate camera

finally you gotta unzip both files to demos/OgreNewt

futnuh

24-07-2007 07:43:28

If - this specific project aside - you are interested in procedural content generation, have you looked at Sidefx Houdini? Free for non-commercial use, and the beta in circulation adds python scripting. As soon as it stabilizes, I'll be releasing a version 9 update to the HoudiniOgre exporter.