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

Started by
13 comments, last by leiavoia 20 years ago
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...
Advertisement
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.
yes, i recently discovered that myself. Blitting a .bmp vs a .png is 2.5x less expensive
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]
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.
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....
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.
just dont blit every single frame unless you absolutly need to blit. that alone will allow your frame rate to go up much higher.
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.
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.

This topic is closed to new replies.

Advertisement