From videomem to videomem is fast. From sysmem to sysmem is fast. But when you cross over (from sys to video or vice-versa) it's slow.
Hope it help.
Gizz
gizz_01@hotmail.com
From videomem to videomem is fast. From sysmem to sysmem is fast. But when you cross over (from sys to video or vice-versa) it's slow.
Hope it help.
Gizz
gizz_01@hotmail.com
Then there's a solution I'm interested if anyone thinks possible or has made (works for smooth scrolling, too):
See how much the screen position has changed and blit that part of frontbuffer into backbuffer (into correct position) which should still be on the screen. Then blit changed borders into backbuffer.
Of course you'll have to blit those tiles that had characters, monsters etc. on them again to remove old frames.
------------------
"Tank, I need an exit. Fast!"
The game run much faster on the 166 MHz system (about 22 FPS) but dog slow on the 200 MHz system (about 7-8 FPS). Of course I haven't fully optimized the code yet, and many of the above suggestions will help you and me out. But video memory really makes the difference, so I think a newer video card with your current 266 MHz system will get the job done. Of course you still need to optimize for the rest of the world.
------------------
Glen Martin
Dynamic Adventures Inc.
http://www.dynamicadventures.com
I have been fooling around with tile based games off and on for some time now, and have just started doing so 16 bpp code. Is it unrealistic to think I can do a tile based game at 800x600x16bpp on a Pentium 266 with a 4MB matrox millenium card? I am getting pretty rotten frame rate (10-15/s) when blting diretly from offscreen sysmem surface to backbuffer, then flipping. I am blitting 12 x 10 tiles per frame; refreshing the entire screen each frame.
I'm using C++, so there are a lot of GetSurface() sort of calls made for my image libraries, but I would have thought that wouldn't make a big deal..
Anyone have any ideas?
Anyone have any fast 16 bit samples?
Every Blt or Bltfast locks the surface(s) involved (up to 2 lock/unlocks a call). Depending on the size of your tiles, these locks can stack up fast.
A quick and dirty way to handle this, is to lock the backbuffer only once, and use your own blitter. While using Blt/Bltfast you gain the ability to use the hardware blitting engine, the overhead means that isn't practical for a tile based game.
And as the other poster mentioned, you may want to try to use a "dirty rectangle" approach. By only drawing what needs to be drawn, you can maintain a fast framerate.
Ultima Online, which runs at up to 1024x768 in 16 bit color uses this method and it runs decently fast on even older machines (Ran fine on my old 133)
Your best bet, is to try a number of things, and see what provides the best average framerate, on a number of display cards.