Detritus - Performance question

Apprentice
Posts: 17
Joined: 2008.04
Post: #1
Not sure if this really belongs in porting or somewhere more general, but part of the issue is I don't have a feel for what a safe "minimum" to shoot for is with my arcade game. Raising my skybox textures from 512x512 to 1024x1024 halved the framerate (basically made unplayable) my little 3d-esque asteroids game. This is on a 400MHz G4 running 10.2.8 (Rage128Pro, 16MB). It runs swimmingly on my somewhat ancient 1.5MHz Dell laptop (built-in mobility radeon 9000, 32MB).

I have all of one meg worth of textures (less) as png, so I seriously doubt that's blowing up over 16MB uncompressed (I could be wrong?).

I'm using GL_LINEAR versus GL_NEAREST to make things prettier, but that doesn't seem to have a significant framerate impact.

So I guess I have a number of questions:

* If you don't mind checking it out, how does it perform for you?
* Do you think I should worry given the performance above?
* How should I figure out recommended minimum specs?
* What might be something I'm overlooking, re: speed?
* Barring an options screen with minimal graphics enabled, what might be a way of providing a fallback to low-res stuff "as needed"?

All thoughts appreciated! ((though "start game non-fullscreen", "make down arrow optionally brake instead of flip", "allow adjustment of sfx volume", "allow adjustment of gamma", and "allow adjustment of camera" are on my "later" list)) I'd really like to just get a stable, reasonable release out. Smile

Download: Release Candidate 4
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
Works fine here, even in Rosetta (30+ FPS; MacBook Pro 2.4 GHz Core 2 Duo, GeForce 8600M GT), though I couldn't get it to run on 10.4.11 PPC. It launches, blacks out the screen, then just quits. I see "/Users/adiener/." printed to the console twice, but nothing else.

The scenes you're drawing are very simple by modern graphical standards, so unless you're targeting more-than-5-year-old hardware (which the Rage 128 Pro is at this point), you'll definitely be fine with what you have now. Having a Universal binary available will help on Intel, and if it ran on PowerPC, I suspect it would be fine there, but I can't verify that at the moment.
Quote this message in a reply
Member
Posts: 53
Joined: 2007.08
Post: #3
Same issues as ThemsAllTook when trying to run on an iMac G5 10.4.11
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #4
kaolin Wrote:...Raising my skybox textures from 512x512 to 1024x1024 halved the framerate (basically made unplayable) my little 3d-esque asteroids game. This is on a 400MHz G4 running 10.2.8 (Rage128Pro, 16MB)...I have all of one meg worth of textures (less) as png, so I seriously doubt that's blowing up over 16MB uncompressed (I could be wrong?).

A single 1024x1024 24 bit RGB texture requires over 3MB (without mipmaps). So a 6-sided skybox at that size is easily over 16MB...

If you want things to run smooth on older hardware it's always a good idea to check the hardware capabilities and scale textures at runtime as required.
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.04
Post: #5
Thanks much! It's frustrating that's that all the output there was for it not working. Was a file /Users/adiener/.detritus.db created? (should be around 2k; strings of it would look like:
Quote:SQLite format 3
tablehighscoreshighscores
CREATE TABLE highscores(name varchar(32),score int, stamp datetime)

And just to make sure, the MacBook Pro is intel-based? I didn't expect that to work at all--it's running under an emulation layer? I'm really not set up to make universal binaries (that's sort of a next step--I think I have to install g++4?)

Sadly, the two lines of output you're seeing were actually supposed to have been suppressed (missed an #ifdef), but they do seem to imply things would be working properly. And it appears I did the opposite for at least one possible error that could be the culprit.

If you're up to trying again (though this shouldn't _work_, just, if I'm lucky, give a better error) -- http://www.erif.org/temp/Detritus1.0.5rc3.dmg
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.04
Post: #6
Frank C. Wrote:If you want things to run smooth on older hardware it's always a good idea to check the hardware capabilities and scale textures at runtime as required.

Thanks for that! Could you point me in the right direction for checking hardware capabilities? I would love to simply scale back at runtime (the only thing I can think of is letting things run a few seconds, check average FPS, and go off of that as part of initialization...but that seems pretty awkward).
Quote this message in a reply
Member
Posts: 59
Joined: 2007.12
Post: #7
I'd consider having less skybox textures because it's hard to notice a pattern in a star texture anyway. I think only 3 sides of the skybox cube can be seen at one time, anyway.
Quote this message in a reply
Member
Posts: 53
Joined: 2007.08
Post: #8
I am not seeing .detritus.db being created anywhere.

In the console I now get:
DB Error: near "NOT": syntax error

And yes, MBP is Intel
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.04
Post: #9
Terrydil Wrote:I am not seeing .detritus.db being created anywhere.

In the console I now get:
DB Error: near "NOT": syntax error

And yes, MBP is Intel

Awesome, thanks! So my SQLite call is the culprit, somehow.

sqlite3_open appears to succeed at opening the database (I'll have to doublecheck I'm checking the return value on that properly). And then it fails on: "CREATE TABLE IF NOT EXISTS highscores(name varchar(32),score int, stamp datetime);" ... which is very weird, as it should be using the compiled-in sqlite, so that really shouldn't be considered a syntax error... unless... yes, I think I must have screwed up that linking.

I'll have to check that more carefully.
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.04
Post: #10
Yup, I knew there was something wrong but the alarm bells just hadn't gotten loud enough. I was dynamically linking sqlite3 but then not including it. Now I'm just statically linking it, and life should be good (rc4). And now to get back to figuring out dynamically scaling back resources for performance... Wink
Quote this message in a reply
Member
Posts: 53
Joined: 2007.08
Post: #11
Runs fine now, performance doesn't seem to be an issue on my machine.
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.04
Post: #12
Great to hear on both counts; thanks!
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #13
kaolin Wrote:Thanks for that! Could you point me in the right direction for checking hardware capabilities?
Read up on the CGLQueryRendererInfo and CGLDescribeRenderer functions. This source should help: http://developer.apple.com/samplecode/Co...ting7.html
Quote this message in a reply
Apprentice
Posts: 17
Joined: 2008.04
Post: #14
Frank C. Wrote:Read up on the CGLQueryRendererInfo and CGLDescribeRenderer functions. This source should help: http://developer.apple.com/samplecode/Co...ting7.html

Very cool, I'll study up Smile
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Detritus (3d-ish FPS-ish take on asteroids) kaolin 10 4,745 Apr 27, 2008 12:17 AM
Last Post: kaolin