by date
Crowds and forests
Crowds and forests
| Name: | Duncan Gray | ![]() |
|---|---|---|
| Date Posted: | Apr 25, 2007 | |
| Rating: | Not Rated | |
| Public: | NO | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for Duncan Gray |
Blog post
I had an idea a year or so ago about how to do live crowds for use in a game. That was back when I was doing Wheelracer, but the amount of work involved was too much for me but I'm still convinced it's a really worth while task. At the time I was also doing work on the Shadow resource which used a render to texture method to get really nice shadows. I realised that the same concept could be used for crowds etc.
It could even be used for trees and forests which can can animate in the wind. I am aware that there is a forest pack available, but I don't know how it work or if it can do animated trees and crowds or just plain static objects.
So here is the concept. Its based on using Frame Buffer Objects to do a render to texture of a person or a tree etc. The drawing below shows a top view of a scene, divided into 5 segments.

The camera position would be the player position in the game and you would need to render your crowd character or tree from the 5 different angles required by each of the segments. The texture created from the render would then be used as a billboard which can be placed by a modified version of code such as the foliage replicator. Those billboards would be placed only in the segments for which they were rendered.
Using the 5 different angles will make it much more realistic than just using billboards based on a single render. Doing a render from the camera position also sorts out issues of being above or below the person/crowd or tree/forest. Each player will see things as he would expect to see them from his position.
The people or trees that are really close to the player will be rendered in shapebase form, i.e, not a billboard. The billboards will only be used from, perhaps, 10 meters distance from the player.
And finally, because its rendered on a frame by frame basis, it can be used for animated people or trees. Just think, and entire forest based on just 5 actual renders of trees. Or a crowd of 500 people based on perhaps only 10 characters in various animations.
Maybe I'll get round to trying it some day.
It could even be used for trees and forests which can can animate in the wind. I am aware that there is a forest pack available, but I don't know how it work or if it can do animated trees and crowds or just plain static objects.
So here is the concept. Its based on using Frame Buffer Objects to do a render to texture of a person or a tree etc. The drawing below shows a top view of a scene, divided into 5 segments.

The camera position would be the player position in the game and you would need to render your crowd character or tree from the 5 different angles required by each of the segments. The texture created from the render would then be used as a billboard which can be placed by a modified version of code such as the foliage replicator. Those billboards would be placed only in the segments for which they were rendered.
Using the 5 different angles will make it much more realistic than just using billboards based on a single render. Doing a render from the camera position also sorts out issues of being above or below the person/crowd or tree/forest. Each player will see things as he would expect to see them from his position.
The people or trees that are really close to the player will be rendered in shapebase form, i.e, not a billboard. The billboards will only be used from, perhaps, 10 meters distance from the player.
And finally, because its rendered on a frame by frame basis, it can be used for animated people or trees. Just think, and entire forest based on just 5 actual renders of trees. Or a crowd of 500 people based on perhaps only 10 characters in various animations.
Maybe I'll get round to trying it some day.
Recent Blog Posts
| List: | 09/04/08 - Combat Starter Kit code changes explained 04/25/07 - Crowds and forests |
|---|
Submit your own resources!| Orion Elenzil (Apr 25, 2007 at 16:43 GMT) |
it seems like a slam-dunk for trees,
but i'm not so sure on crowd scenes.
for one thing, if you have two characters who are identical except one is facing north and one is facing east, you'll need to render the five frames for each of them. ditto differences in animation sequence. (as you pointed out)
also people have more variation than trees, so i'm just not sure the eye would be convinced.
but very interesting idea and i'd love to see some exploration of it!
| Jeff Loveless (Apr 25, 2007 at 18:34 GMT) |
Keep us posted!
Edit:as far as 'crowds' and variation take a look at my clustering resource i added to foliage replicator and if you look at the code you'll see you could increase it from only using 4 different textures to whatever you'd like by changing one value in the code, you could have 20 different people in the 'crowd'
Edited on Apr 25, 2007 18:38 GMT
| Duncan Gray (Apr 25, 2007 at 23:20 GMT) |
If the people are all sitting/standing on a grand-stand you may have to render a few people from each row to get the vertical angle correct, but for people just lining the road-side, they are all on the same level, facing the same direction which should make it a fairly simple matter.
@Jeff, I will have a look through the resource you mention.
| Orion Elenzil (Apr 25, 2007 at 23:38 GMT) |
heh. this is *perfect* for seated crowds of people in uniform !
this is an awesome idea in general. i hope you get the time to explore it.
| Duncan Gray (Apr 25, 2007 at 23:55 GMT) |
But thanks for the support. If I do a game that can REALLY benefit from crowds or forests (herds of animals?) etc then I might have the necessary motivation to do this.
| Jeff Loveless (Apr 26, 2007 at 04:05 GMT) |
| J Sears (Apr 27, 2007 at 20:45 GMT) |
You must be a member and be logged in to either append comments or rate this resource.



Not Rated


