How can I get more power from Torque?
by DME · in General Discussion · 06/24/2005 (4:52 pm) · 48 replies
I'm having some issues with performance, I'm using LOD, Null textures, shorter visable area, fog, LOD and mostly 256 X 256 texture sizes. A central part of our game is the underground city of Neltec. Below is some concept art that shows how the city should look.



When we first started out we added caves and made it look great, then we couldn't export anything. All the maps were too complex, the ones we did export caused insane FPS slow down. So then I got rid of the caves and created a hall way system that connected all the buildings. Now unfortunately I couldn't connect all the buildings together because it would just crash the exported, so I chopped it into 4 maps, they all export fine. But then a new issue came up, we could'nt have 2 separate zoned buildings close together.
So I spread out the buildings and put in a teleporting system. All the objects are Zoned, null textured and have LOD but it doesn't matter. It takes forever to load, 30 seconds to a minute, and its like the load bar goes all the way across in a normal amount of time then just freezes there for 40 seconds.
The map has slow fps around 30-40 most the time but dipping down to 10-15 for no reason, the map really doesn't have that many polys. Our models are around 3,500 polys with 7 LOD and I can't have more than 3 - 4 on the screen with out FPS dropping drastically. Plus I can be running around and it freezes for a second and my fps drop to 1 or 2, it stutters for a second then the fps go back up. If I go back over that same area there is no performance hit at all, its like it needed to stop and load more information. I'm really not sure what we are doing wrong. Tribes 2 models are around 2,000 polys plus 500 poly per gun and you can have 32 players at once, that's 80,000 polys with just characters. We are having difficulty getting 1 eighth that amount to work. Any more than 4 characters in one of our interiors kills our fps. Below is a couple pictures of our interiors. I basically just want to have a normal load time, a constant 30-60 second FPS and no stuttering. I need to make this feel like a large vibrant city but I just can't seem to get what I need to pull it off. If you have any suggestions let me know.
Thank you for your time
Brice Johnson
bricejohnson@projectraven.com






When we first started out we added caves and made it look great, then we couldn't export anything. All the maps were too complex, the ones we did export caused insane FPS slow down. So then I got rid of the caves and created a hall way system that connected all the buildings. Now unfortunately I couldn't connect all the buildings together because it would just crash the exported, so I chopped it into 4 maps, they all export fine. But then a new issue came up, we could'nt have 2 separate zoned buildings close together.
So I spread out the buildings and put in a teleporting system. All the objects are Zoned, null textured and have LOD but it doesn't matter. It takes forever to load, 30 seconds to a minute, and its like the load bar goes all the way across in a normal amount of time then just freezes there for 40 seconds.
The map has slow fps around 30-40 most the time but dipping down to 10-15 for no reason, the map really doesn't have that many polys. Our models are around 3,500 polys with 7 LOD and I can't have more than 3 - 4 on the screen with out FPS dropping drastically. Plus I can be running around and it freezes for a second and my fps drop to 1 or 2, it stutters for a second then the fps go back up. If I go back over that same area there is no performance hit at all, its like it needed to stop and load more information. I'm really not sure what we are doing wrong. Tribes 2 models are around 2,000 polys plus 500 poly per gun and you can have 32 players at once, that's 80,000 polys with just characters. We are having difficulty getting 1 eighth that amount to work. Any more than 4 characters in one of our interiors kills our fps. Below is a couple pictures of our interiors. I basically just want to have a normal load time, a constant 30-60 second FPS and no stuttering. I need to make this feel like a large vibrant city but I just can't seem to get what I need to pull it off. If you have any suggestions let me know.
Thank you for your time
Brice Johnson
bricejohnson@projectraven.com



#2
I was told dts is no good for interiors, we use dts for things like the tanks, planes, bar chairs, tables. Basically stuff that is going to be replicated. So for example you have 5 chairs its better to create one dts chair then put in 5 chairs in your dif file. If your talking about large objects like having the elevator a DTS instead of a DIF will that make a difference? Wouldn't the ammount of surfaces be the same so it eats up the same processing power?
06/24/2005 (5:03 pm)
Most the textures are 256 X 256 except character models which are 512X512. Its all Zoned with portals, every doorway and corner bend. I was told dts is no good for interiors, we use dts for things like the tanks, planes, bar chairs, tables. Basically stuff that is going to be replicated. So for example you have 5 chairs its better to create one dts chair then put in 5 chairs in your dif file. If your talking about large objects like having the elevator a DTS instead of a DIF will that make a difference? Wouldn't the ammount of surfaces be the same so it eats up the same processing power?
#3
I would also recommend attempting to lower your interior texture sizes even more except for the few that need to be larger. An interior texture is usually mapped to a small surface or tiled across a larger surface (make use of tiling as much as possible) so it doesn't need to be very big. General rule of thumb is that it needs to be about the same size as the number of pixels it takes up on screen on average. And yeah...it might get grainy as you put your camera right up to it but that is pretty much par for the course.
You might also want to optimize sharing the textures among the interiors and the interior surfaces as much as possible. 30-100 256x256 textures can start to add up quickly. The more a single texture can be reused the better.
There is something as zoning too much. The zoning calculations can start to add up pretty quickly so you need to be careful. In some tests we've made it has actually been better to completely disable the zoning code in the engine.
I notice you are using a lot of high detail volumetric lights....the blending for those can quickly start to eat away at your framerate.
06/24/2005 (5:16 pm)
The hitching you are describing is generally caused by a large amount of new textures being swapped into memory....which is why I recommended possibly using some dts's as details since they generally are unwrapped onto a texture instead of using multiple textures like interiors.I would also recommend attempting to lower your interior texture sizes even more except for the few that need to be larger. An interior texture is usually mapped to a small surface or tiled across a larger surface (make use of tiling as much as possible) so it doesn't need to be very big. General rule of thumb is that it needs to be about the same size as the number of pixels it takes up on screen on average. And yeah...it might get grainy as you put your camera right up to it but that is pretty much par for the course.
You might also want to optimize sharing the textures among the interiors and the interior surfaces as much as possible. 30-100 256x256 textures can start to add up quickly. The more a single texture can be reused the better.
There is something as zoning too much. The zoning calculations can start to add up pretty quickly so you need to be careful. In some tests we've made it has actually been better to completely disable the zoning code in the engine.
I notice you are using a lot of high detail volumetric lights....the blending for those can quickly start to eat away at your framerate.
#4
As far as lighting I really hope it doesn't make a huge difference because proper lighting really adds a lot to a level, I think it's especially important when dealing in tiled interiors.
06/24/2005 (5:35 pm)
Hmm makes sense, Ill try applying one 32x32 on everything see what kind of performance gains I get. I'll also try the maps with and without zones.As far as lighting I really hope it doesn't make a huge difference because proper lighting really adds a lot to a level, I think it's especially important when dealing in tiled interiors.
#5
06/24/2005 (5:44 pm)
The volumetric lights don't actually light anything...they are just a bunch of "glowy" looking quads...and it looks like you have them subdivided a *lot*.
#6
I went in a room which had 95 FPS placed 4 models and it went down to 18 FPS. That's a 19.25 fps loss per model. It has to be something wrong with the export. Which I've been fighting with for over 3 months, I have constantly been trying to recruit exporters and animators but of the 8 replies I got no one was able to figure it out.
Is there some easy way to export? I appreciate the versatility of the animation code, but if you can't recruit people skilled in exporting and no one seems to be able to learn it then its just a giant sink hole of wasted time.
06/24/2005 (7:35 pm)
Well I figured out what's causing the issue and I must say I'm not surprised. I Removed all the lights and just applied one single texture. It did increase my FPS a little bit from about 40 to around 50. But the load time was still slow and it still caused hiccups. I then removed our models and it worked correctly. Our models are all around 3,500 polys and have 1 or 2 512 X 512 texture. I went in a room which had 95 FPS placed 4 models and it went down to 18 FPS. That's a 19.25 fps loss per model. It has to be something wrong with the export. Which I've been fighting with for over 3 months, I have constantly been trying to recruit exporters and animators but of the 8 replies I got no one was able to figure it out.
Is there some easy way to export? I appreciate the versatility of the animation code, but if you can't recruit people skilled in exporting and no one seems to be able to learn it then its just a giant sink hole of wasted time.
#7
How many bones do you have in your models? The skinning/animation code is all done on the cpu and when your bones gets excessive (a bone per joint for every finger for example) it can get very slow. Transparency on the models can also cause nasty slow downs.
You may also want to play with
at the top of tsMesh.cpp. nVidia screwed up their drivers with rendering quads/polygons instead of triangles and this can give a nice performance boost.
06/24/2005 (8:05 pm)
What dts exporter are you using? Are the models being triangle stripped? (check in TST Pro) Having two 512x512 textures on the models can be causing a performance hit. You may also want to try reducing the size of that texture (some video cards choke on larger textures). Be sure to share textures among your models as much as possible. How many bones do you have in your models? The skinning/animation code is all done on the cpu and when your bones gets excessive (a bone per joint for every finger for example) it can get very slow. Transparency on the models can also cause nasty slow downs.
You may also want to play with
bool TSMesh::smUseTriangles = false; // convert all primitives to triangle lists on load bool TSMesh::smUseOneStrip = true; // join triangle strips into one long strip on load
at the top of tsMesh.cpp. nVidia screwed up their drivers with rendering quads/polygons instead of triangles and this can give a nice performance boost.
#8
EDIT: Talking about the interiors, hadn't seen the last 2 posts when i posted
06/24/2005 (8:37 pm)
@Matthew: Could it be related to the lightmap issue Josh was discussing some time ago too? We use mostly static sg lights, which render to the lightmaps, so most instances of the lightmaps are different, I can imagine there's tons of repeated lightmaps just with little differences, that could sum up video memory quickly too (and could be causing the memory swap)EDIT: Talking about the interiors, hadn't seen the last 2 posts when i posted
#9
06/25/2005 (6:17 am)
.
#10
Anyway, you should really try the debug render modes if you want to optimize. I usually walk around in wireframe mode to see what is being rendered and what not (see zones appear and dissapear depending on your position).
06/25/2005 (6:37 am)
Brice, are your models 3500 polys ingame, or in Max? make sure you are counting triangles and not Max polygons. You also might want to check if your material isn't double sided in Max, or else it will spit out twice the amount of polygons.Anyway, you should really try the debug render modes if you want to optimize. I usually walk around in wireframe mode to see what is being rendered and what not (see zones appear and dissapear depending on your position).
#11
06/25/2005 (8:39 am)
How bout the collision meshes? that's been a big factor in determining how long my stuff takes to load. Are you using a simple box for your characters?
#12
Dts collision is 20-40% slower than dif collision on average. The reason dif's look so "blocky" is because you are colliding against what you see. It is possible that you could use a really high poly dts in conjuction with a really simple collision mesh and get slightly better performance but you collisions aren't going to match your visible mesh at all at that point.
Ward has an excellent point!
Ramen,
Players don't need collision meshes at all.
06/25/2005 (3:03 pm)
Thc-03,Dts collision is 20-40% slower than dif collision on average. The reason dif's look so "blocky" is because you are colliding against what you see. It is possible that you could use a really high poly dts in conjuction with a really simple collision mesh and get slightly better performance but you collisions aren't going to match your visible mesh at all at that point.
Ward has an excellent point!
Ramen,
Players don't need collision meshes at all.
#13
06/25/2005 (3:55 pm)
Loading the models up into Show Tool Pro might provide a bit of usefull info.
#14
06/25/2005 (4:59 pm)
Hi guys thanks for the responses, I'm super sick so Ill try this stuff when better and get back to you.
#15
@Matthew Fairfax, we were originally making this game for TSE, we decided to switch back to TGE. That's why our models are setup with 1, 2 or 3 textures. In TSE if you wanted dull sections on your model, shiny and glowing, these all had to be separate textures. As for the bones I believe our exporters are using this www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7792
@Thc-03, Alright I'll keep that in mind.
@ Ward De Langhe, when opened in the viewer and going to detail control it shows the proper amount of polys 3,100 - 3,800.
Right now I know it's something with the rigging, I have one female model when I place as a static shape it eats 40 FPS. It can't be the animation cause when placed as a static the animation does not play. I then took the original model that is not rigged and exported as a simple shape. It took up about 4 FPS a 34 FPS difference
06/26/2005 (5:02 pm)
Here is the answer to some of the questions@Matthew Fairfax, we were originally making this game for TSE, we decided to switch back to TGE. That's why our models are setup with 1, 2 or 3 textures. In TSE if you wanted dull sections on your model, shiny and glowing, these all had to be separate textures. As for the bones I believe our exporters are using this www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=7792
@Thc-03, Alright I'll keep that in mind.
@ Ward De Langhe, when opened in the viewer and going to detail control it shows the proper amount of polys 3,100 - 3,800.
Right now I know it's something with the rigging, I have one female model when I place as a static shape it eats 40 FPS. It can't be the animation cause when placed as a static the animation does not play. I then took the original model that is not rigged and exported as a simple shape. It took up about 4 FPS a 34 FPS difference
#16
06/27/2005 (4:21 am)
@Brice - It was my understanding that framerate decreased exponentially as you reached the limit of what the card could handle. Have you tried knocking down your visibility and see if you still get such a large drop? Or dropping those same 4 characters into the stock starter.fps stronghold mission ? If they don't cause an issue there, then they are probably not the issue.
#17




Here is one of our most complex models, 3,720 polys in detail control of the torque viewer. Three 512x512 textures
With the model rigged it eats 65 frames per second
If I export as a simple shape it eats 27 frames per second
If I converted all 512 X 512 textures to 32x32 I lose 25 frames per second
I double check STL, no errors.
I don't know, if someone want's to see a couple of the files just let me know. I can email them to you.
For some reason losing 27 fps for 3,700 polys seems very excessive.
06/27/2005 (1:12 pm)
This was bad planning on my part. I assumed that exporting would be easy. I didn't think it would be like animating or texturing, I thought it would require no skill just a matter of following the steps. I was wrong. 



Here is one of our most complex models, 3,720 polys in detail control of the torque viewer. Three 512x512 textures
With the model rigged it eats 65 frames per second
If I export as a simple shape it eats 27 frames per second
If I converted all 512 X 512 textures to 32x32 I lose 25 frames per second
I double check STL, no errors.
I don't know, if someone want's to see a couple of the files just let me know. I can email them to you.
For some reason losing 27 fps for 3,700 polys seems very excessive.
#18
Have you tried fiddling around with smUseTriangles yet? Your problem sounds way too aggresive, and that might help you out a bit.
06/27/2005 (1:42 pm)
Brice,Have you tried fiddling around with smUseTriangles yet? Your problem sounds way too aggresive, and that might help you out a bit.
#19
06/27/2005 (2:28 pm)
Well I'm using a Radon 9700, so I shouldn't have the same issue as bad Nvidia drivers but I got nothing else to try. Atleast I know its not our models cause a tree from the bravetree pack takes 14 fps. So looks like something in the engine.
#20
06/27/2005 (2:40 pm)
Then it's definatly some setting or your system that's causing the problem. Believe me, we've had hundreds of trees from the bravetree pack scattered all over the place without going below 60 fps.
Associate Matt Fairfax
Night Heron Games