Notgames Forum
November 24, 2024, 05:13:30 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Calendar Login Register  
Pages: [1] 2
  Print  
Author Topic: Ideas for procedural growth?  (Read 45719 times)
Michaël Samyn

Posts: 2042



View Profile WWW
« on: May 04, 2010, 08:31:52 AM »

I want to create a world in which things grow. Imagine a garden gone wild. Plants and small animals. Though it doesn't necessarily need to be realistic. I'm more interested in the dynamics of growth and life than in a literal representation. I want to do this in 3D because I want the camera to travel through this "garden".

Does anyone have any suggestions as to how to approach this technically?
Or references? Visual or text.
My main concern is performance. I really would like the thing to get quite baroque. But any scenario I can think of would be a disaster for framerate, as the garden gets big.

Maybe I need to find a way to trick the eye into thinking that there's lots of things in the scene. But how?
In 2D, I think, effects of dynamic growth or often achieved by not clearing the screen. Maybe there's a way to do something similar in 3D?

By the way, I do not necessarily need to represent the actual growing animation on screen. It's ok to have static steps of ever increasing complexity.

(I'm prototyping in Unity3D)
Logged
Nate Kling

Posts: 8



View Profile WWW
« Reply #1 on: May 05, 2010, 05:41:02 AM »

I was actually thinking of doing some similar experiments soon.  I guess one option would be to decrease the triangle count on the models as the camera gets further away.  Another option could be to make 2d versions of the 3d meshs and as the camera gets further away switch to the 2d version in place of the 3d mesh.  The camera would probably have to be pretty far away for that to work though, and I could see other visual issues arising from that.  Maybe those solutions are pretty obvious though haha. Undecided
Logged
WarHampster

Posts: 14



View Profile
« Reply #2 on: May 05, 2010, 07:02:16 AM »

Procedural 3D always makes me think of voxels, look here to see why.
Logged

From each according to his abilities, to each according to his needs. - Karl Marx
Michaël Samyn

Posts: 2042



View Profile WWW
« Reply #3 on: May 05, 2010, 12:14:20 PM »

Voxels are great. I like that 3D shapes can be "full" when created with voxels. I dislike the empty hulls of polygonal models.
(though I do like the smoothness that can be achieved with a combination of polygons and shaders; I'm not a fan of blocky voxels)

But there's not many realtime engines that support them. And simulating voxels with polygons sounds very expensive.
Logged
Michaël Samyn

Posts: 2042



View Profile WWW
« Reply #4 on: May 05, 2010, 12:16:31 PM »

I guess one option would be to decrease the triangle count on the models as the camera gets further away.  Another option could be to make 2d versions of the 3d meshs and as the camera gets further away switch to the 2d version in place of the 3d mesh.

Level of Detail is definitely an option. I'm even considering using only 2D billboards instead of objects. A bit like static particle systems.
I want to be able to potentially draw thousands of objects.
(in this game, the player creates the environment by adding more and more elements to it; so in theory, the complexity is endless)
Logged
Michaël Samyn

Posts: 2042



View Profile WWW
« Reply #5 on: May 05, 2010, 12:38:45 PM »

Voxels are like 3D pixels, right? Meaning that they are simply points in space. The fact that they are rendered as cubes or squares is mere convention and/or defined by the output medium. I find the idea of storing shapes as collections of points in space appealing. Then you could choose what you want to render at these points: a cube or a flower or an animated head! Smiley

If these collections of points need to be animated as if they formed a single structure, they might need to be ordered hierarchically. That would make it a lot less simple.
Another thing that's missing from a definition as point is a direction. Direction can be important when representing living organisms.
Logged
WarHampster

Posts: 14



View Profile
« Reply #6 on: May 05, 2010, 06:53:00 PM »

Right, voxels are "volume pixels," they're essentially same as 2d pixels but with a 'z' coordinate. Are you suggesting rendering voxels as polygon models? That's certainly possible, but the point of using voxels is to be able to render everything based on its voxel constituents.

The limitations you mentioned are why voxels are typically used for terrain and little else, ordering and animating objects made of many tiny elements is complicated.
Logged

From each according to his abilities, to each according to his needs. - Karl Marx
Michaël Samyn

Posts: 2042



View Profile WWW
« Reply #7 on: May 05, 2010, 10:53:11 PM »

I'm liking the idea of a more freeform dot-based 3D rendering style. With voxels rendered as spheres, not cubes. And where the arrangement of colours defines the picture, not the shape. A bit like impressionism, I guess. But I'm probably dreaming and this only leads to impossible technology.

In the mean time, I have learned that one of the things that makes the rendering of scenes with many 3D (polygon) objects slow is that a draw call needs to be made for each object. The trick around this is to group the objects together in one mesh (through a script) and then send only big chunks of geometry to the graphics hardware. The requirement for performance improvement is that all meshes share the same material (shader + texture). Otherwise they get split up anyway.
Logged
Jorge

Posts: 20


View Profile
« Reply #8 on: May 06, 2010, 02:50:04 PM »

Michaël, I HIGHLY and wholeheartedly recommend you to give a look to this anime: http://www.youtube.com/watch?v=HzV2wChxzH0 . It is called Mushishi. Also, I think it would be also very interesting to you if you check out some Studio Ghibli films like Mononoke Hime (although I think you have already watched this, seeing the similarity it has with The Endless Forest) and Nausicaä of the Valley of the Wind.

Japanese representations of nature are soooo incredible.

EDIT: I didn't see you wanted a technical approach to the theme.
« Last Edit: May 06, 2010, 02:53:25 PM by Jorge » Logged
Michaël Samyn

Posts: 2042



View Profile WWW
« Reply #9 on: May 06, 2010, 04:19:38 PM »

Inspiration is good too. Smiley

But indeed, I'm trying to figure out some of the technology to guide decisions on art style. I don't want to represent nature at all. "Garden" is just a metaphor because it's a place where things grow. It might end up looking like a landscape. It might not. Doesn't matter.
Logged
God at play

Posts: 490



View Profile WWW
« Reply #10 on: May 08, 2010, 06:54:00 PM »

If you want a lot of objects, I'd suggest you create them as 2D shapes.  You can still use 3D models, but the idea is that the poly count would be really low, which suggests 2D shapes.

If your "plants" are set up as a set of simple geometric pieces, you could just scale up the pieces at different times to suggest growth.  Here's an example I made where the plants follow a Game of Life simulation: http://www.torncanvas.com/torncanvas_ver1-04.swf They're made up of skinny triangles and teardrop shapes.

With procedural growth, you could set up different points on the plants where something might grow, and then based on your rules you could grow that part or not grow it.
Logged

Michaël Samyn

Posts: 2042



View Profile WWW
« Reply #11 on: May 11, 2010, 08:26:59 AM »

2D Shapes do indeed have few polygons. But apparently, these days, polygon count is not such a big deal anymore. It's a lot slower to send 1000 separate 1 polygon objects to the graphics card that a single object made up of 1000 or even 2000 or 3000 polygons! The only requirement is that the all these polygons use the same material.
And Unity can apparently group objects together through scripting!
So multiplication seems to be covered. Smiley
Logged
Michaël Samyn

Posts: 2042



View Profile WWW
« Reply #12 on: May 11, 2010, 08:30:32 AM »

The next problem is that I need to store all this growth so that the player can save and close the game and reload it to continue playing. Since we're talking about pseudo-living things, I don't think everything needs to be stored. But still, the "garden" needs to be the same when they come back to play. So I'll have to store and load the coordinates and properties of all those thousands and thousands objects? Sounds like that could get very slow (and complicated)...
Logged
Kjell

Posts: 129


View Profile
« Reply #13 on: May 11, 2010, 02:52:10 PM »

Quote
It's a lot slower to send 1000 separate 1 polygon objects to the graphics card that a single object made up of 1000 or even 2000 or 3000 polygons!

It depends ( I won't go into detail here ). Under normal circumstances the main performance difference is caused by VBOs, which enables you to store data on the GPU for non-Immediate rendering. However, most engines re-upload the entire mesh as soon as any changes have been made ( which might be applicable for a "growing" environment ), thus losing the performance gain again.

Anyway, the trick is to come up with a algorithm that generates all required variables from only a few parameters ( type, generation etc. + a random seed ). To speed things up you could build lookup-tables for the algorithm ( ex random ) at a reasonable resolution & range, and interpolate between those values.
Logged
Kjell

Posts: 129


View Profile
« Reply #14 on: May 11, 2010, 03:10:11 PM »

And the volumetric benefit of Voxels only exists in your head Wink In fact, polygons with 3D textures ( or SSS ) are much more versatile.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!