Game Development Community

Performance: how to improve?

by claws · in Torque 3D Professional · 09/16/2013 (10:26 am) · 9 replies

I have been struggling with my Torque 3D codebase to improve the performance of the engine. I'm working with the included demo's, without any additional code or artwork. I have a pretty decent rig (8GB RAM, GeForce 560), but unfortunately, Torque is giving me a few headaches, specially during scene load.

I noticed that there's a lot of IO happening, so, that seems to be the root cause of the scene load performance issue. Maybe a VFS could help? Also, runtime performance is also poor, even with graphical options tweaked down.

This thread has the objective of discussing and sharing knowledge on Torque 3D performance improvements.

About the author

Recent Threads


#1
09/16/2013 (10:33 am)
I think the worst performance hit comes from the bad optimised script system.
#2
09/16/2013 (11:56 am)
That seems like a big source of performance issues to me (why aren't more people testing the TS fixes proposed?). There are also a few instances of bad C++ programming practices in the engine to which while they will compile and run fine, will cause performance drops.

Loadup is slow in your build because it's loading all of the tools (Large amount of TS), take the tools off ,and you'll get a little better. Also, there are a few settings that need to be set.

For in game stuff, high poly stuff or dense particles will result in performance drops, large numbers of objects, ect.

It's just a bunch of little things that are adding up to a bigger problem, and we're going to have to bite the bullet and hunt these down to optimize the performance.
#3
09/16/2013 (12:01 pm)
Which settings do you guys usually set? I have been playing around with them, but the FPS gain was very small.

I ran some static analysis tools, got some minor bug fixes, as well improved a few routines here and there, but there was no significant gain. That's why i decided to create this thread.

Right now i'm running a set of benchmarks in order to spot the big bottlenecks. Hope to get some results soon. :/
#4
09/16/2013 (12:20 pm)
You could always multithread Torque3D and the scripting, but that will take a while and lots of brain cells to accomplish (something I might end up looking into, but don't quote me on that)

Are you doing a lot of heavy math in script? Maybe if your relying on torquescript based utility methods you should port them to c++ for a performance boost. And lastly, watch using the container system and raycasting, as those can give a hit if used a lot in succession.

The main thing that affects FPS setting wise is the lighting. If you use torque3D's basic lighting, you'll get like a 200% performance boost, but then forget about the awesome shininess and shadows and stuff.

And another tip, make sure you set benchmarks in release build settings, as that is more optimized than debug IIRC.
#5
09/16/2013 (1:45 pm)
I think what would benefit everyone here is if we compiled a list of optimizations for what we currently have for a standard T3D build to explain how to set up a release candidate. That would help the most.

I agree with the math/raycast points. Whatever you can do in TS without needing full reliance on datablock programming, you should go for it in C++.
#6
09/16/2013 (2:33 pm)
Yes, cheapest way to improve performance is disable advanced lighting it gives me about 2-3x the performance, so 20 FPS turn out to become super smooth 60, but you will have to live without shadows or fake the lighting somehow.
#7
09/16/2013 (2:35 pm)
@Jeff
I'm not doing any script, i'm just benchmarking the default examples and trying to get a better performance.

@Duion
Is there a way of baking lights in Torque?
#8
09/16/2013 (4:46 pm)
No, you cannot bake lights, this feature is not there.

But you have to remember there is lighting with simple lighting, just not that good, so maybe you can live with it and baking lighting is also limited, since you cannot change the lighting after it, so it is always a trade-off.

I remember I made two test screenshots so you can see what the difference turns out for real:

First picture with advanced lighting:
s14.directupload.net/images/130421/ghn6ngi7.jpg
And here the same thing just advanced lighting deactivated:
s7.directupload.net/images/130421/4bajz4bo.jpg

So you see, pretty much the same, except no shadows from shapes on the ground and parallax does not work. Player for example still has shadows.
#9
09/16/2013 (10:35 pm)
@Klaus yes you can use external programs like pureLight to bake lights in Torque.