🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Blit Speeds

Started by
3 comments, last by DerekDay 24 years, 5 months ago
I''m having some trouble making a side scrolling game. The game is running in 640x480x16 screen mode and I''m using DirectDraw. I''m trying to use a set of 32x32 tiles to create each level. The problem I''m having is I''m not getting good frame rates when I redraw all the tiles every frame. I tried creating a huge drawing surface in system memory (the size of the level) and pre-drawing the entire level on that surface, then doing a single blit to the back buffer and a flip each frame. However, I''m still getting a bad frame rate, which is not surprising, since the hardware blits are not available in system memory. I''m not sure what I''m doing wrong, but any help would be appreciated.
Advertisement
Don''t create a huge drawing surface to blit from. Instead, us an array and create and blit directly to the backbuffer the tiles that should appear based on the array and where the camera is relative to it.
I'm not having any problems with the framerate in my 2d tile scrolling engine. 62 fps on my PII 233 MHz.
Do you know how mays fps your is running on? What does your code look like?

Edited by - ZomeonE on 1/20/00 3:34:03 PM
I''m having similar issues with my own scrolling engine. I''m using more of a layer approach as opposed to a tile system. But I''m only getting about 21 fps in 800x600x16 on my p200 mmx.

But I''m not ready to ask for help yet, and I suggest you look into this too.

Try to figure out where your code is spending all of its time. Make sure its really the blits that are slowing it down. You might be surprised at where it really is going on.

Some other suggestions would be to use bltfast, and manage your own clipping, and to only use transparency when you need it. These actions can vary a lot depending on hardware. So I try to minimize them.
To add to what Potsticker said...

If you blits are slow, up your tile size. Obviously you''re going to be doing less blits with 128x128 tiles than with 16x16.

You might also want to run an profiler on your drawing code. There''s an average one available with VC (professional only, I think) or there''s a great commercial one called TrueTime.


Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com
Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!

This topic is closed to new replies.

Advertisement