Archived

This topic is now archived and is closed to further replies.

leiavoia

SDL Games: ideal screen res and optimistic fps (what are you getting?)

Recommended Posts

leiavoia    960
Pretty simple questions: 1) For an SDL-based game, what''s the "normal" frame rate to have? 2) What would be the "ideal screen resolution"? I''m creating an SDL-based side scroller, somewhat like Super Metroid. I''m just toying around with the blitting and layering and such, and looking at the frame rates as i do. Seems i get 40-45 fps at 800x600 by blitting a background bmp image to the screen every frame. i only get 25-30 @ 1024x768. That''s with no game logic, just blit-loops. I wanted to know what people are using for their games and whether they would have done it differently. I''d like the higher res in my game, but it chunks up the framerates. I like the smoothness of the 800x600, but not the size, especially fullscreen. But the real Super Metroid was only TV resolution (very small), and it was a great game...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
If you are using lots of aplha blending (transparency) SDL is not a good choice. I remeber reading on the SDL newsgroup a while back that SDL is not well suited for that.

One of the code maintainers suggested using OpenGL for those kinds of apps.

Share this post


Link to post
Share on other sites
Kylotan    9858
Blitting a bmp vs a png will only be significant if you didn''t convert the surface to the proper format first. The way the image is stored on disk should have no relevance to your performance.

Remember SDL is a 2D api and you don''t get much acceleration from that. I think you can expect frame rates of between 30 and 60fps for 800x600, and no higher than 50fps for very simple scenes at 1024x768.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

Share this post


Link to post
Share on other sites
leiavoia    960
PNG images loaded with SDL_image are automatically converted to the alpha-blended type surface, that''s what i was getting at. For me, i usually don''t convert surfaces manually. If i need alpha blending, i just load a PNG graphic and let SDL do the rest.

Share this post


Link to post
Share on other sites
C-Junkie    1099
I almost ALWAYS convert the loaded bitmap to the same pixelformat as the screen.

maybe its superstition, but it SEEMS like it SHOULD be a lot faster....

Share this post


Link to post
Share on other sites
leiavoia    960
Are there any resources on the net for developing 2D games with OpenGL? All i can find is 3D related items. I''ve not started to learn OpenGL at all yet, but would be interested. But i''m not interested in super-cool 3D yet, since i don''t want my project to get overly complicated.

Share this post


Link to post
Share on other sites
vaneger    100
just dont blit every single frame unless you absolutly need to blit. that alone will allow your frame rate to go up much higher.

Share this post


Link to post
Share on other sites
leiavoia    960
that is good advice and my technique on my current project: a TBS game with lots of menues. However, my current project is an action game. I''m experimenting right now with particles and explosions (the fun stuph :-), so not blitting each frame is not an option for most situations in this game. Although i understand what you are getting at.

Share this post


Link to post
Share on other sites
GamerSg    378
If you want to learn OpenGL, just download the redbook from the articles & resources and look up on glOrtho(). The Ortho mode is perfect for 2d rendering where objects which are further away dont appear smaller.

Share this post


Link to post
Share on other sites
Kylotan    9858
quote:
Original post by vaneger
just dont blit every single frame unless you absolutly need to blit. that alone will allow your frame rate to go up much higher.


But that''s almost entirely irrelevant. If you''re concerned about frame rates then surely that''s because you want smooth animation, and you can''t get it to be smooth if it''s not moving.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

Share this post


Link to post
Share on other sites
Inmate2993    222
JOOC

Is there something wrong with 640x480 resolution? I know its pathetic for the average windows or kde desktop, but for a super metroid clone, it should be more than adequate, considering that the original super metroid worked on a 256x224 stretched NTSC screen, 256 colors and 30fps (60 interleaved).

Share this post


Link to post
Share on other sites
leiavoia    960
Yeah, they sure did a lot with those small resolutions. But i''m not making a "metroid clone". I''m doing something totally new, but that most closely resembles metroid in play.

I''ve decided that anything (at least on my 19" monitor) less than 800x600 fullscreen is too chunky and constrained. personally i really think that 1024x768 is ideal, but that''s a lot of space to fill with data.

Share this post


Link to post
Share on other sites
Facehat    696
You might want to look into using dirty rectangles to limit the amount you''re drawing at once. I don''t have time to explain them here, but it''s a pretty common thing to do in 2D graphics so a quick search on google should yield some good results (or, who knows, maybe it''ll just give you rectangle porn sites ).

----------------------------------------
"Before criticizing someone, walk a mile in their shoes.
Then, when you do criticize them, you will be a mile away and have their shoes." -- Deep Thoughts
"If you have any trouble sounding condescending, find a Unix user to show you how it''s done." - Scott Adams
FaceHat Software -- Wear the hat.

Share this post


Link to post
Share on other sites