Performance issues (Mac)
by Jacob Vann · in Torque Game Builder · 08/25/2005 (2:46 pm) · 5 replies
I'm not sure if this is the best place for this discussion, but here goes.
I've been doing all my development so far on a 1.25 GHz Powermac G4 with 1.25 Gigs of RAM, and a 64 MB nVidia Video card (not positive if it's 64 megs, as I am not at home right now). I've been getting great performance so far with the little tests I've been doing, with 1 sprite and minimal scrolling. However, the window I'm drawing to is 1024x768, and my graphics for tiles and sprites are quite large (512x512, and even more for the main sprite [I think it's 1024 x 1024], which is going to have 40-something frames of animation before I'm done). On the G4, I get generally 120-125 FPS. Fine. Perfect.
I moved the same test to my old iBook (G3 600 MHz with 256 Megs of RAM and a tiny 8 Meg Video Card). When I try and run it 1024 x 768 (which is full screen on the iBook), it freaks out. Either it won't display anything, or, it will draw the tiles correctly but the main sprite will just be junk graphic data. It looks like it takes random bits of the window for the main sprite graphics.
I'm thinking that my system just doesn't have enough VRAM to hold everything to draw to the screen, so maybe the memory addressing wraps back around after 8 megs and torque essentially loads junk data. I could be wrong, I don't know much about video cards or VRAM. If I take the same game, and run it at 800 x 600 or 640 x 480, the main sprite shows up okay, but I never get more than about 18 FPS. Mostly it hovers around 16FPS, doing only slightly better if I change the monitor resolution to 640 x 480 and run fullscreen.
What's even weirder, is I wrote a very similar demo (same resolution, sizes, etc) using Spriteworld, which uses a software renderer, and no 3d acceleration, and I got around 30 FPS, which is much more respectable.
The iBook is 4 years old (not terribly old). It runs other 3d games okay (can't even attempt to run something like WoW (World of Warcraft, for the unenlightened :) ), but simple 3d racing games run fine). Since this is going to be a shareware game (most likely), I would want to target the largest audience possible (and, frankly, the people pony-ing up to buy shareare typically aren't running "modern" hardware).
Is there a way, first of all, to see how much video memory T2D is using? Also, what would happen to a T2D game if it ran out of VRAM? Would it start using a software rendering engine, or would it just choke (like it seems to have done on my iBook)?
.... if the latter, then how can I be more efficient?
I'm thinking of converting the game to run native 640 x 480, to just about cut 75% of my graphics size requirements (32 x 32 tiles instead of 64 x 64). I will lose some detail in the graphics, but I'm willing to do that if it'll run decently on a 4 year old machine. I just want to hear other peoples' thoughts first, as maybe I'm doing something wrong.
I apologize if this is documented elsewhere. I also apologize if I sound like I don't know a lot about video cards. It's because I don't. :)
Thanks in advance!
-Jacob
I've been doing all my development so far on a 1.25 GHz Powermac G4 with 1.25 Gigs of RAM, and a 64 MB nVidia Video card (not positive if it's 64 megs, as I am not at home right now). I've been getting great performance so far with the little tests I've been doing, with 1 sprite and minimal scrolling. However, the window I'm drawing to is 1024x768, and my graphics for tiles and sprites are quite large (512x512, and even more for the main sprite [I think it's 1024 x 1024], which is going to have 40-something frames of animation before I'm done). On the G4, I get generally 120-125 FPS. Fine. Perfect.
I moved the same test to my old iBook (G3 600 MHz with 256 Megs of RAM and a tiny 8 Meg Video Card). When I try and run it 1024 x 768 (which is full screen on the iBook), it freaks out. Either it won't display anything, or, it will draw the tiles correctly but the main sprite will just be junk graphic data. It looks like it takes random bits of the window for the main sprite graphics.
I'm thinking that my system just doesn't have enough VRAM to hold everything to draw to the screen, so maybe the memory addressing wraps back around after 8 megs and torque essentially loads junk data. I could be wrong, I don't know much about video cards or VRAM. If I take the same game, and run it at 800 x 600 or 640 x 480, the main sprite shows up okay, but I never get more than about 18 FPS. Mostly it hovers around 16FPS, doing only slightly better if I change the monitor resolution to 640 x 480 and run fullscreen.
What's even weirder, is I wrote a very similar demo (same resolution, sizes, etc) using Spriteworld, which uses a software renderer, and no 3d acceleration, and I got around 30 FPS, which is much more respectable.
The iBook is 4 years old (not terribly old). It runs other 3d games okay (can't even attempt to run something like WoW (World of Warcraft, for the unenlightened :) ), but simple 3d racing games run fine). Since this is going to be a shareware game (most likely), I would want to target the largest audience possible (and, frankly, the people pony-ing up to buy shareare typically aren't running "modern" hardware).
Is there a way, first of all, to see how much video memory T2D is using? Also, what would happen to a T2D game if it ran out of VRAM? Would it start using a software rendering engine, or would it just choke (like it seems to have done on my iBook)?
.... if the latter, then how can I be more efficient?
I'm thinking of converting the game to run native 640 x 480, to just about cut 75% of my graphics size requirements (32 x 32 tiles instead of 64 x 64). I will lose some detail in the graphics, but I'm willing to do that if it'll run decently on a 4 year old machine. I just want to hear other peoples' thoughts first, as maybe I'm doing something wrong.
I apologize if this is documented elsewhere. I also apologize if I sound like I don't know a lot about video cards. It's because I don't. :)
Thanks in advance!
-Jacob
#2
I believe this is the reason that there is already support for chunked images, so older hardware that can't handle large contiguous data blocks can be used. There was some mention in another thread several weeks ago that more robust chunked-image support might be coming in future T2D releases as well.
Ah, here is the thread I was thinking of, actually,
08/25/2005 (5:26 pm)
I ran into a problem with some video hardware on Windows machines where large images (1024x768 in my case) were really hosing performance, down around 5-8fps no matter what else was going on. The sprite itself could be any size; it was the source size of the PNG file that caused it. Once I reduced that image in size to 512x512 I jumped up to 30-40fps which was more in line with what I was expecting with that particular hardware.I believe this is the reason that there is already support for chunked images, so older hardware that can't handle large contiguous data blocks can be used. There was some mention in another thread several weeks ago that more robust chunked-image support might be coming in future T2D releases as well.
Ah, here is the thread I was thinking of, actually,
#3
Well, T2D is based on OpenGL (which abstracts the concept of video memory, so you never know how much you are using), so it all depends on how the OpenGL implementation you're using handles this. T2D has no software renderer.
08/25/2005 (7:47 pm)
Quote:I moved the same test to my old iBook (G3 600 MHz with 256 Megs of RAM and a tiny 8 Meg Video Card). When I try and run it 1024 x 768 (which is full screen on the iBook), it freaks out./quote]
Well, 1024 * 768 * 4 bytes per pixel (32-bit) * 2 (double buffers) = 6,291,456 bytes or 6MB. Which leaves you with 2 for the entire rest of your game.
I wouldn't expect T2D to function well in such an environment. Lower your resolution to a more reasonable value.
[quote]Is there a way, first of all, to see how much video memory T2D is using? Also, what would happen to a T2D game if it ran out of VRAM? Would it start using a software rendering engine, or would it just choke (like it seems to have done on my iBook)?
Well, T2D is based on OpenGL (which abstracts the concept of video memory, so you never know how much you are using), so it all depends on how the OpenGL implementation you're using handles this. T2D has no software renderer.
#4
Not perfect but can be helpful.
- Melv.
08/26/2005 (1:42 am)
T2D does have some metric-gathering capabilities although you need to add the "GATHER_METRICS" preprocessor definition to your compiler and rebuild. You can then do something like "echo( $Video::numTexelsLoaded );" and there are plenty of other metrics you can interrogate as well. This particular metric is maintained via the texture-manager and obviously only tells you the size when it passed along the graphics-pipe to the GPU, what particular overhead the GPU has isn't taken into account here but it should give you a good approximation.Not perfect but can be helpful.
- Melv.
#5
On my iBook, I still got the weird artifact with the character sprite showing up with random chunks of the screen. This only happens when the resolution of the monitor was 800 x 600 or more. At 640 x 480, he showed up fine, but, disappointingly, I only got about 2 or 3 extra FPS out of sacrificing a lot of graphical detail.
So I'm going to stick with 1024 x 760 with 64 x 64 tiles. It'll look a helluva lot better! :) I'm going to chalk up the weird problem on the iBook to it still only running OS X 10.2.8 (as opposed to 10.4.2), and the crippled video card.
And who cares if my game ends up being a 150 meg download? :)
I'll also put faith in T2D getting higher performance down the road.
-Jacob
08/26/2005 (7:36 pm)
I ran an experiment. I shrunk down my sprite to 100x100 (from 160 x 160), and all my tile graphics to be 32 x 32 tiles instead of 64 x 64 tiles, and shrunk the render window to 640 x 480.On my iBook, I still got the weird artifact with the character sprite showing up with random chunks of the screen. This only happens when the resolution of the monitor was 800 x 600 or more. At 640 x 480, he showed up fine, but, disappointingly, I only got about 2 or 3 extra FPS out of sacrificing a lot of graphical detail.
So I'm going to stick with 1024 x 760 with 64 x 64 tiles. It'll look a helluva lot better! :) I'm going to chalk up the weird problem on the iBook to it still only running OS X 10.2.8 (as opposed to 10.4.2), and the crippled video card.
And who cares if my game ends up being a 150 meg download? :)
I'll also put faith in T2D getting higher performance down the road.
-Jacob
Torque Owner Jason Swearingen
As for your "what systems will this work on" remark, I think it should be fairly safe to assume that T2D will work on any system that TGE works on, and wont work on any system TGE doesnt work on. (because they both use the same core, i think that would be an acceptable target for Melv to shoot for)
My biggest concern is also perf, but more along the forward-looking (scaling your simulation up) rather than backwards looking (running on legacy systems). But I can see why you are concerned.
PS: I run t2d on a beefy Windows box, and am busy thinking of ways to address systems 5 years down the road, thus my forward-looking stance.