Game Development Community

Dense, Lush Forest

by Jason Farmer · in Torque Game Engine · 02/22/2006 (3:04 am) · 15 replies

A few weeks ago, I had an idea for a new mission for my game... a forest where you can hide in the trees but can also destroy the trees and make fires.

So Last night I was playing around with the shape replicator trying to make a decent looking forest to see what sort of density I could get before the engine choked.

What I did was created 4 large shape replicators 1000x1000 with 800 trees each. 3200 trees. Each with a different shape taken from the Sharps tree resource www.matthewcjones.com/Downloads/Sharp_Trees.zip I used the oak trees BTW.

But I've found that I suffer a severe performance hit. Not supprising considering the number of trees I'm using.

So, what's the best way of making a Dense, Lush Forest?


I'm aware that Ben is working on a forest resource, which from the tech demo looks real nice, but just to satisfy my curiosity (and mental benchmarking of torque).

Is it best to use massive replicators with a lot of trees each or lots of replicators with much fewer trees?

Is there a better way?

#1
02/22/2006 (8:05 am)
Depending on the density of your forest, you could turn the view distance WAY down and turn fogging WAY up. Then you could set a trigger near any clearings to adjust the values accordingly.

I'm just thinking out loud. This is something that I'll be needing to try sometime here down the road as well.
#2
02/22/2006 (8:35 am)
Hmmm... I can see that working quite well in a FPS, but unfortunately, my game's got quite a distant overhead camera.. which means maximum polygons and minimum framerate if I get it wrong.

There would be tonnes of cool things I could do if it was a FPS, like use the starfield replicator (a resource) and use it for textured patchy fog to make it misty... could make it quite spooky.

My game's got an overhead camera, off at an angle.. similar to Tribal Trouble. So I get to see quite a lot of terrain.
#3
02/22/2006 (8:42 am)
Ah. Yeah, I was thinking of my project, which has a forest path in the third-person for my rail-shooter prototype. For you're overhead, that wouldn't be a solution. Hmmm... Pehaps using LOD to billboard the more distant trees.
#4
02/22/2006 (8:55 am)
Well, I plan to use a starfield replicator for cloud cover anyway.. should provide a nice patchy cloud for something to fly out of. Could be perhaps used to offer overhead foiliage.. not sure.

LOD Billboards might do the trick. I was impressed with the speed of Bens' Tech Demo for the forest pack. The trees he uses seem to be pretty well optimised. I don't know what sort of LOD support the Sharp tree pack has.. I've purchased it though so I should make the most of it.

any idea if multiple shape replicators would speed things up? A shape replicator behind the camera needn't be processed... Don't know if the engine does anything with the replicator once the level has loaded.
#5
02/22/2006 (9:08 am)
I don't know either. I haven't delved into shape replicators yet. In fact, I've rarely done anything with terrain itself. Most of my playing with TGE has been with interiors, paths, and cameras. That, and a liberal amount of playing in T2D since it was released.
#6
02/22/2006 (1:18 pm)
You can add an insane nuber of LODs to the trees.
On my trees, I use seven or eight LoD's. I have 180, 140, 120, 100, 80, 40, 20 and 4 polys. I can get rather large forests before the framerate runs down. It's funny watchign it on a dual-corprocessor. It's still laggy, but twice as fast!
#8
02/22/2006 (1:34 pm)
Starfield replicator

Do tell =)

I would be interisted in what that is.
#9
02/22/2006 (2:14 pm)
Just to add to this.

I was useing the replicator where I had lots of small islands in the water.
Each Isalnd I put a Replicator. The more replicators the Slower things went.

I Tried 1 Giant Replicator over all the islands together and it seem to speed
up the game play. Plus I could tweak the one easier than all the small ones.

This is just my own observation - It may not be the same in every case.


-Surge
#10
02/22/2006 (4:32 pm)
A starfield replicator is similar to a foilage replicator apart from that it's just billboards in space, not confined to a terrain as such.

www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4924

have a play ;-)

It's the closest thing I can find to being able to make weird Freespace2 nebulae fog effects.

disclaimer: +5 beer modifier
#11
02/22/2006 (4:33 pm)
Dirk, thanks for putting the link to Bens Tech demo, I forgot in all the excitement.
#12
02/23/2006 (11:45 pm)
Tried using just 1 replicator.. with about 1000 trees, with random scales, (Sharps MonkeyPod trees) I'm getting something similar to what I want. A dense lush forest with a nice detailed forest canopy. Just need some vines and monkey noises and it'll be spot on. :-)

Now I've got a different problem which I'll mention in this thread as others might want to try a similar thing.

I wanted to set up a layer of fog beneath the trees. This fog I wanted a dark colour. The main fog I want a bright colour so when you're above the trees, and as you emerge from the trees, it's nice and bright. But dark underneath.

So I set up a fog volume and set the colour (which is ignored BTW unless a special variable is set, even then, it only applies this volume fog colour to the terrain :-( unless this is a fix for 1.4 which my game is not using at the moment (too much work to bring it to 1.4) ) I would appreciate a fix for this.

I set up a foilage replicator and it's filling an area of 1000x1000 with about 90k billboards with 100units visibility and it's damn fast. Takes some time to load, but it's nice and lush. Feels very organic especially with them being animated and all.

I've got a problem with the scaled trees and the fog. I think the scaling is causing a problem with the (when to pop-up) calculation as there's a noticable popup instead of things smoothly blending into view. Anyone know about this?
#13
03/01/2006 (1:50 pm)
BLAST!

I wouldhave to recompile the engine to use the starfields....

/shucks!
#14
03/02/2006 (1:14 am)
Yeah, like most resources.. they involve a rebuild and some minor hacking.

You're working from a stock 1.4?
#15
03/15/2006 (8:06 am)
Yes, i am using 1.4