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.
#142
I hope you're able to resolve this, since I imagine it is probably related to my problem posted up a ways - posted on Nov 25, 2007 02:01. Whenever I had just about any .DIF come into view I had a substantial framerate drop.
04/16/2008 (8:55 pm)
@Tony,I hope you're able to resolve this, since I imagine it is probably related to my problem posted up a ways - posted on Nov 25, 2007 02:01. Whenever I had just about any .DIF come into view I had a substantial framerate drop.
#143
04/16/2008 (8:57 pm)
Well, the important part is that I am now able to duplicate the problem... it's only a matter of time before I solve it.
#144
I for one am not going to think less about you, I'm just glad someone who understands this better than I do is working to fix the Forest pack's bugs. I never noticed the problems with .dif as I've been using polysoup just so I can have destructible buildings.
Extra special thanks go out to Ben for releasing the forest pack and the polysoup code to begin with. Both of which are a big part of my hobby/project.
04/16/2008 (9:56 pm)
@Tony: Best of luck man! I for one am not going to think less about you, I'm just glad someone who understands this better than I do is working to fix the Forest pack's bugs. I never noticed the problems with .dif as I've been using polysoup just so I can have destructible buildings.
Extra special thanks go out to Ben for releasing the forest pack and the polysoup code to begin with. Both of which are a big part of my hobby/project.
#145
I grabbed the last version off the tdn - dated June 1, 2008.
but I still see the lighting problem with my trees - namely they arent getting lit.
I Applied Karen's fix listed above (add LightManager::sgResetExposureRendering(); ) - and that seems to work except the trees are overly bright.
however getting trees to show up on textures that were hand painted onto the terrain doesnt work for me. textures that were generated by the terrain texture editor work just fine.
are there updates in progress? or did I grab the wrong version?
06/01/2008 (2:40 pm)
Great looking pack here.I grabbed the last version off the tdn - dated June 1, 2008.
but I still see the lighting problem with my trees - namely they arent getting lit.
I Applied Karen's fix listed above (add LightManager::sgResetExposureRendering(); ) - and that seems to work except the trees are overly bright.
however getting trees to show up on textures that were hand painted onto the terrain doesnt work for me. textures that were generated by the terrain texture editor work just fine.
are there updates in progress? or did I grab the wrong version?
#146
06/01/2008 (3:26 pm)
There is only one version, so you downloaded the right one. Someone was working on the lighting and placing issues, but haven't heard anything in quite a while.
#147
That will solve the bulk of the problems that I have encountered (other than a really nasty .dif bug that I have not been able to knock out.)
I haven't looked into hand-painted terrains though... not sure why that would make a difference, though.
06/01/2008 (5:27 pm)
Did you try my patches that I posted? There are two of them.That will solve the bulk of the problems that I have encountered (other than a really nasty .dif bug that I have not been able to knock out.)
I haven't looked into hand-painted terrains though... not sure why that would make a difference, though.
#148
I Tried just working my way down the thread to add fixes but they did not make sense.
I went and got a version dated back in march - and that fixed that terrain painting problems, but all the trees were un-lit.
I guess if I follow the patches on this thread -- its all supposed to work?
Edit:
I went and added in all the patches listed above but I ran into some problems:
does this mean remove the ENITRE contents of the ::initMaterials method and replace it with the one line?
Or add the ::initMaterials at the beginning? or end?
Im guessing none of the above because no matter which of the 3 options I try, TGE crashes when trying to load a mission. So I ended up skipping that change.
end result:
- painted on textures work fine.
- leaves in the trees are still black
- trunks will render textured or grey.
- detial textures on the terrain itself looks "wierd"
So I backed out all the above changes. Then put in the change to fix painted textures and added Karen's Lighting fix and left it at that.
But despite all my problems it will save me HUGE amounts of time placing trees in my missions.
Keep up the good work!
06/01/2008 (5:30 pm)
Well the patches seemed to conflict with each other...I Tried just working my way down the thread to add fixes but they did not make sense.
I went and got a version dated back in march - and that fixed that terrain painting problems, but all the trees were un-lit.
I guess if I follow the patches on this thread -- its all supposed to work?
Edit:
I went and added in all the patches listed above but I ran into some problems:
Quote:
Change Forest::initMaterials() to look like this:
void Forest::initMaterials() { TSMesh::initMaterials(); }
does this mean remove the ENITRE contents of the ::initMaterials method and replace it with the one line?
Or add the ::initMaterials at the beginning? or end?
Im guessing none of the above because no matter which of the 3 options I try, TGE crashes when trying to load a mission. So I ended up skipping that change.
end result:
- painted on textures work fine.
- leaves in the trees are still black
- trunks will render textured or grey.
- detial textures on the terrain itself looks "wierd"
So I backed out all the above changes. Then put in the change to fix painted textures and added Karen's Lighting fix and left it at that.
But despite all my problems it will save me HUGE amounts of time placing trees in my missions.
Keep up the good work!
#149
08/15/2008 (6:45 pm)
Forest::createForest - Forest count is zero. To save on memory hits, you should set it to the number of items this forest generates.??????????
#150
08/16/2008 (12:02 am)
Because so many allocations are required for trees, if you tell the forest ahead of time how many there will be, it can do it all at once and save literally minutes (in my tests) of copying data.
#151
08/16/2008 (12:04 am)
So how would I do that?
#152
You could also do a find in files for the log message and see what field it's checking.
The docs should also explain the process.
08/16/2008 (12:09 am)
There are other console log lines that indicate the value you should use. I believe the field is named forestCount. Take a peek at consoleInit or the mission editor.You could also do a find in files for the log message and see what field it's checking.
The docs should also explain the process.
#153
I changed the forestCount in the "new Forest(newForest) {" in the .mis and I still got no trees. Thats what I found in the console.log. Could it be the .dts I'm using?
08/16/2008 (12:33 am)
Compiling newforest.cs... CreateShapeInstances in 0.00 seconds. ---- End createForest: RandomSeed: 100 Forest Array Size: 4324 Num ForestItems: 0 Number of ShapeInstances: 0 Forest Created in 0.08 seconds. Compiling newforest.cs... CreateShapeInstances in 0.00 seconds. Forest::createForest - Forest count is zero. To save on memory hits, you should set it to the number of items this forest generates. ---- End createForest: RandomSeed: 100 Forest Array Size: 0 Num ForestItems: 0 Number of ShapeInstances: 0 Forest Created in 0.06 seconds.
I changed the forestCount in the "new Forest(newForest) {" in the .mis and I still got no trees. Thats what I found in the console.log. Could it be the .dts I'm using?
#154
You may need to:
1) verify that your newforest.cs has the correct pathname for the shapes
2) make sure that the function newForest::onAdd() is pointed to the correct ForestItemData and appropriate terrain texture pathnames
3) make sure that the mission you are loading is using those textures.
08/16/2008 (12:57 am)
It looks like your forest isn't being created. You may need to:
1) verify that your newforest.cs has the correct pathname for the shapes
2) make sure that the function newForest::onAdd() is pointed to the correct ForestItemData and appropriate terrain texture pathnames
3) make sure that the mission you are loading is using those textures.
#155
Something may be wrong on the targetted terrain texture and/or the number of trees.
Edit: SilentMike was faster...
08/16/2008 (12:58 am)
From my memories - because I experienced this myself - it is much more related to the definition of the forest:Something may be wrong on the targetted terrain texture and/or the number of trees.
function myForest::onAdd(%this)
{
%this.addForestEntry("ChristmasTree", "starter.fps/data/terrains/envpack/grass2", 50, 5);
%this.addForestEntry("SeethroughTree", "starter.fps/data/terrains/envpack/drygrass", 50, 5);
}Edit: SilentMike was faster...
#156
And I'm still getting the same thing. Now I'm not sure where I should put the newForest.cs. So I put the newForest.cs in the server/script and added the exec to the game.cs
Then I tried again and got this error.
08/16/2008 (1:34 am)
Okay, I went though and made sure that all the paths are correct for the terrain textures and shapes. I reapplied the terrain texture to the terrain and made sure the terrain was in the propertyMap.cs and the Terrain Texture Editor. And I'm still getting the same thing. Now I'm not sure where I should put the newForest.cs. So I put the newForest.cs in the server/script and added the exec to the game.cs
Then I tried again and got this error.
Missing file: newForest.cs! Forest::addForestEntry - Unknown ForestDataBlock 'Tree1'! Forest::addForestEntry - Unknown ForestDataBlock 'Tree2'! CreateShapeInstances in 0.00 seconds. Forest::createForest - Forest count is zero. To save on memory hits, you should set it to the number of items this forest generates. ---- End createForest: RandomSeed: 100 Forest Array Size: 0 Num ForestItems: 0 Number of ShapeInstances: 0 Forest Created in 0.06 seconds.
#157
I placed my script in my game's mod folder, and exec'd it from the main.cs there, right after the client/server defaults & prefs. It can be placed anywhere just so long as it gets executed before the mission runs
I got rid of the missing file error, I just don't remember how...it's been a while.
08/16/2008 (2:36 am)
It looks like it is trying to create the forest now, but it's not recognizing your forestItem datablock names.I placed my script in my game's mod folder, and exec'd it from the main.cs there, right after the client/server defaults & prefs. It can be placed anywhere just so long as it gets executed before the mission runs
I got rid of the missing file error, I just don't remember how...it's been a while.
#158
I can't accept my words will lead to something wrong. ;-)
1) make a forest script (for example: myNewForest.cs), put it in the mission folder, beware of the function name (myFunctionNameHere)
2) make a call to that script in the main.cs script
example: exec("./data/missions/myNewForest.cs");
3) use the newForest(myFunctionNameHere) in the mission file supposed to hold the forest.
08/16/2008 (2:40 am)
Quote:our function name must be the same as the script:This is wrong.
myForest.cs in which is function myForest and then it is called in the mission file: new Forest(myForest) {
I can't accept my words will lead to something wrong. ;-)
1) make a forest script (for example: myNewForest.cs), put it in the mission folder, beware of the function name (myFunctionNameHere)
2) make a call to that script in the main.cs script
example: exec("./data/missions/myNewForest.cs");
3) use the newForest(myFunctionNameHere) in the mission file supposed to hold the forest.
#159
This is the "newForest.cs" that is placed in "data/missions"
This code is in my mission file.
Exec the file in "main.cs"
Here is the console.log
08/16/2008 (11:18 am)
new ForestItemData(Tree1)
{
collidable = true;
groundAligned = false;
maxItems = 3;
radius = 1.00;
minScaleFactor= 0.8;
maxScaleFactor= 1.5;
shapeFile = "arcane.fx/data/shapes/trees/tree2.dts";
centered = false;
disableBillboardLighting = false;
};
new ForestItemData(Tree2)
{
collidable = true;
groundAligned = false;
maxItems = 6;
radius = 2.00;
minScaleFactor= 0.8;
maxScaleFactor= 1.5;
shapeFile = "arcane.fx/data/shapes/trees/tree3.dts";
centered = false;
disableBillboardLighting = false;
};
function newForest::onAdd(%this)
{
%this.addForestEntry("Tree1", "arcane.fx/data/terrains/grassland/grass1", 50, 5);
%this.addForestEntry("Tree2", "arcane.fx/data/terrains/grassland/grass1", 50, 5);
}This is the "newForest.cs" that is placed in "data/missions"
new ForestClearing(forestClear) {
canSaveDynamicFields = "1";
Position = "237.976 144.183 164.928";
rotation = "1 0 0 0";
scale = "1 1 1";
ShowPlacementArea = "1";
PlacementAreaHeight = "25";
PlacementColour = "0 0.8 0 1";
InnerRadiusX = "0";
InnerRadiusY = "0";
OuterRadiusX = "100";
OuterRadiusY = "100";
};
new Forest(newForest) {
canSaveDynamicFields = "1";
Position = "425.8 -121.6 170.4";
rotation = "1 0 0 0";
scale = "1 1 1";
randomSeed = "100";
forestCount = "0";
treeDistance = "1";
minOcclusionLevel = "3";
maxOcclusionLevel = "5";
singleBlock = "0";
};This code is in my mission file.
exec("./data/missions/newForest.cs");Exec the file in "main.cs"
Here is the console.log
#160
That's the only point I can see.
08/16/2008 (12:44 pm)
Hmm... maybe related to the fact you are using Tree1 and Tree2 and there are .dts files named the same?That's the only point I can see.
Torque 3D Owner Tony Richards
Under certain conditions, while inside a .DIF, the framerate drops on my SLI 8800 GTX drops from 120 fps to 10fps... it doesn't happen on stock Torque 1.5, so I'm sure it's a problem caused by the Forest Pack, so I'm looking into it.
I've purchased a copy of gDEbugger and I don't expect it to take me very long to resolve the issue.
Wish me luck! :P