Game Development Community

Forest Pack Q&A

by Kyle Carter · in Torque Game Engine · 10/27/2007 (1:50 am) · 196 replies

In followup to my blog post, please post any questions about the Forest Pack release here.
#81
11/19/2007 (1:43 pm)
You've done great with this Ben. The car bounces off the trees nicely. Not too much penetration there. (nothing outside normal for the car that is)

My race game screenshot

I'm loving this resource more than any of the others I've applied. :)
Thankyou.
#82
11/20/2007 (1:14 pm)
Hey guys,

joining late the party, but I don't get it working without strange rendering effects. I assembled a quick

Quicktime Movie

The trees appear only at the direct front of the camera and medium and far trees don't appear at all. Furthermore, as it could be seen in the video at the very end, the tree color change to a washed out greenish color.

What I did:
- Put in the source changes as described by Ben. Moved all the "forest" files into the game/engine/fx folder. Move the dgl files into the dgl folder
- Fresh compile
- Followed the docs on TDN and used oak1.dts as tree.

I'm using a Mac with latest Leopard.

Has anyone a clue what this might be?
#83
11/20/2007 (1:19 pm)
Oh forgot:

This is my forest object (straight copied):

new Forest(newForest) {
      canSaveDynamicFields = "1";
      position = "0 0 0";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      randomSeed = "100";
      forestCount = "0";
      treeDistance = "1";
      minOcclusionLevel = "3";
      maxOcclusionLevel = "5";
      singleBlock = "0";
   };

This is my newForest.cs placed in the common folder:

new ForestItemData(Tree1)
{
   collidable    = true;
   groundAligned = false;
   maxItems      = 3;
   radius        = 1.00;
   minScaleFactor= 0.8;
   maxScaleFactor= 1.5;
   shapeFile     = "game/data/shapes/trees/oak1.dts";
   centered      = false;
   disableBillboardLighting = false;
};

new ForestItemData(Tree2)
{
   collidable    = true;
   groundAligned = false;
   maxItems      = 6;
   radius        = 2.00;
   minScaleFactor= 0.8;
   maxScaleFactor= 1.5;
   shapeFile     = "game/data/shapes/trees/ftree01_bb.dts";
   centered      = false;
   disableBillboardLighting = false;
};

function newForest::onAdd(%this) 
{ 
   %this.addForestEntry("Tree1", "game/data/terrains/highplains/grass", 15, 5);
   //%this.addForestEntry("Tree2", "game/data/terrains/highplains/grass", 15, 5);
}
#84
11/20/2007 (3:16 pm)
Hmm - looks like the view frustum isn't being calculated correctly. Have you put any resources in that might affect that information?

You can find the code where it grabs the info from the scene graph on line 369. You might compare to other places in the engine and see if the values are the same there. Does this happen for you in stock Torque?
#85
11/20/2007 (4:33 pm)
What Martin is seeing is pretty much what I see, eccept I have what appears to be static trees in the background where he doesn't.

Here is a short wmv vid of what I see
#86
11/20/2007 (6:32 pm)
Hmm - Mike, it looks like you might have some bad LOD transitions, but that it's trying to draw trees everywhere it needs to be. Martin seems to be experience the same as you, as well as trees not showing when they should.

Looks like the billboard rendering might be borked, too. Something to look at this weekend, I guess!

Thanks for taking the time document your problems, guys. It's really helpful.
#87
11/20/2007 (7:16 pm)
You are quite welcome. :)
#88
11/20/2007 (9:31 pm)
I'm seeing a couple of interesting things, not sure if they have been mentioned before. I'm using the latest code downloaded from TDN with the Mac build of TGE.

First, I'm seeing some interesting lighting issues. The first image shows a scene with one of our custom trees, showing LOD with billboards at farther distances:

homepage.mac.com/rubes/forest/screenshot1.jpg
In the same scene, turning slightly to the side causes the lighting on all trees to change:

homepage.mac.com/rubes/forest/screenshot2.jpg
Another interesting thing we're seeing is shown below, in a close-up of two trees. These are the same model. Note the trunks at the tops of the trees are bare:

homepage.mac.com/rubes/forest/screenshot3.jpg
Here is how the model looks in ShowTool, which is how it should appear. Note the branches going all the way to the top of the trunk:

homepage.mac.com/rubes/forest/showtoolScreenie.jpg
Although the tree has LOD, it should not be removing branches from the top of the tree. Anyone else seeing anything like this?
#89
11/20/2007 (10:06 pm)
I've experimented with lots of different trees and seen odd results on a per tree basis: some are good and some are bad.

I haven't tried the new code yet but one of the fog changes posted way up above caused flickering lighting for me. EDIT: works great this time around.
#90
11/21/2007 (12:36 am)
@Mike Rubin: I experienced that "lightning" change on the trees to when turning slightly. To me it seems like it depends on the angle to the sun direction, but it's just my first impression.

@Ben: I didn't modify anything regarding the view frustrum. But I'll try tonight on a fresh TGE 1.5.2 build the same and test the same build on Windows too to see if it is a Mac related problem. Just installed boot camp this morning. If the effect is the same with a fresh build, I'll zip you the whole project and make it available for you to download if that helps.

@Mike Rowley: Yes, the effect very much looks like your one with that special tree. As seen in your video, the other tree type is not affected by this. I did a test too with 2 tree types and I had the same effect as you, one tree was popping up only at the front of the camera and the other tree was visible also at larger distances.

Possibly it has to do with the LOD setting of the indivual tree DTS shapes maybe. It's just that this effect changes whether you use different trees or not. I tested that with Tim Aste's combo pack trees and get different "effects", means different distance popping effects for the trees.
#91
11/21/2007 (11:30 am)
I've noticed a marginal improvement in framerates in this newer release. Lighting has improved but I am still getting illuminated trees in zero light conditions, but they are not fully lit and washed out like before -- good job Ben!
#92
11/21/2007 (2:33 pm)
@Martin & Mike,

The tree effect is definitely related to LOD. I took a tree I'd made with a couple of LODs and it popped into view as I drew near. Took the same model, exported it out with a single mesh/LOD and they started out visible at a distance. Now of course I have no clue as to what the solution would be.

Regarding lighting effect on the trees, this is related to fog somehow. I've noticed that if I change the color of the fog, the trees follow suit. I can darken the fog so the trees basically look ok, but they end up a little on the dark side. I still see some slight "strobing" on the trees also, but that could be more related to this build also having the MK integrated also -- yeah, I'm a glutton for punishment.

- Alan
#93
11/21/2007 (5:35 pm)
After further experimentation I've found that some trees will "flicker" and some display fine. Messing around with the fog seems to fix this in some cases. The viewing distance problem is LOD related but doesn't seem to be consistent either.
#94
11/22/2007 (9:25 am)
I've been getting a lighting anomoly since the last update but couldn't reproduce it to capture a pic.
I added the forest pack to my game that has 5 levels, and have noticed that after I play thru 3 levels, the lighting goes all wonkey. I turns the trees stark white, and doubles the brightness of the ground depending on the direction you are looking. It may be the same problem noticed above that has to do with the suns position. I don't know tho.
Here is a short video showing the ground
Anyone have any ideas?
#95
11/22/2007 (11:57 am)
@Ben:

I just took a fresh TGE 1.5.2 Mac version and added the forest pack. Result is the same as in my Subsonic version, trees are popping up in the front. I made a little video (Quicktime). Ben, if you need it for testing, I could zip the whole project for you and put it on my webserver to download it.

Going now to test the same under Windows to see if the effect is the same.
#96
11/22/2007 (12:33 pm)
Ok, tested the same source tree in Windows on the same machine. Result: Same as on Mac - so it is not an OS related issue. At least that we know now. :-)

Here's the video I made on Windows.
#97
11/22/2007 (12:56 pm)
@Mike Rowley,

Just for kicks, take that same level in the video, open the editor (f11) and run around, I've got a level that does the same thing, but not when the editor is open. I'm searching right now for a full screen filter that is kicked off when you're in the editor since I've run into something similar in the past with lighting.

examples:

With the editor ON

www.reallyreallygoodthings.com/screens4/editor.jpg

With the editor OFF

www.reallyreallygoodthings.com/screens4/editorOFF.jpg
#98
11/22/2007 (3:14 pm)
Uhm, reverting the effect, IE having the trees fading out when going forward and not where going back would be nice in some case... I remember some game (maybe Dungeon Siege???) used a similar behaviour to avoid collision with trees and have the trees fading out when in proximity...

;)
#99
11/22/2007 (4:56 pm)
@Alen James
It's the same with the editor on or off, in 3rd person, first, or flying.
#100
11/22/2007 (6:57 pm)
OK, it's stumped me, here is what I get, (but only in some missions!):

www.reallyreallygoodthings.com/screens4/lightDARK.mpg

Other missions there is no difference between the editor and the level it works fine. Hmmmm....