Skip to main content
gamedev.net
🔒 Locked

Run-Time Generated Models

Started by Mike.Popoloski Oct 27, 2005 at 3:38 PM 8 replies 1.6k views
Original Post
Mike.Popoloski
Mike.Popoloski
I'm currently working on a game that has the game universe generated at runt time. In order for the game to seem truly huge, it would be great if I could somehow generate the models at run time. Is there any way that this could be done without it looking like crap? Are there any algorithms out there?
Mike Popoloski | Journal | SlimDX
Emmanuel Deloget
Emmanuel Deloget
These are on the top of my head (and in my bookmark [wink])

What kind of model do you want to generate? If you want to generate planet bodies and such kind of things, I suggest you to read Sean O'Neil's | articles on | gamasutra.com (3 articles, free registration needed) and on his personnal site. He is also a member of gamedev.

The journal of Ysaneya is also a great resource about this subject.

If your world is more a diablo-like (ie if you want to generate your maps and so on) I suggest you to have a look to Vertex Normal gamedev site (this is one of our moderator here :). Here is more info about the modeling of cities - and here is Another PDF on this subject. vterrain.org is a great source of resource about terrain generation - it also has numerous sections about a lot of interresting subject. The whole text of The Algorithmic Beauty of Plants book is now online (go to the publication section, and scroll to the end of the page. The other papers in this section might also be of interest). This flipcode article and this one present some methods to generate your terrain textures. World Machine is a non-free (there is a limited freeware version) powerful procedural terrain creator - it can be a great source of inspiration. Terragen is another (free) terrain creator software.

If you want to know more about the well known perlin noise() function, just go to Ken Perlin's web. libnoise is an open source implementation of various noise() functions.

Google keywords to find what you search are: procedural, noise, modeling, terrain synthesis, terrain texture, and a bunch of others ;)

If anyone wants to add more... :)

HTH,
coderx75
coderx75
Here's a PDF describing algorithms to generate entire cities. It goes into some detail about generating roadmaps, buildings, etc. The end result looks pretty realistic.
Quit screwin' around! - Brock Samson
Mike.Popoloski
Mike.Popoloski
Wow! Thanks for all the info. These will be a big help, but one of my main interests is generating something like a spaceship in real time. Is this possible? The cities and spheres are much simpler than a spaceship.
Mike Popoloski | Journal | SlimDX
swiftcoder
swiftcoder
Quote:
Original post by ussnewjersey4
one of my main interests is generating something like a spaceship in real time. Is this possible? The cities and spheres are much simpler than a spaceship

Real time is not a huge concern, you can always generate them in the background just before you need them. As for being possiblle, well, anything is possible...
You could do something like generating space ships by mix-n-matching prebuilt components (engine modules, wings, hulls, cockpits, etc.), but actually generating spaceships from scratch, I think it would be hard to give the computer any idea of where to start.
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
mldaalder
mldaalder
I suppose you can do it something like this:
You fly to (pseudo)randomly generated planet X, with random species Y which use spaceship style Z.

Then Z would be a pick from several styles, but with diffrent colours and such.
taby
taby
You could develop a shape encoding system which would describe a list of pre-made volumes that you can combine to make a single volume.

From there you can use a genetic algorithm to alter and merge object shape lists.

Additionally, a small scale skin overlay can be added into the final surface. This is for smaller scale effects like bone protrusion, veins, scales, tin plates. Whatever your creature is made out of. Generally it's a bitmap image with a normal map built into it for bump or displacement mapping.
tomhog
tomhog
A good technique is CSG (constructive solid geometry) its the process of creating object by combining other objects in a particular order, with a particular function. If your familiar with 3d studio max, it is how the boolean function works.
Basically a BSP tree is generated for each object and used to determine which parts of an object are overlapping. These overlapping and non overlapping sections of the objects are then combined however you desire to create a new object. Easier said then done though. This would allow for varyations in spaceships, but not the creation of a spaceship from nothing.
Gamasutra has some info, also try google scholar, for good documentation. Im currently looking into something similar, and would love to see what you achive.

Thomas Hogarth
Mike.Popoloski
Mike.Popoloski
Once again, thanks for the replies. The prebuilt idea was one I was thinking about today. After the intial the ship was built a texture could be generated, maybe with something like photoshop filters, such as making a cloud, then adding noise, then adding color, etc.

I was thinking of something like a utility program that would generate a ship that I could do some tweaking, then the computer would note the changes I made and give them a higher percentage weighting when designing the next ship. This would be sort of like "training" the computer, and the more times you did this the better they would be.

As I see it, there would be two main reasons for doing this: 1) because you wanted tons of different ships, and 2) because you didn't have time to do them by hand. ( Both of which are part of my case ).
Mike Popoloski | Journal | SlimDX
superpig
superpig
Sounds like you may want to look into neural nets - they're all about this 'training' sort of behaviour you mention. You give 'em a set of input values, and they give you a set of output values; by choosing your desired inputs/outputs beforehand, you can 'train' the net to give you those outputs upon those inputs; if you train it for long enough, you can start giving it inputs it has not seen before, and it will 'guess' at the answer for you. It's an AI topic; you may find more information here, here, or here.

Another thing you may want to look into is genetic algorithms. With genetic algorithms, you'd start out with a set of ships (possibly artist-built, possibly just randomly generated), and 'cross-breed' them. Then you'd establish some kind of scoring function to say how 'good' the resulting ship is - aesthetically, functionally, performance-wise, etc. The ones that score well get to 'breed' again; the ones that score badly are discarded. NickGeorgia wrote an excellent introduction to the subject in his journal.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.