Tips for Optimizing Game Performance in Torque
by Fragbox · in Torque Game Engine · 12/22/2004 (5:03 am) · 7 replies
Hi Everyone,
I've been in the middle of development of a game using torque, and it's starting to get quite massive, with over a dozen different high detail characters, a huge interior map, hundreds of texture maps, etc.
I'm wondering what you all can suggest to keep the game running smoothly through all of this?
Texture Map Tips,
Polycount Tips,
Zoning Tips,
Anything else you've found to work well to speed things up... Share them here.
Thanks!
I've been in the middle of development of a game using torque, and it's starting to get quite massive, with over a dozen different high detail characters, a huge interior map, hundreds of texture maps, etc.
I'm wondering what you all can suggest to keep the game running smoothly through all of this?
Texture Map Tips,
Polycount Tips,
Zoning Tips,
Anything else you've found to work well to speed things up... Share them here.
Thanks!
About the author
#3
12/24/2004 (10:28 am)
What about texture maps? Are PNG's or JPG's faster/easier on the engine?
#4
12/24/2004 (2:41 pm)
PNG and JPG compress to about the same level, I've found, for complicated images. Simpler images, PNG compresses to about GIF level. The advantage of PNG is that it has nifty GIF-like features like transparancies, as well as layers, but works with photos and complicated images.
#5
There may be differences during load time, though they would really be negligible.
12/25/2004 (5:23 am)
I think fragbox was really asking if the engine distinguishes between PNG or JPG during rendering time/run time rather than during load-time. The answer to his question is "no, no difference." PNG and JPG are converted in to the internal texture format for whatever graphics API is currently being used for rendering, OpenGL or DirectX. I haven't delved deeply in to the texture management code as I haven't had a need to but I imagine there to be some intermediate format also that is used for rendering to textures, or applying custom effects too. There is only one case where the PNG format will be slower than JPG and that is with the use of alpha transparency as its usage can slow down rendering. Though of course applying an alpha map to an object that is textured with JPGs will also achieve the same slowdown.There may be differences during load time, though they would really be negligible.
#6
Of course runtime won't be affected.. The PNG/JPG is uploaded to memory and from there it's basically raw, I think..
12/25/2004 (6:59 am)
When I'm running our launcher program inside TGE with only JPG's, the program launches far slower than with PNG's. I thought this was due to that JPG's needed to decompress and took longer than PNG's because of that.Of course runtime won't be affected.. The PNG/JPG is uploaded to memory and from there it's basically raw, I think..
#7
12/25/2004 (11:00 am)
Stefan is correct. Once the PNG/JPEG/GIF whatever is loaded into Torque (or anything for that matter) it is uncompressed in memory, and takes up the same space that a BMP would, rougly. The exception to this is a DirectX compressed texture, which Torque does not support currently.
Torque 3D Owner Stephen Zepp
Good tip to track video performance in game:
open up console
metrics(video);
glenablemetrics(1);
That will show you statistics for fps, milliseconds per frame, primitives/trinagle count for dts shapes, terrain, etc.
Also, most people don't mess with scoping too much, mostly because 1) standard scoping works really well, and 2) it's hard to adjust/understand. It's also very dependent on gameplay, but if you research it, you may discover some objects that are getting scoped when they don't absolutely need to be. Of course, if you are a single player game, this isn't nearly as important.