Game Development Community

TGE vs TSE Performance on Mac OS X

by Seth Willits · in Torque Game Engine · 11/13/2004 (1:15 pm) · 20 replies

TGE on OS X is pretty... well, let's say it's not up to par with the Windows version in terms of performance. I remember reading a post from an employee saying that there was a lot of room to fix that in future TGE releases. Is it reasonable to assume that since the TSE is being written from the ground up it'll be more optimized on the first go than TGE is as of now? I'm still trying to learn more about Torque and its future directions to see if I should really use it or leave it aside and continue working on my own smaller from-scratch projects.

#1
11/13/2004 (7:06 pm)
TSE is actually an evolution of TGE. Much of the code is the same, including the platform layer (which covers things like file and network IO, date/time functionality, memory management, etc.). However, we are completely changing the rendering implementation, so the new implementation should be better suited to Mac than the current one is. That said, what is implemented on Mac right now is good enough to ship a commercial game with - including MarbleBlast, which Apple is shipping with a lot of their hardware these days.

If you're really concerned, most of the improvements that can be made are very straightforward - mostly a matter of someone with a Mac using Torque, finding brokenness, and fixing it. There's not a lot of subtle tweaking that has to be done here. So if you needed improvements for your projects, it would be very reasonable to do them yourself (especially given how much time Torque would save you in other areas).
#2
11/13/2004 (10:52 pm)
Ah yes, forgive me. I meant the rendering part was being written from the ground up, not the whole thing. I figure the real bottleneck would be the rendering since there's not much difference with anything else between the platforms other than the sound.

I am concerned about the speed though. It's really easy to get the FPS starter to crawl to 9 frames a second on a 1.6 Ghz G5 with a Radeon 9600 Pro. It may not be top of the line, but I can run Unreal Tournament a whoooole lot smoother than Torque, and that's with full settings at a much higher resolution. If the new rendering path in TSE could help this significantly I'd be less reluctant to invest the time, energy, and money into using Torque.

I'd love to contribute to Torque and I think I could if I just spent the time to learn it. I've gotten a friend excited about it, but he's a non-programmer so I'll have to teach him about a lot of things to get him up to speed, but I have an odd suspicion that you'll be hearing more from us over the next year...

Anyway, I can't wait to see TSE on OS X and play with it. The rendering quality is just amazing compared to TGE.
#3
11/14/2004 (9:41 am)
We have some fixes for TGE that we're going to put into 1.4, that give some MAJOR performance improvements on Macs.

TSE should perform similarly on Mac and PC.
#4
11/14/2004 (9:48 am)
It's like music to my ears. Thanks Ben.
#5
11/18/2004 (12:44 am)
Just to reenforce what Ben said... we already have some Mac rendering performance optimizations in the hopper, including a big one by community member Kyle Goodwin. Also I'm heading up to the Apple Developer Kitchen next week, where I'll get face-to-face time with Apple's engineers to talk about OS X and Torque. :)
#6
11/18/2004 (1:24 am)
This sound really hot!
Did Kyle achieved some Altivec integration into TGE?
#7
11/18/2004 (12:11 pm)
Yes, he did an Altivec implementation of the terrain blender, which is the major performance constraint on scenes that are processor-limited outdoors. The changes won't increase performance for everyone or for every scene, but they're a huge help in many instances. Those improvements aren't the only ones on the table, and even beyond what I have planned, I'm sure the conference with Apple will yield some good results for us.
#8
11/18/2004 (12:16 pm)
Cool. If I remember, I'll ask about how the kitchen went next week.
#9
11/19/2004 (4:46 am)
Are these still processor specific? Last I checked, if i wanted to help g4 users, I needed to do one set of changes, and another for g5 proc owners.

Is that still the case?
#10
11/19/2004 (3:49 pm)
9 frames on a G5 1.6 ???? I get more than that on my G3 900 iBook ! You have issues.
My G5 1.8 flies with the demo ....
#11
11/19/2004 (3:53 pm)
Well if anyone knows what issues I can have, please feel free to help me out. I'm not saying it runs constantly at 9 fps, but it's pretty easy to get it there with a wall and the crossbow.
#12
11/19/2004 (5:22 pm)
Particles. There's a resource on using LODs with particles and on clipping them at a certain size. When the alpha-blended particles are scaled up so they fill up most the screen (as they would when shooting up against a wall) they really bog down the system. This slowdown effects windows and linux machines as well. I imagine just clipping away the huge particles will increase your framerate significantly.
#13
11/19/2004 (5:53 pm)
@John - that could be. If you get close enough to a wall and start shooting the particles do take up a significant portion of the screen so I'm sure that's a big part of it. I wonder why it's so slow though. I can think of other games where it doesn't slow down. It'll be a while before I'll have time to wade through Torque's code and see what I can see.
#14
11/19/2004 (11:06 pm)
Seth, check if you choosed the right compilation mode in XCode.
In your main project window the "Active Target" must be "Torque-MacCarb-Release" and the "Active Build Style" must be "Deployment".
#15
11/20/2004 (9:16 am)
Ack! Good point. I forgot to do that. Much better. Only gets down to 20 fps now. Overall speed is much quicker. Now I wonder how much stuff I can add before it gets back down to where it was. Of course if 1.4 has these Altivec optimizations...

Question: When TSE goes final (and/or EA for Mac), what version of TGE will it have underneath? Will it be 1.3 or 1.4?
#16
11/20/2004 (11:07 am)
The altivec changes are generic to everything with altivec, i.e. G4+. I added some specific suggestions for compilation options to further optimize on G4 and G5 independently, but the G5 optimizations are simply a superset of the G4 ones so feel free to just use the G4 ones for everyone. Even without seperate processor-specific builds (which you can put in the same .app by the way so the user doesn't need to know) you'll still gain quite a bit of performance. I've done a lot of other altivec optimizations to the vector/matrix math etc., but they haven't been huge wins. I'm currently looking for places where TSE could still benefit from vector processing and compiling a list so that when TSE is running on openGGL I can implement them and get a very well optimized version of TSE running on OS X as soon as possible. I'm just wrapping up my last game, Glyph, which was done in TGE--and which will likely be my last TGE game as I've now transitioned to TSE--but if/when the altivec code gets integrated with the HEAD of TGE I'll still be glad to help with the continued OS X optimization effort.
#17
11/21/2004 (1:51 am)
Thanks Kyle. :) I'm sure I'll be in touch after this Apple Dev Kitchen.

Ed, to expand on what Kyle said.. in general, with GCC compiler switches for apple hardware, optimizations for G4s will also do a good job on G5s. So, you can just target the G4. Or, if you want to have G5-specific optimizations, you can use OS X's .app system and package separate binaries in one app. Your download size will be bigger though.
#18
11/21/2004 (6:11 am)
What I find to be the best compromise between download time and optimization is to package the demo with a single G4 binary and then put both binaries in the full version. People can still download your demo quickly to try it out but they'll have the best optimizations possible if they decide to buy it. Another approach would be to have several .app files and give the downloader a choice of which to download. Also just as an aside...if anyone does any profiling on their game on mac and can show me someplace *other* than the texture blender which is taking a disproportionately large number of cycles compared to the windows version of torque I'll be happy to altivectorize that area if it's feasible.
#19
11/21/2004 (10:14 am)
Indoor rendering on OSX is nearly as fast as in Windows, and your opts definitely take care of the biggest bottleneck in outdoor rendering, on machines / scenes that are processor-limited. So, with your optimizations performance seems to be about 90% of that on Windows, in most scenes, with most computers. Again, awesome work and many thanks Kyle. Thanks also for the offer to altivec-dafy other pieces of code if it's helpful and feasible.
#20
11/21/2004 (10:27 am)
Yeah, I have noticed some inexplicable slowdown relating to precipitation and/or Tim Aste's content packs on mac, though. Haven't yet had time to pin it down, but I'll get there eventually.